1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

h264_ps: expose bit rate and CPB size fields

This commit is contained in:
Lynne 2022-12-14 00:09:08 +01:00
parent de6fce727c
commit d13b1c42f6
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
2 changed files with 9 additions and 4 deletions

View File

@ -113,12 +113,13 @@ static inline int decode_hrd_parameters(GetBitContext *gb, void *logctx,
return AVERROR_INVALIDDATA;
}
get_bits(gb, 4); /* bit_rate_scale */
sps->cpr_flag = 0x0;
sps->bit_rate_scale = get_bits(gb, 4);
get_bits(gb, 4); /* cpb_size_scale */
for (i = 0; i < cpb_count; i++) {
get_ue_golomb_long(gb); /* bit_rate_value_minus1 */
get_ue_golomb_long(gb); /* cpb_size_value_minus1 */
get_bits1(gb); /* cbr_flag */
sps->bit_rate_value[i] = get_ue_golomb_long(gb) + 1; /* bit_rate_value_minus1 + 1 */
sps->cpb_size_value[i] = get_ue_golomb_long(gb) + 1; /* cpb_size_value_minus1 + 1 */
sps->cpr_flag |= get_bits1(gb) << i;
}
sps->initial_cpb_removal_delay_length = get_bits(gb, 5) + 1;
sps->cpb_removal_delay_length = get_bits(gb, 5) + 1;

View File

@ -89,6 +89,10 @@ typedef struct SPS {
int pic_struct_present_flag;
int time_offset_length;
int cpb_cnt; ///< See H.264 E.1.2
int bit_rate_scale;
uint32_t bit_rate_value[32]; ///< bit_rate_value_minus1 + 1
uint32_t cpb_size_value[32]; ///< cpb_size_value_minus1 + 1
uint32_t cpr_flag;
int initial_cpb_removal_delay_length; ///< initial_cpb_removal_delay_length_minus1 + 1
int cpb_removal_delay_length; ///< cpb_removal_delay_length_minus1 + 1
int dpb_output_delay_length; ///< dpb_output_delay_length_minus1 + 1