Required by MP4's AC3SpecificBox and MPEG-TS AC-3 audio_descriptor, of which the former is implemented in our MP4 writer.
Showing the changes to libavcodec (3 of 3 files). Show all
Unified · Split
| @@ -70,6 +70,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) · 69 unmodified lines | ||
| 70 | 70 | return AAC_AC3_PARSE_ERROR_BSID; |
| 71 | 71 | |
| 72 | 72 | hdr->num_blocks = 6; |
| 73 | + hdr->ac3_bit_rate_code = -1; | |
| 73 | 74 | |
| 74 | 75 | /* set default mix levels */ |
| 75 | 76 | hdr->center_mix_level = 5; // -4.5dB |
| @@ -89,6 +90,8 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) · 13 unmodified lines | ||
| 89 | 90 | if(frame_size_code > 37) |
| 90 | 91 | return AAC_AC3_PARSE_ERROR_FRAME_SIZE; |
| 91 | 92 | |
| 93 | + hdr->ac3_bit_rate_code = (frame_size_code >> 1); | |
| 94 | + | |
| 92 | 95 | skip_bits(gbc, 5); // skip bsid, already got it |
| 93 | 96 | |
| 94 | 97 | hdr->bitstream_mode = get_bits(gbc, 3); |
| @@ -106,7 +109,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) · 11 unmodified lines | ||
| 106 | 109 | |
| 107 | 110 | hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8; |
| 108 | 111 | hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; |
| 109 | − hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; | |
| 112 | + hdr->bit_rate = (ff_ac3_bitrate_tab[hdr->ac3_bit_rate_code] * 1000) >> hdr->sr_shift; | |
| 110 | 113 | hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; |
| 111 | 114 | hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; |
| 112 | 115 | hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT; |
| @@ -60,6 +60,7 @@ typedef struct AC3HeaderInfo { · 59 unmodified lines | ||
| 60 | 60 | uint8_t channels; |
| 61 | 61 | uint16_t frame_size; |
| 62 | 62 | uint64_t channel_layout; |
| 63 | + int8_t ac3_bit_rate_code; | |
| 63 | 64 | /** @} */ |
| 64 | 65 | } AC3HeaderInfo; |
| 65 | 66 | |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | #include "version_major.h" |
| 31 | 31 | |
| 32 | −#define LIBAVCODEC_VERSION_MINOR 34 | |
| 32 | +#define LIBAVCODEC_VERSION_MINOR 35 | |
| 33 | 33 | #define LIBAVCODEC_VERSION_MICRO 100 |
| 34 | 34 | |
| 35 | 35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |