avcodec/cbs_av1: split film grain param fields into their own struct

Cosmetic change in preparation for the following patches.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2020-11-25 16:56:51 -03:00
parent e4c3ec3e00
commit aea80e2273
4 changed files with 77 additions and 70 deletions
+5 -4
View File
@@ -1194,7 +1194,8 @@ static int FUNC(global_motion_params)(CodedBitstreamContext *ctx, RWContext *rw,
}
static int FUNC(film_grain_params)(CodedBitstreamContext *ctx, RWContext *rw,
AV1RawFrameHeader *current)
AV1RawFilmGrainParams *current,
AV1RawFrameHeader *frame_header)
{
CodedBitstreamAV1Context *priv = ctx->priv_data;
const AV1RawSequenceHeader *seq = priv->sequence_header;
@@ -1202,7 +1203,7 @@ static int FUNC(film_grain_params)(CodedBitstreamContext *ctx, RWContext *rw,
int i, err;
if (!seq->film_grain_params_present ||
(!current->show_frame && !current->showable_frame))
(!frame_header->show_frame && !frame_header->showable_frame))
return 0;
flag(apply_grain);
@@ -1212,7 +1213,7 @@ static int FUNC(film_grain_params)(CodedBitstreamContext *ctx, RWContext *rw,
fb(16, grain_seed);
if (current->frame_type == AV1_FRAME_INTER)
if (frame_header->frame_type == AV1_FRAME_INTER)
flag(update_grain);
else
infer(update_grain, 1);
@@ -1635,7 +1636,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(global_motion_params)(ctx, rw, current));
CHECK(FUNC(film_grain_params)(ctx, rw, current));
CHECK(FUNC(film_grain_params)(ctx, rw, &current->film_grain, current));
av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame %d: size %dx%d "
"upscaled %d render %dx%d subsample %dx%d "