Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Nuo Mi <nuomi2021@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/cbs_h266: store SubpicIdVal in the context
Date: Sat, 1 Jul 2023 22:51:06 +0800
Message-ID: <CAFXK13cPt3jKUV-xr21HS1aqg2dBFg2gBJGB-gdPDn53sm9v6A@mail.gmail.com> (raw)
In-Reply-To: <20230701013651.30004-1-jamrial@gmail.com>

On Sat, Jul 1, 2023 at 9:37 AM James Almer <jamrial@gmail.com> wrote:

> And use it to derive CurrSubpicIdx
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/cbs_h266.h                 |  2 ++
>  libavcodec/cbs_h266_syntax_template.c | 34 +++++++++++++--------------
>  2 files changed, 19 insertions(+), 17 deletions(-)
>
> diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h
> index be3c744426..edcb5ad0e3 100644
> --- a/libavcodec/cbs_h266.h
> +++ b/libavcodec/cbs_h266.h
> @@ -552,6 +552,8 @@ typedef struct H266RawPPS {
>      uint16_t num_tiles_in_pic;
>      uint16_t slice_height_in_ctus[VVC_MAX_SLICES];
>      uint16_t num_slices_in_subpic[VVC_MAX_SLICES];
> +    uint16_t sub_pic_id_val[VVC_MAX_SLICES];
> +    uint16_t row_height_val[VVC_MAX_TILE_ROWS];
>
 row_height_val is not related to this patch. Other things are ok.

>  } H266RawPPS;
>
>  typedef struct H266RawAUD {
> diff --git a/libavcodec/cbs_h266_syntax_template.c
> b/libavcodec/cbs_h266_syntax_template.c
> index 863fecdefa..ec2bb1ccc3 100644
> --- a/libavcodec/cbs_h266_syntax_template.c
> +++ b/libavcodec/cbs_h266_syntax_template.c
> @@ -1706,6 +1706,15 @@ static int FUNC(pps) (CodedBitstreamContext *ctx,
> RWContext *rw,
>          }
>      }
>
> +    for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
> +        if (sps->sps_subpic_id_mapping_explicitly_signalled_flag)
> +            current->sub_pic_id_val[i] =
> current->pps_subpic_id_mapping_present_flag
> +                                       ? current->pps_subpic_id[i]
> +                                       : sps->sps_subpic_id[i];
> +        else
> +            current->sub_pic_id_val[i] = i;
> +    }
> +
>      pic_width_in_ctbs_y = AV_CEIL_RSHIFT
>          (current->pps_pic_width_in_luma_samples,
> (sps->sps_log2_ctu_size_minus5 + 5));
>      pic_height_in_ctbs_y = AV_CEIL_RSHIFT(
> @@ -2697,25 +2706,16 @@ static int FUNC(slice_header)
> (CodedBitstreamContext *ctx, RWContext *rw,
>
>      if (sps->sps_subpic_info_present_flag) {
>          ub(sps->sps_subpic_id_len_minus1 + 1, sh_subpic_id);
> -        if (sps->sps_subpic_id_mapping_explicitly_signalled_flag) {
> -            for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
> -                uint16_t subpic_id_val =
> -                    pps->pps_subpic_id_mapping_present_flag ?
> -                    pps->pps_subpic_id[i] : sps->sps_subpic_id[i];
> -                if (subpic_id_val == current->sh_subpic_id) {
> -                    curr_subpic_idx = i;
> -                    break;
> -                }
> -            }
> -        } else {
> -            curr_subpic_idx = current->sh_subpic_id;
> -            if (curr_subpic_idx > sps->sps_num_subpics_minus1) {
> -                av_log(ctx->log_ctx, AV_LOG_ERROR,
> -                       "sh_subpic_id(%d) should in range [0, %d]\n",
> -                       curr_subpic_idx, sps->sps_num_subpics_minus1);
> -                return AVERROR_INVALIDDATA;
> +        for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
> +            if (pps->sub_pic_id_val[i] == current->sh_subpic_id) {
> +                curr_subpic_idx = i;
> +                break;
>              }
>          }
> +        if (i > sps->sps_num_subpics_minus1) {
> +            av_log(ctx->log_ctx, AV_LOG_ERROR, "invalid CurrSubpicIdx
> %d\n", i);
> +            return AVERROR_INVALIDDATA;
> +        }
>      } else {
>          curr_subpic_idx = 0;
>      }
> --
> 2.41.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".
>
_______________________________________________
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".

      parent reply	other threads:[~2023-07-01 14:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  1:36 James Almer
2023-07-01  1:36 ` [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_h266: store RowHeightVal " James Almer
2023-07-01 15:10   ` Nuo Mi
2023-07-01 22:33     ` James Almer
2023-07-01 23:40       ` James Almer
2023-07-01 23:39   ` [FFmpeg-devel] [PATCH v2] avcodec/cbs_h266: store RowHeightVal and ColWidthVal " James Almer
2023-07-01 14:51 ` Nuo Mi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFXK13cPt3jKUV-xr21HS1aqg2dBFg2gBJGB-gdPDn53sm9v6A@mail.gmail.com \
    --to=nuomi2021@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git