]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: h264: Avoid wrapping long_term_frame_idx
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 26 Apr 2022 12:57:30 +0000 (14:57 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 12:59:54 +0000 (14:59 +0200)
For long term references, frame_num is set to long_term_frame_idx which
does not require wrapping. This is fixed by observation, no directly
related issue have been found yet.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-h264.c

index 5633a242520a09a05b4ce84828361bc2663c92cb..ac47519a9fbe41dc1f216e48e06edcf81468ae9b 100644 (file)
@@ -57,8 +57,10 @@ v4l2_h264_init_reflist_builder(struct v4l2_h264_reflist_builder *b,
                 * '8.2.4.1 Decoding process for picture numbers' of the spec.
                 * TODO: This logic will have to be adjusted when we start
                 * supporting interlaced content.
+                * For long term references, frame_num is set to
+                * long_term_frame_idx which requires no wrapping.
                 */
-               if (dpb[i].frame_num > cur_frame_num)
+               if (!b->refs[i].longterm && dpb[i].frame_num > cur_frame_num)
                        b->refs[i].frame_num = (int)dpb[i].frame_num -
                                               max_frame_num;
                else