diff mbox series

[v1,03/24] media: h264: Avoid wrapping long_term_frame_idx

Message ID 20220328195936.82552-4-nicolas.dufresne@collabora.com (mailing list archive)
State New, archived
Headers show
Series [v1,01/24] media: h264: Increase reference lists size to 32 | expand

Commit Message

Nicolas Dufresne March 28, 2022, 7:59 p.m. UTC
For long term reference, frame_num is set to long_term_frame_idx which
does not require wrapping. This if fixed by observation, no directly
related issue have been found yet.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
 drivers/media/v4l2-core/v4l2-h264.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sebastian Fricke March 29, 2022, 8:35 a.m. UTC | #1
On 28.03.2022 15:59, Nicolas Dufresne wrote:
>For long term reference, frame_num is set to long_term_frame_idx which

s/reference/references/

>does not require wrapping. This if fixed by observation, no directly

s/This if/This is/

>related issue have been found yet.
>
>Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>

>---
> drivers/media/v4l2-core/v4l2-h264.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c
>index 8d750ee69e74..aebed1cbe05a 100644
>--- a/drivers/media/v4l2-core/v4l2-h264.c
>+++ b/drivers/media/v4l2-core/v4l2-h264.c
>@@ -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.

As you change the logic can't you remove the TODO comment now?

>+		 * For long term reference, frame_num is set to

s/reference/references/

Greetings,
Sebastian

>+		 * 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
>-- 
>2.34.1
>
Nicolas Dufresne March 31, 2022, 4:28 p.m. UTC | #2
Le mardi 29 mars 2022 à 10:35 +0200, Sebastian Fricke a écrit :
> On 28.03.2022 15:59, Nicolas Dufresne wrote:
> > For long term reference, frame_num is set to long_term_frame_idx which
> 
> s/reference/references/
> 
> > does not require wrapping. This if fixed by observation, no directly
> 
> s/This if/This is/
> 
> > related issue have been found yet.
> > 
> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>
> 
> > ---
> > drivers/media/v4l2-core/v4l2-h264.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c
> > index 8d750ee69e74..aebed1cbe05a 100644
> > --- a/drivers/media/v4l2-core/v4l2-h264.c
> > +++ b/drivers/media/v4l2-core/v4l2-h264.c
> > @@ -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.
> 
> As you change the logic can't you remove the TODO comment now?

Not yet, as I'm not fixing it here. Its removed in:

[PATCH v1 05/24] media: h264: Store all fields into the unordered list

> 
> > +		 * For long term reference, frame_num is set to
> 
> s/reference/references/
> 
> Greetings,
> Sebastian
> 
> > +		 * 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
> > -- 
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c
index 8d750ee69e74..aebed1cbe05a 100644
--- a/drivers/media/v4l2-core/v4l2-h264.c
+++ b/drivers/media/v4l2-core/v4l2-h264.c
@@ -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 reference, 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