diff mbox series

[FFmpeg-devel,v2] cbs_av1: Fill tile width/height values when uniform_tile_spacing_flag is set

Message ID c83e5c1a-c91e-b74c-8cf2-162e990875a2@jkqxz.net
State Accepted
Headers show
Series [FFmpeg-devel,v2] cbs_av1: Fill tile width/height values when uniform_tile_spacing_flag is set | expand

Checks

Context Check Description
andriy/default pending
andriy/configure warning Failed to apply patch

Commit Message

Mark Thompson Aug. 31, 2020, 9 p.m. UTC
They are not explicitly in the bitstream in this case, but it is helpful
to be able to use these values without always needing to check the flag
beforehand.
---
On 31/08/2020 08:31, Wang, Fei W wrote:>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
>> Thompson
>> Sent: Sunday, August 23, 2020 6:26 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH] cbs_av1: Fill tile width/height values when
>> uniform_tile_spacing_flag is set
>>
>> They are not explicitly in the bitstream in this case, but it is helpful to be able to
>> use these values without always needing to check the flag beforehand.
>> ---
>>    libavcodec/cbs_av1_syntax_template.c | 9 +++++++++
>>    1 file changed, 9 insertions(+)
>>
>> diff --git a/libavcodec/cbs_av1_syntax_template.c
>> b/libavcodec/cbs_av1_syntax_template.c
>> index a315e8868a..2c976a9574 100644
>> --- a/libavcodec/cbs_av1_syntax_template.c
>> +++ b/libavcodec/cbs_av1_syntax_template.c
>> @@ -624,6 +624,15 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx,
>> RWContext *rw,
>>                current->tile_rows_log2;
>>            current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
>>
>> +        for (i = 0; i < current->tile_cols - 1; i++)
>> +            infer(width_in_sbs_minus_1[i], tile_width_sb);
>> +        infer(width_in_sbs_minus_1[i],
>> +              sb_cols - (current->tile_cols - 1) * tile_width_sb);
> Should this by using "tile_width_sb -1" and "sb_cols - (current->tile_cols - 1) * tile_width_sb - 1" ?  And same for height_in_sbs_minus_1.

