diff options
author | James Almer <jamrial@gmail.com> | 2018-10-30 15:41:21 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-10-30 20:55:44 -0300 |
commit | 7aaf092f8ce8708bc745e0c27746d3312a2421d5 (patch) | |
tree | 95f769128307c26f39d25f19253486f4391be356 | |
parent | ec440339b2cd2b1e9dd306fe69cfcff5d75dcd28 (diff) | |
download | ffmpeg-7aaf092f8ce8708bc745e0c27746d3312a2421d5.tar.gz |
avcodec/cbs_vp9: store profile in the private context
Derived from profile_low_bit and profile_high_bit.
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/cbs_vp9.h | 2 | ||||
-rw-r--r-- | libavcodec/cbs_vp9_syntax_template.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/cbs_vp9.h b/libavcodec/cbs_vp9.h index dac8171c4a..4c9b2f880d 100644 --- a/libavcodec/cbs_vp9.h +++ b/libavcodec/cbs_vp9.h @@ -190,6 +190,8 @@ typedef struct VP9ReferenceFrameState { } VP9ReferenceFrameState; typedef struct CodedBitstreamVP9Context { + int profile; + // Frame dimensions in 8x8 mode info blocks. uint16_t mi_cols; uint16_t mi_rows; diff --git a/libavcodec/cbs_vp9_syntax_template.c b/libavcodec/cbs_vp9_syntax_template.c index bbf104c8be..898cede329 100644 --- a/libavcodec/cbs_vp9_syntax_template.c +++ b/libavcodec/cbs_vp9_syntax_template.c @@ -278,15 +278,14 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current) { CodedBitstreamVP9Context *vp9 = ctx->priv_data; - int profile, i; - int err; + int err, i; f(2, frame_marker); f(1, profile_low_bit); f(1, profile_high_bit); - profile = (current->profile_high_bit << 1) + current->profile_low_bit; - if (profile == 3) + vp9->profile = (current->profile_high_bit << 1) + current->profile_low_bit; + if (vp9->profile == 3) fixed(1, reserved_zero, 0); f(1, show_existing_frame); @@ -304,7 +303,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, if (current->frame_type == VP9_KEY_FRAME) { CHECK(FUNC(frame_sync_code)(ctx, rw, current)); - CHECK(FUNC(color_config)(ctx, rw, current, profile)); + CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile)); CHECK(FUNC(frame_size)(ctx, rw, current)); CHECK(FUNC(render_size)(ctx, rw, current)); @@ -324,8 +323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, if (current->intra_only == 1) { CHECK(FUNC(frame_sync_code)(ctx, rw, current)); - if (profile > 0) { - CHECK(FUNC(color_config)(ctx, rw, current, profile)); + if (vp9->profile > 0) { + CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile)); } else { infer(color_space, 1); infer(subsampling_x, 1); |