[FFmpeg-cvslog] avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1Context
James Almer
git at videolan.org
Sun Sep 6 04:38:08 EEST 2020
ffmpeg | branch: release/4.3 | James Almer <jamrial at gmail.com> | Mon Aug 24 12:37:23 2020 -0300| [408592c838402da1df4e00b3aeaf66a5142fccf1] | committer: James Almer
avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1Context
This follows the spec and will come in handy in a following commit.
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit e3ed0ce32aaee0487533b10c18f81ab05fd31fa8)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=408592c838402da1df4e00b3aeaf66a5142fccf1
---
libavcodec/cbs_av1.h | 1 +
libavcodec/cbs_av1_syntax_template.c | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
index 7182c61866..1adb5ae070 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -429,6 +429,7 @@ typedef struct CodedBitstreamAV1Context {
int operating_point_idc;
int bit_depth;
+ int order_hint;
int frame_width;
int frame_height;
int upscaled_width;
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 9f8f46bc95..6617721e6c 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -366,7 +366,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
for (i = 0; i < AV1_NUM_REF_FRAMES; i++)
shifted_order_hints[i] = cur_frame_hint +
cbs_av1_get_relative_dist(seq, priv->ref[i].order_hint,
- current->order_hint);
+ priv->order_hint);
latest_order_hint = shifted_order_hints[current->last_frame_idx];
earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
@@ -993,7 +993,7 @@ static int FUNC(skip_mode_params)(CodedBitstreamContext *ctx, RWContext *rw,
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
ref_hint = priv->ref[current->ref_frame_idx[i]].order_hint;
dist = cbs_av1_get_relative_dist(seq, ref_hint,
- current->order_hint);
+ priv->order_hint);
if (dist < 0) {
if (forward_idx < 0 ||
cbs_av1_get_relative_dist(seq, ref_hint,
@@ -1367,6 +1367,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
fb(order_hint_bits, order_hint);
else
infer(order_hint, 0);
+ priv->order_hint = current->order_hint;
if (frame_is_intra || current->error_resilient_mode)
infer(primary_ref_frame, AV1_PRIMARY_REF_NONE);
@@ -1556,14 +1557,14 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
.subsampling_x = seq->color_config.subsampling_x,
.subsampling_y = seq->color_config.subsampling_y,
.bit_depth = priv->bit_depth,
- .order_hint = current->order_hint,
+ .order_hint = priv->order_hint,
};
}
}
av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame %d: size %dx%d "
"upscaled %d render %dx%d subsample %dx%d "
- "bitdepth %d tiles %dx%d.\n", current->order_hint,
+ "bitdepth %d tiles %dx%d.\n", priv->order_hint,
priv->frame_width, priv->frame_height, priv->upscaled_width,
priv->render_width, priv->render_height,
seq->color_config.subsampling_x + 1,
More information about the ffmpeg-cvslog
mailing list