Oops, yeah (just looking at the numbers to check means you don't notice the minus_1).

>> +        for (i = 0; i < current->tile_rows - 1; i++)
>> +            infer(height_in_sbs_minus_1[i], tile_height_sb);
>> +        infer(height_in_sbs_minus_1[i],
>> +              sb_rows - (current->tile_rows - 1) * tile_height_sb);
>> +
>>        } else {
>>            int widest_tile_sb, start_sb, size_sb, max_width, max_height;
>>

New version enclosing.

Thanks,

- Mark

  libavcodec/cbs_av1_syntax_template.c | 9 +++++++++
  1 file changed, 9 insertions(+)

Comments

Fei Wang Sept. 1, 2020, 7:16 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
> Thompson
> Sent: Tuesday, September 1, 2020 5:01 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v2] cbs_av1: Fill tile width/height values when
> uniform_tile_spacing_flag is set
> 
> They are not explicitly in the bitstream in this case, but it is helpful to be able to
> use these values without always needing to check the flag beforehand.
> ---
> On 31/08/2020 08:31, Wang, Fei W wrote:>> -----Original Message-----
> >> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> >> Mark Thompson
> >> Sent: Sunday, August 23, 2020 6:26 AM
> >> To: ffmpeg-devel@ffmpeg.org
> >> Subject: [FFmpeg-devel] [PATCH] cbs_av1: Fill tile width/height
> >> values when uniform_tile_spacing_flag is set
> >>
> >> They are not explicitly in the bitstream in this case, but it is
> >> helpful to be able to use these values without always needing to check the
> flag beforehand.
> >> ---
> >>    libavcodec/cbs_av1_syntax_template.c | 9 +++++++++
> >>    1 file changed, 9 insertions(+)
> >>
> >> diff --git a/libavcodec/cbs_av1_syntax_template.c
> >> b/libavcodec/cbs_av1_syntax_template.c
> >> index a315e8868a..2c976a9574 100644
> >> --- a/libavcodec/cbs_av1_syntax_template.c
> >> +++ b/libavcodec/cbs_av1_syntax_template.c
> >> @@ -624,6 +624,15 @@ static int FUNC(tile_info)(CodedBitstreamContext
> >> *ctx, RWContext *rw,
> >>                current->tile_rows_log2;
> >>            current->tile_rows = (sb_rows + tile_height_sb - 1) /
> >> tile_height_sb;
> >>
> >> +        for (i = 0; i < current->tile_cols - 1; i++)
> >> +            infer(width_in_sbs_minus_1[i], tile_width_sb);
> >> +        infer(width_in_sbs_minus_1[i],
> >> +              sb_cols - (current->tile_cols - 1) * tile_width_sb);
> > Should this by using "tile_width_sb -1" and "sb_cols - (current->tile_cols - 1) *
> tile_width_sb - 1" ?  And same for height_in_sbs_minus_1.
> 
> Oops, yeah (just looking at the numbers to check means you don't notice the
> minus_1).
> 
> >> +        for (i = 0; i < current->tile_rows - 1; i++)
> >> +            infer(height_in_sbs_minus_1[i], tile_height_sb);
> >> +        infer(height_in_sbs_minus_1[i],
> >> +              sb_rows - (current->tile_rows - 1) * tile_height_sb);
> >> +
> >>        } else {
> >>            int widest_tile_sb, start_sb, size_sb, max_width,
> >> max_height;
> >>
> 
> New version enclosing.
> 
> Thanks,
> 
> - Mark
> 
>   libavcodec/cbs_av1_syntax_template.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/libavcodec/cbs_av1_syntax_template.c
> b/libavcodec/cbs_av1_syntax_template.c
> index 19b82bc3f8..2d2e240e3e 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -636,6 +636,15 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx,
> RWContext *rw,
>               current->tile_rows_log2;
>           current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
> 
> +        for (i = 0; i < current->tile_cols - 1; i++)
> +            infer(width_in_sbs_minus_1[i], tile_width_sb - 1);
> +        infer(width_in_sbs_minus_1[i],
> +              sb_cols - (current->tile_cols - 1) * tile_width_sb - 1);
> +        for (i = 0; i < current->tile_rows - 1; i++)
> +            infer(height_in_sbs_minus_1[i], tile_height_sb - 1);
> +        infer(height_in_sbs_minus_1[i],
> +              sb_rows - (current->tile_rows - 1) * tile_height_sb - 1);
> +
LGTM, could you help to merge this patch? I will submit 2nd version of VAAPI AV1
decoder patch base on this change. Thanks.

>       } else {
>           int widest_tile_sb, start_sb, size_sb, max_width, max_height;
> 
> --
> 2.28.0
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org
> with subject "unsubscribe".
Mark Thompson Sept. 1, 2020, 11:13 p.m. UTC | #2
On 01/09/2020 08:16, Wang, Fei W wrote:
> 
> 
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
>> Thompson
>> Sent: Tuesday, September 1, 2020 5:01 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH v2] cbs_av1: Fill tile width/height values when
>> uniform_tile_spacing_flag is set
>>
>> They are not explicitly in the bitstream in this case, but it is helpful to be able to
>> use these values without always needing to check the flag beforehand.
>> ---
>> ...
>>
>>    libavcodec/cbs_av1_syntax_template.c | 9 +++++++++
>>    1 file changed, 9 insertions(+)
>>
>> diff --git a/libavcodec/cbs_av1_syntax_template.c
>> b/libavcodec/cbs_av1_syntax_template.c
>> index 19b82bc3f8..2d2e240e3e 100644
>> --- a/libavcodec/cbs_av1_syntax_template.c
>> +++ b/libavcodec/cbs_av1_syntax_template.c
>> @@ -636,6 +636,15 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx,
>> RWContext *rw,
>>                current->tile_rows_log2;
>>            current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
>>
>> +        for (i = 0; i < current->tile_cols - 1; i++)
>> +            infer(width_in_sbs_minus_1[i], tile_width_sb - 1);
>> +        infer(width_in_sbs_minus_1[i],
>> +              sb_cols - (current->tile_cols - 1) * tile_width_sb - 1);
>> +        for (i = 0; i < current->tile_rows - 1; i++)
>> +            infer(height_in_sbs_minus_1[i], tile_height_sb - 1);
>> +        infer(height_in_sbs_minus_1[i],
>> +              sb_rows - (current->tile_rows - 1) * tile_height_sb - 1);
>> +
> LGTM, could you help to merge this patch? I will submit 2nd version of VAAPI AV1
> decoder patch base on this change. Thanks.

Applied - thank you for the review!

- Mark
diff mbox series

Patch

diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 19b82bc3f8..2d2e240e3e 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -636,6 +636,15 @@  static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
              current->tile_rows_log2;
          current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;

+        for (i = 0; i < current->tile_cols - 1; i++)
+            infer(width_in_sbs_minus_1[i], tile_width_sb - 1);
+        infer(width_in_sbs_minus_1[i],
+              sb_cols - (current->tile_cols - 1) * tile_width_sb - 1);
+        for (i = 0; i < current->tile_rows - 1; i++)
+            infer(height_in_sbs_minus_1[i], tile_height_sb - 1);
+        infer(height_in_sbs_minus_1[i],
+              sb_rows - (current->tile_rows - 1) * tile_height_sb - 1);
+
      } else {
          int widest_tile_sb, start_sb, size_sb, max_width, max_height;