mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avcodec/hevc_ps: use get_ue_golomb() for some PPS multilayer extension fields
Also remove the _plus* and _minus* parts of some of these to be in line with other similar fields in the decoder. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
ab0f3f7fbf
commit
0760528af2
@ -1324,7 +1324,7 @@ static void colour_mapping_octants(GetBitContext *gb, HEVCPPS *pps, int inp_dept
|
||||
int idx_y, int idx_cb, int idx_cr, int inp_length)
|
||||
{
|
||||
unsigned int split_octant_flag, part_num_y, coded_res_flag, res_coeff_q, res_coeff_r;
|
||||
int bit_depth_cm_input_y, bit_depth_cm_output_y, cm_res_bits;
|
||||
int cm_res_bits;
|
||||
|
||||
part_num_y = 1 << pps->cm_y_part_num_log2;
|
||||
|
||||
@ -1346,10 +1346,9 @@ static void colour_mapping_octants(GetBitContext *gb, HEVCPPS *pps, int inp_dept
|
||||
if (coded_res_flag)
|
||||
for (int c = 0; c < 3; c++) {
|
||||
res_coeff_q = get_ue_golomb_long(gb);
|
||||
bit_depth_cm_input_y = 8 + pps->luma_bit_depth_cm_input_minus8;
|
||||
bit_depth_cm_output_y = 8 + pps->luma_bit_depth_cm_output_minus8;
|
||||
cm_res_bits = FFMAX(0, 10 + bit_depth_cm_input_y - bit_depth_cm_output_y -
|
||||
pps->cm_res_quant_bits - (pps->cm_delta_flc_bits_minus1 + 1));
|
||||
cm_res_bits = FFMAX(0, 10 + pps->luma_bit_depth_cm_input -
|
||||
pps->luma_bit_depth_cm_output -
|
||||
pps->cm_res_quant_bits - pps->cm_delta_flc_bits);
|
||||
res_coeff_r = cm_res_bits ? get_bits(gb, cm_res_bits) : 0;
|
||||
if (res_coeff_q || res_coeff_r)
|
||||
skip_bits1(gb);
|
||||
@ -1367,13 +1366,13 @@ static void colour_mapping_table(GetBitContext *gb, HEVCPPS *pps)
|
||||
pps->cm_octant_depth = get_bits(gb, 2);
|
||||
pps->cm_y_part_num_log2 = get_bits(gb, 2);
|
||||
|
||||
pps->luma_bit_depth_cm_input_minus8 = get_ue_golomb_long(gb);
|
||||
pps->chroma_bit_depth_cm_input_minus8 = get_ue_golomb_long(gb);
|
||||
pps->luma_bit_depth_cm_output_minus8 = get_ue_golomb_long(gb);
|
||||
pps->chroma_bit_depth_cm_output_minus8 = get_ue_golomb_long(gb);
|
||||
pps->luma_bit_depth_cm_input = get_ue_golomb(gb) + 8;
|
||||
pps->chroma_bit_depth_cm_input = get_ue_golomb(gb) + 8;
|
||||
pps->luma_bit_depth_cm_output = get_ue_golomb(gb) + 8;
|
||||
pps->chroma_bit_depth_cm_output = get_ue_golomb(gb) + 8;
|
||||
|
||||
pps->cm_res_quant_bits = get_bits(gb, 2);
|
||||
pps->cm_delta_flc_bits_minus1 = get_bits(gb, 2);
|
||||
pps->cm_delta_flc_bits = get_bits(gb, 2) + 1;
|
||||
|
||||
if (pps->cm_octant_depth == 1) {
|
||||
pps->cm_adapt_threshold_u_delta = get_se_golomb_long(gb);
|
||||
@ -1415,10 +1414,10 @@ static int pps_multilayer_extension(GetBitContext *gb, AVCodecContext *avctx,
|
||||
|
||||
pps->resample_phase_set_present_flag[i] = get_bits1(gb);
|
||||
if (pps->resample_phase_set_present_flag[i]) {
|
||||
pps->phase_hor_luma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_long(gb);
|
||||
pps->phase_ver_luma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_long(gb);
|
||||
pps->phase_hor_chroma_plus8[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_long(gb);
|
||||
pps->phase_ver_chroma_plus8[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_long(gb);
|
||||
pps->phase_hor_luma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_31(gb);
|
||||
pps->phase_ver_luma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb_31(gb);
|
||||
pps->phase_hor_chroma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb(gb) - 8;
|
||||
pps->phase_ver_chroma[pps->ref_loc_offset_layer_id[i]] = get_ue_golomb(gb) - 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,21 +327,21 @@ typedef struct HEVCPPS {
|
||||
int16_t ref_region_right_offset[64];
|
||||
int16_t ref_region_bottom_offset[64];
|
||||
uint8_t resample_phase_set_present_flag[64];
|
||||
uint16_t phase_hor_luma[64];
|
||||
uint16_t phase_ver_luma[64];
|
||||
uint16_t phase_hor_chroma_plus8[64];
|
||||
uint16_t phase_ver_chroma_plus8[64];
|
||||
uint8_t phase_hor_luma[64];
|
||||
uint8_t phase_ver_luma[64];
|
||||
int8_t phase_hor_chroma[64];
|
||||
int8_t phase_ver_chroma[64];
|
||||
uint8_t colour_mapping_enabled_flag;
|
||||
uint16_t num_cm_ref_layers_minus1;
|
||||
uint8_t cm_ref_layer_id[63];
|
||||
uint8_t cm_octant_depth;
|
||||
uint8_t cm_y_part_num_log2;
|
||||
uint16_t luma_bit_depth_cm_input_minus8;
|
||||
uint16_t chroma_bit_depth_cm_input_minus8;
|
||||
uint16_t luma_bit_depth_cm_output_minus8;
|
||||
uint16_t chroma_bit_depth_cm_output_minus8;
|
||||
uint8_t luma_bit_depth_cm_input;
|
||||
uint8_t chroma_bit_depth_cm_input;
|
||||
uint8_t luma_bit_depth_cm_output;
|
||||
uint8_t chroma_bit_depth_cm_output;
|
||||
uint8_t cm_res_quant_bits;
|
||||
uint8_t cm_delta_flc_bits_minus1;
|
||||
uint8_t cm_delta_flc_bits;
|
||||
int8_t cm_adapt_threshold_u_delta;
|
||||
int8_t cm_adapt_threshold_v_delta;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user