From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/cbs_av1: rename the private frame_header fields to frame_header_data Date: Sun, 27 Mar 2022 22:08:50 -0300 Message-ID: <20220328010851.1193-1-jamrial@gmail.com> (raw) It doesn't contain the decomposed struct, but the raw bitstream. This is in preparation for the following patch. Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/cbs_av1.c | 6 +++--- libavcodec/cbs_av1.h | 6 +++--- libavcodec/cbs_av1_syntax_template.c | 28 ++++++++++++++-------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 1229480567..ecd775ea2a 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -1249,9 +1249,9 @@ static void cbs_av1_flush(CodedBitstreamContext *ctx) { CodedBitstreamAV1Context *priv = ctx->priv_data; - av_buffer_unref(&priv->frame_header_ref); + av_buffer_unref(&priv->frame_header_data_ref); priv->sequence_header = NULL; - priv->frame_header = NULL; + priv->frame_header_data = NULL; memset(priv->ref, 0, sizeof(priv->ref)); priv->operating_point_idc = 0; @@ -1264,7 +1264,7 @@ static void cbs_av1_close(CodedBitstreamContext *ctx) CodedBitstreamAV1Context *priv = ctx->priv_data; av_buffer_unref(&priv->sequence_header_ref); - av_buffer_unref(&priv->frame_header_ref); + av_buffer_unref(&priv->frame_header_data_ref); } static void cbs_av1_free_metadata(void *unit, uint8_t *content) diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index 1fc80dcfa0..d4776b7a30 100644 --- a/libavcodec/cbs_av1.h +++ b/libavcodec/cbs_av1.h @@ -431,9 +431,9 @@ typedef struct CodedBitstreamAV1Context { AVBufferRef *sequence_header_ref; int seen_frame_header; - AVBufferRef *frame_header_ref; - uint8_t *frame_header; - size_t frame_header_size; + AVBufferRef *frame_header_data_ref; + uint8_t *frame_header_data; + size_t frame_header_data_size; int temporal_id; int spatial_id; diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index d98d3d42de..bd50cfbe38 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -1698,12 +1698,12 @@ static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, HEADER("Redundant Frame Header"); - av_assert0(priv->frame_header_ref && priv->frame_header); + av_assert0(priv->frame_header_data_ref && priv->frame_header_data); - init_get_bits(&fh, priv->frame_header, - priv->frame_header_size); - for (i = 0; i < priv->frame_header_size; i += 8) { - b = FFMIN(priv->frame_header_size - i, 8); + init_get_bits(&fh, priv->frame_header_data, + priv->frame_header_data_size); + for (i = 0; i < priv->frame_header_data_size; i += 8) { + b = FFMIN(priv->frame_header_data_size - i, 8); val = get_bits(&fh, b); xf(b, frame_header_copy[i], val, val, val, 1, i / 8); @@ -1730,7 +1730,7 @@ static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, } else { priv->seen_frame_header = 1; - av_buffer_unref(&priv->frame_header_ref); + av_buffer_unref(&priv->frame_header_data_ref); #ifdef READ fh_bits = get_bits_count(rw) - start_pos; @@ -1748,20 +1748,20 @@ static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, #endif fh_bytes = (fh_bits + 7) / 8; - priv->frame_header_size = fh_bits; + priv->frame_header_data_size = fh_bits; if (rw_buffer_ref) { - priv->frame_header_ref = av_buffer_ref(rw_buffer_ref); - if (!priv->frame_header_ref) + priv->frame_header_data_ref = av_buffer_ref(rw_buffer_ref); + if (!priv->frame_header_data_ref) return AVERROR(ENOMEM); - priv->frame_header = fh_start; + priv->frame_header_data = fh_start; } else { - priv->frame_header_ref = + priv->frame_header_data_ref = av_buffer_alloc(fh_bytes + AV_INPUT_BUFFER_PADDING_SIZE); - if (!priv->frame_header_ref) + if (!priv->frame_header_data_ref) return AVERROR(ENOMEM); - priv->frame_header = priv->frame_header_ref->data; - memcpy(priv->frame_header, fh_start, fh_bytes); + priv->frame_header_data = priv->frame_header_data_ref->data; + memcpy(priv->frame_header_data, fh_start, fh_bytes); } } } -- 2.35.1 _______________________________________________ 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".
next reply other threads:[~2022-03-28 1:09 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-28 1:08 James Almer [this message] 2022-03-28 1:08 ` [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_av1: also copy the last frame header's decomposed content when parsing redundant frame headers James Almer 2022-04-30 18:50 ` Mark Thompson
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=20220328010851.1193-1-jamrial@gmail.com \ --to=jamrial@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