You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/cbs_av1: fix handling reference frames on show_existing_frame frames
Implement Section 7.21 "Reference frame loading process" and Section 7.20 "Reference frame update process" for show_existing_frame frames, as required by the definition in Section 7.4 "Decode frame wrapup process". Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -1295,9 +1295,19 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
fb(id_len, display_frame_id);
|
fb(id_len, display_frame_id);
|
||||||
|
|
||||||
infer(frame_type, frame->frame_type);
|
infer(frame_type, frame->frame_type);
|
||||||
if (current->frame_type == AV1_FRAME_KEY)
|
if (current->frame_type == AV1_FRAME_KEY) {
|
||||||
infer(refresh_frame_flags, all_frames);
|
infer(refresh_frame_flags, all_frames);
|
||||||
else
|
|
||||||
|
// Section 7.21
|
||||||
|
infer(current_frame_id, frame->frame_id);
|
||||||
|
priv->upscaled_width = frame->upscaled_width;
|
||||||
|
priv->frame_width = frame->frame_width;
|
||||||
|
priv->frame_height = frame->frame_height;
|
||||||
|
priv->render_width = frame->render_width;
|
||||||
|
priv->render_height = frame->render_height;
|
||||||
|
priv->bit_depth = frame->bit_depth;
|
||||||
|
priv->order_hint = frame->order_hint;
|
||||||
|
} else
|
||||||
infer(refresh_frame_flags, 0);
|
infer(refresh_frame_flags, 0);
|
||||||
|
|
||||||
infer(frame_width_minus_1, frame->upscaled_width - 1);
|
infer(frame_width_minus_1, frame->upscaled_width - 1);
|
||||||
@@ -1305,13 +1315,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
infer(render_width_minus_1, frame->render_width - 1);
|
infer(render_width_minus_1, frame->render_width - 1);
|
||||||
infer(render_height_minus_1, frame->render_height - 1);
|
infer(render_height_minus_1, frame->render_height - 1);
|
||||||
|
|
||||||
priv->upscaled_width = frame->upscaled_width;
|
// Section 7.20
|
||||||
priv->frame_width = frame->frame_width;
|
goto update_refs;
|
||||||
priv->frame_height = frame->frame_height;
|
|
||||||
priv->render_width = frame->render_width;
|
|
||||||
priv->render_height = frame->render_height;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fb(2, frame_type);
|
fb(2, frame_type);
|
||||||
@@ -1573,6 +1578,16 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
|
|
||||||
CHECK(FUNC(film_grain_params)(ctx, rw, current));
|
CHECK(FUNC(film_grain_params)(ctx, rw, current));
|
||||||
|
|
||||||
|
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", priv->order_hint,
|
||||||
|
priv->frame_width, priv->frame_height, priv->upscaled_width,
|
||||||
|
priv->render_width, priv->render_height,
|
||||||
|
seq->color_config.subsampling_x + 1,
|
||||||
|
seq->color_config.subsampling_y + 1, priv->bit_depth,
|
||||||
|
priv->tile_rows, priv->tile_cols);
|
||||||
|
|
||||||
|
update_refs:
|
||||||
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
|
for (i = 0; i < AV1_NUM_REF_FRAMES; i++) {
|
||||||
if (current->refresh_frame_flags & (1 << i)) {
|
if (current->refresh_frame_flags & (1 << i)) {
|
||||||
priv->ref[i] = (AV1ReferenceFrameState) {
|
priv->ref[i] = (AV1ReferenceFrameState) {
|
||||||
@@ -1592,15 +1607,6 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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", priv->order_hint,
|
|
||||||
priv->frame_width, priv->frame_height, priv->upscaled_width,
|
|
||||||
priv->render_width, priv->render_height,
|
|
||||||
seq->color_config.subsampling_x + 1,
|
|
||||||
seq->color_config.subsampling_y + 1, priv->bit_depth,
|
|
||||||
priv->tile_rows, priv->tile_cols);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user