media: hantro: HEVC: Fix reference frames management
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Tue, 3 May 2022 13:51:38 +0000 (15:51 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:22 +0000 (11:02 +0200)
commit387d1176956883635c63a7d1c91b1f45e19c1777
tree8f5122fd4498137f945f16114571150f0655db2f
parentd7f4149df818463c1d7094b35db6ebd79f46c7bd
media: hantro: HEVC: Fix reference frames management

PoC shall be int the range of -2^31 to 2^31 -1
(HEVC spec section 8.3.1 Decoding process for picture order count).
The current way to know if an entry in reference picture array is free
is to test if PoC = UNUSED_REF. Since UNUSED_REF is defined as '-1' that
could lead to decode issue if one PoC also equal '-1'.
PoC with value = '-1' exists in conformance test SLIST_B_Sony_9.

Change the way unused entries are managed in reference pictures array to
avoid using PoC to detect then.

This patch doesn't change fluster HEVC score.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@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/staging/media/hantro/hantro_g2_hevc_dec.c
drivers/staging/media/hantro/hantro_hevc.c
drivers/staging/media/hantro/hantro_hw.h