[FFmpeg-devel] [PATCH] lavc/vvc: Correct sps_num_subpics_minus1 minimum

James Almer jamrial at gmail.com
Sun Feb 25 21:50:51 EET 2024


On 2/25/2024 2:51 PM, Frank Plowman wrote:
> The spec says "the value of sps_num_subpics_minus1 shall be in the
> range of 0 to MaxSlicesPerAu − 1, inclusive."
> 
> Signed-off-by: Frank Plowman <post at frankplowman.com>
> ---
>   libavcodec/cbs_h266_syntax_template.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
> index 26ee7a420b..1d4d0c796f 100644
> --- a/libavcodec/cbs_h266_syntax_template.c
> +++ b/libavcodec/cbs_h266_syntax_template.c
> @@ -1130,7 +1130,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
>   
>       flag(sps_subpic_info_present_flag);
>       if (current->sps_subpic_info_present_flag) {
> -        ue(sps_num_subpics_minus1, 1, VVC_MAX_SLICES - 1);
> +        ue(sps_num_subpics_minus1, 0, VVC_MAX_SLICES - 1);

Strictly speaking, MaxSlicesPerAu varies depending on the stream's 
general_level_idc value, listed in table A.2 from Annex-A (in ITU-T 
H.266 V3).

Right now, VVC_MAX_SLICES is defined as 600 in vvc.h, but the max value 
in the spec is 1000, from level 6.3. I assume it was added in V3?

>           if (current->sps_num_subpics_minus1 > 0) {
>               flag(sps_independent_subpics_flag);
>               flag(sps_subpic_same_size_flag);


More information about the ffmpeg-devel mailing list