Commit f4ea930a authored by Philip Langdale's avatar Philip Langdale

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.
parent 9e1e5213
...@@ -1102,20 +1102,17 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, ...@@ -1102,20 +1102,17 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
decode_vui(gb, avctx, apply_defdispwin, sps); decode_vui(gb, avctx, apply_defdispwin, sps);
if (get_bits1(gb)) { // sps_extension_flag 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); skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7);
if (sps_range_extension_flag) { if (sps->sps_range_extension_flag) {
int extended_precision_processing_flag;
int cabac_bypass_alignment_enabled_flag;
sps->transform_skip_rotation_enabled_flag = get_bits1(gb); sps->transform_skip_rotation_enabled_flag = get_bits1(gb);
sps->transform_skip_context_enabled_flag = get_bits1(gb); sps->transform_skip_context_enabled_flag = get_bits1(gb);
sps->implicit_rdpcm_enabled_flag = get_bits1(gb); sps->implicit_rdpcm_enabled_flag = get_bits1(gb);
sps->explicit_rdpcm_enabled_flag = get_bits1(gb); sps->explicit_rdpcm_enabled_flag = get_bits1(gb);
extended_precision_processing_flag = get_bits1(gb); sps->extended_precision_processing_flag = get_bits1(gb);
if (extended_precision_processing_flag) if (sps->extended_precision_processing_flag)
av_log(avctx, AV_LOG_WARNING, av_log(avctx, AV_LOG_WARNING,
"extended_precision_processing_flag not yet implemented\n"); "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, ...@@ -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); sps->persistent_rice_adaptation_enabled_flag = get_bits1(gb);
cabac_bypass_alignment_enabled_flag = get_bits1(gb); sps->cabac_bypass_alignment_enabled_flag = get_bits1(gb);
if (cabac_bypass_alignment_enabled_flag) if (sps->cabac_bypass_alignment_enabled_flag)
av_log(avctx, AV_LOG_WARNING, av_log(avctx, AV_LOG_WARNING,
"cabac_bypass_alignment_enabled_flag not yet implemented\n"); "cabac_bypass_alignment_enabled_flag not yet implemented\n");
} }
...@@ -1686,9 +1683,9 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, ...@@ -1686,9 +1683,9 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
pps->slice_header_extension_present_flag = get_bits1(gb); pps->slice_header_extension_present_flag = get_bits1(gb);
if (get_bits1(gb)) { // pps_extension_present_flag 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 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) if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
goto err; goto err;
} }
......
...@@ -284,13 +284,16 @@ typedef struct HEVCSPS { ...@@ -284,13 +284,16 @@ typedef struct HEVCSPS {
int max_transform_hierarchy_depth_inter; int max_transform_hierarchy_depth_inter;
int max_transform_hierarchy_depth_intra; int max_transform_hierarchy_depth_intra;
int sps_range_extension_flag;
int transform_skip_rotation_enabled_flag; int transform_skip_rotation_enabled_flag;
int transform_skip_context_enabled_flag; int transform_skip_context_enabled_flag;
int implicit_rdpcm_enabled_flag; int implicit_rdpcm_enabled_flag;
int explicit_rdpcm_enabled_flag; int explicit_rdpcm_enabled_flag;
int extended_precision_processing_flag;
int intra_smoothing_disabled_flag; int intra_smoothing_disabled_flag;
int high_precision_offsets_enabled_flag; int high_precision_offsets_enabled_flag;
int persistent_rice_adaptation_enabled_flag; int persistent_rice_adaptation_enabled_flag;
int cabac_bypass_alignment_enabled_flag;
///< coded frame dimension in various units ///< coded frame dimension in various units
int width; int width;
...@@ -365,6 +368,7 @@ typedef struct HEVCPPS { ...@@ -365,6 +368,7 @@ typedef struct HEVCPPS {
int num_extra_slice_header_bits; int num_extra_slice_header_bits;
uint8_t slice_header_extension_present_flag; uint8_t slice_header_extension_present_flag;
uint8_t log2_max_transform_skip_block_size; uint8_t log2_max_transform_skip_block_size;
uint8_t pps_range_extensions_flag;
uint8_t cross_component_prediction_enabled_flag; uint8_t cross_component_prediction_enabled_flag;
uint8_t chroma_qp_offset_list_enabled_flag; uint8_t chroma_qp_offset_list_enabled_flag;
uint8_t diff_cu_chroma_qp_offset_depth; uint8_t diff_cu_chroma_qp_offset_depth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment