aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-02-13 12:40:52 -0800
committerPhilip Langdale <philipl@overt.org>2019-02-16 08:47:36 -0800
commitf4ea930a119298c6110ee4e3d24219a66e27e230 (patch)
tree24f323112da6bfb6e10338f3242174a3ea1b5ef4
parent9e1e5213933dfed529f0cecac7304236a786177e (diff)
downloadffmpeg-f4ea930a119298c6110ee4e3d24219a66e27e230.tar.gz
avcodec/hevc_ps: Expose all SPS and PPS range extension flags
We need all the flags to be exposed to be able to pass them on to HW decoders. I did not attempt to nuance any of the warnings about flags being unsupported as there's no way, at the point we extract flags, to say whether an HW decoder is being used.
-rw-r--r--libavcodec/hevc_ps.c19
-rw-r--r--libavcodec/hevc_ps.h4
2 files changed, 12 insertions, 11 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index ea984af0a1..80df417e4f 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1102,20 +1102,17 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
decode_vui(gb, avctx, apply_defdispwin, sps);
if (get_bits1(gb)) { // sps_extension_flag
- int sps_range_extension_flag = get_bits1(gb);
+ sps->sps_range_extension_flag = get_bits1(gb);
skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7);
- if (sps_range_extension_flag) {
- int extended_precision_processing_flag;
- int cabac_bypass_alignment_enabled_flag;
-
+ if (sps->sps_range_extension_flag) {
sps->transform_skip_rotation_enabled_flag = get_bits1(gb);
sps->transform_skip_context_enabled_flag = get_bits1(gb);
sps->implicit_rdpcm_enabled_flag = get_bits1(gb);
sps->explicit_rdpcm_enabled_flag = get_bits1(gb);
- extended_precision_processing_flag = get_bits1(gb);
- if (extended_precision_processing_flag)
+ sps->extended_precision_processing_flag = get_bits1(gb);
+ if (sps->extended_precision_processing_flag)
av_log(avctx, AV_LOG_WARNING,
"extended_precision_processing_flag not yet implemented\n");
@@ -1127,8 +1124,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
sps->persistent_rice_adaptation_enabled_flag = get_bits1(gb);
- cabac_bypass_alignment_enabled_flag = get_bits1(gb);
- if (cabac_bypass_alignment_enabled_flag)
+ sps->cabac_bypass_alignment_enabled_flag = get_bits1(gb);
+ if (sps->cabac_bypass_alignment_enabled_flag)
av_log(avctx, AV_LOG_WARNING,
"cabac_bypass_alignment_enabled_flag not yet implemented\n");
}
@@ -1686,9 +1683,9 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
pps->slice_header_extension_present_flag = get_bits1(gb);
if (get_bits1(gb)) { // pps_extension_present_flag
- int pps_range_extensions_flag = get_bits1(gb);
+ pps->pps_range_extensions_flag = get_bits1(gb);
skip_bits(gb, 7); // pps_extension_7bits
- if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
+ if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) {
if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
goto err;
}
diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
index 1fbda199e3..bbaa9205ef 100644
--- a/libavcodec/hevc_ps.h
+++ b/libavcodec/hevc_ps.h
@@ -284,13 +284,16 @@ typedef struct HEVCSPS {
int max_transform_hierarchy_depth_inter;
int max_transform_hierarchy_depth_intra;
+ int sps_range_extension_flag;
int transform_skip_rotation_enabled_flag;
int transform_skip_context_enabled_flag;
int implicit_rdpcm_enabled_flag;
int explicit_rdpcm_enabled_flag;
+ int extended_precision_processing_flag;
int intra_smoothing_disabled_flag;
int high_precision_offsets_enabled_flag;
int persistent_rice_adaptation_enabled_flag;
+ int cabac_bypass_alignment_enabled_flag;
///< coded frame dimension in various units
int width;
@@ -365,6 +368,7 @@ typedef struct HEVCPPS {
int num_extra_slice_header_bits;
uint8_t slice_header_extension_present_flag;
uint8_t log2_max_transform_skip_block_size;
+ uint8_t pps_range_extensions_flag;
uint8_t cross_component_prediction_enabled_flag;
uint8_t chroma_qp_offset_list_enabled_flag;
uint8_t diff_cu_chroma_qp_offset_depth;