mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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@gmail.com>
This commit is contained in:
parent
09e260f69a
commit
e3ed0ce32a
@ -429,6 +429,7 @@ typedef struct CodedBitstreamAV1Context {
|
|||||||
int operating_point_idc;
|
int operating_point_idc;
|
||||||
|
|
||||||
int bit_depth;
|
int bit_depth;
|
||||||
|
int order_hint;
|
||||||
int frame_width;
|
int frame_width;
|
||||||
int frame_height;
|
int frame_height;
|
||||||
int upscaled_width;
|
int upscaled_width;
|
||||||
|
@ -373,7 +373,7 @@ static int FUNC(set_frame_refs)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
for (i = 0; i < AV1_NUM_REF_FRAMES; i++)
|
for (i = 0; i < AV1_NUM_REF_FRAMES; i++)
|
||||||
shifted_order_hints[i] = cur_frame_hint +
|
shifted_order_hints[i] = cur_frame_hint +
|
||||||
cbs_av1_get_relative_dist(seq, priv->ref[i].order_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];
|
latest_order_hint = shifted_order_hints[current->last_frame_idx];
|
||||||
earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
|
earliest_order_hint = shifted_order_hints[current->golden_frame_idx];
|
||||||
@ -1005,7 +1005,7 @@ static int FUNC(skip_mode_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
|
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
|
||||||
ref_hint = priv->ref[current->ref_frame_idx[i]].order_hint;
|
ref_hint = priv->ref[current->ref_frame_idx[i]].order_hint;
|
||||||
dist = cbs_av1_get_relative_dist(seq, ref_hint,
|
dist = cbs_av1_get_relative_dist(seq, ref_hint,
|
||||||
current->order_hint);
|
priv->order_hint);
|
||||||
if (dist < 0) {
|
if (dist < 0) {
|
||||||
if (forward_idx < 0 ||
|
if (forward_idx < 0 ||
|
||||||
cbs_av1_get_relative_dist(seq, ref_hint,
|
cbs_av1_get_relative_dist(seq, ref_hint,
|
||||||
@ -1397,6 +1397,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
fb(order_hint_bits, order_hint);
|
fb(order_hint_bits, order_hint);
|
||||||
else
|
else
|
||||||
infer(order_hint, 0);
|
infer(order_hint, 0);
|
||||||
|
priv->order_hint = current->order_hint;
|
||||||
|
|
||||||
if (frame_is_intra || current->error_resilient_mode)
|
if (frame_is_intra || current->error_resilient_mode)
|
||||||
infer(primary_ref_frame, AV1_PRIMARY_REF_NONE);
|
infer(primary_ref_frame, AV1_PRIMARY_REF_NONE);
|
||||||
@ -1586,14 +1587,14 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
.subsampling_x = seq->color_config.subsampling_x,
|
.subsampling_x = seq->color_config.subsampling_x,
|
||||||
.subsampling_y = seq->color_config.subsampling_y,
|
.subsampling_y = seq->color_config.subsampling_y,
|
||||||
.bit_depth = priv->bit_depth,
|
.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 "
|
av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame %d: size %dx%d "
|
||||||
"upscaled %d render %dx%d subsample %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->frame_width, priv->frame_height, priv->upscaled_width,
|
||||||
priv->render_width, priv->render_height,
|
priv->render_width, priv->render_height,
|
||||||
seq->color_config.subsampling_x + 1,
|
seq->color_config.subsampling_x + 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user