avcodec/hevc_ps: extract SPS fields required for hvcC construction
authorAman Gupta <aman@tmm1.net>
Wed, 27 Sep 2017 01:04:12 +0000 (18:04 -0700)
committerAman Gupta <aman@tmm1.net>
Thu, 28 Sep 2017 23:47:46 +0000 (16:47 -0700)
Signed-off-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/hevc_ps.c
libavcodec/hevc_ps.h

index 500fee0..902917d 100644 (file)
@@ -893,7 +893,7 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
         return AVERROR_INVALIDDATA;
     }
 
-    skip_bits1(gb); // temporal_id_nesting_flag
+    sps->temporal_id_nesting_flag = get_bits(gb, 1);
 
     if ((ret = parse_ptl(gb, avctx, &sps->ptl, sps->max_sub_layers)) < 0)
         return ret;
@@ -956,6 +956,7 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
                sps->bit_depth, bit_depth_chroma);
         return AVERROR_INVALIDDATA;
     }
+    sps->bit_depth_chroma = bit_depth_chroma;
 
     ret = map_pixel_format(avctx, sps);
     if (ret < 0)
index 4e6c3bc..76f8eb3 100644 (file)
@@ -232,6 +232,7 @@ typedef struct HEVCSPS {
     HEVCWindow pic_conf_win;
 
     int bit_depth;
+    int bit_depth_chroma;
     int pixel_shift;
     enum AVPixelFormat pix_fmt;
 
@@ -244,6 +245,7 @@ typedef struct HEVCSPS {
         int num_reorder_pics;
         int max_latency_increase;
     } temporal_layer[HEVC_MAX_SUB_LAYERS];
+    uint8_t temporal_id_nesting_flag;
 
     VUI vui;
     PTL ptl;