Skip to content

Commit

Permalink
media: rkvdec: h264: Fix reference frame_num wrap for second field
Browse files Browse the repository at this point in the history
When decoding the second field in a complementary field pair the second
field is sharing the same frame_num with the first field.

Currently the frame_num for the first field is wrapped when it matches the
field being decoded, this cause issues to decode the second field in a
complementary field pair.

Fix this by using inclusive comparison, less than or equal.

Signed-off-by: Jonas Karlman <[email protected]>
Reviewed-by: Ezequiel Garcia <[email protected]>
  • Loading branch information
Kwiboo authored and sigmaris committed Aug 8, 2020
1 parent 0477058 commit f79f871
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/rkvdec/rkvdec-h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx,
continue;

if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM ||
dpb[i].frame_num < dec_params->frame_num) {
dpb[i].frame_num <= dec_params->frame_num) {
p[i] = dpb[i].frame_num;
continue;
}
Expand Down

0 comments on commit f79f871

Please sign in to comment.