Browse code

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>

James Almer authored on 2018/10/31 03:41:21
Showing 2 changed files
... ...
@@ -190,6 +190,8 @@ typedef struct VP9ReferenceFrameState {
190 190
 } VP9ReferenceFrameState;
191 191
 
192 192
 typedef struct CodedBitstreamVP9Context {
193
+    int profile;
194
+
193 195
     // Frame dimensions in 8x8 mode info blocks.
194 196
     uint16_t mi_cols;
195 197
     uint16_t mi_rows;
... ...
@@ -278,15 +278,14 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
278 278
                                      VP9RawFrameHeader *current)
279 279
 {
280 280
     CodedBitstreamVP9Context *vp9 = ctx->priv_data;
281
-    int profile, i;
282
-    int err;
281
+    int err, i;
283 282
 
284 283
     f(2, frame_marker);
285 284
 
286 285
     f(1, profile_low_bit);
287 286
     f(1, profile_high_bit);
288
-    profile = (current->profile_high_bit << 1) + current->profile_low_bit;
289
-    if (profile == 3)
287
+    vp9->profile = (current->profile_high_bit << 1) + current->profile_low_bit;
288
+    if (vp9->profile == 3)
290 289
         fixed(1, reserved_zero, 0);
291 290
 
292 291
     f(1, show_existing_frame);
... ...
@@ -304,7 +303,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
304 304
 
305 305
     if (current->frame_type == VP9_KEY_FRAME) {
306 306
         CHECK(FUNC(frame_sync_code)(ctx, rw, current));
307
-        CHECK(FUNC(color_config)(ctx, rw, current, profile));
307
+        CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile));
308 308
         CHECK(FUNC(frame_size)(ctx, rw, current));
309 309
         CHECK(FUNC(render_size)(ctx, rw, current));
310 310
 
... ...
@@ -324,8 +323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
324 324
          if (current->intra_only == 1) {
325 325
              CHECK(FUNC(frame_sync_code)(ctx, rw, current));
326 326
 
327
-             if (profile > 0) {
328
-                 CHECK(FUNC(color_config)(ctx, rw, current, profile));
327
+             if (vp9->profile > 0) {
328
+                 CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile));
329 329
              } else {
330 330
                  infer(color_space,   1);
331 331
                  infer(subsampling_x, 1);