Revision bfeca7be
libavcodec/aac_ac3_parser.c | ||
---|---|---|
85 | 85 |
avctx->channels = avctx->request_channels; |
86 | 86 |
} else { |
87 | 87 |
avctx->channels = s->channels; |
88 |
avctx->channel_layout = s->channel_layout; |
|
88 | 89 |
} |
89 | 90 |
avctx->bit_rate = s->bit_rate; |
90 | 91 |
avctx->frame_size = s->samples; |
libavcodec/aac_ac3_parser.h | ||
---|---|---|
48 | 48 |
int sample_rate; |
49 | 49 |
int bit_rate; |
50 | 50 |
int samples; |
51 |
int64_t channel_layout; |
|
51 | 52 |
|
52 | 53 |
int remaining_size; |
53 | 54 |
uint64_t state; |
libavcodec/ac3.h | ||
---|---|---|
100 | 100 |
uint32_t bit_rate; |
101 | 101 |
uint8_t channels; |
102 | 102 |
uint16_t frame_size; |
103 |
int64_t channel_layout; |
|
103 | 104 |
/** @} */ |
104 | 105 |
} AC3HeaderInfo; |
105 | 106 |
|
libavcodec/ac3_parser.c | ||
---|---|---|
121 | 121 |
(hdr->num_blocks * 256.0)); |
122 | 122 |
hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; |
123 | 123 |
} |
124 |
hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode]; |
|
125 |
if (hdr->lfe_on) |
|
126 |
hdr->channel_layout |= CH_LOW_FREQUENCY; |
|
124 | 127 |
|
125 | 128 |
return 0; |
126 | 129 |
} |
... | ... | |
174 | 177 |
hdr_info->sample_rate = hdr.sample_rate; |
175 | 178 |
hdr_info->bit_rate = hdr.bit_rate; |
176 | 179 |
hdr_info->channels = hdr.channels; |
180 |
hdr_info->channel_layout = hdr.channel_layout; |
|
177 | 181 |
hdr_info->samples = hdr.num_blocks * 256; |
178 | 182 |
if(hdr.bitstream_id>10) |
179 | 183 |
hdr_info->codec_id = CODEC_ID_EAC3; |
libavcodec/ac3dec.c | ||
---|---|---|
285 | 285 |
/* get decoding parameters from header info */ |
286 | 286 |
s->bit_alloc_params.sr_code = hdr.sr_code; |
287 | 287 |
s->channel_mode = hdr.channel_mode; |
288 |
s->channel_layout = hdr.channel_layout; |
|
288 | 289 |
s->lfe_on = hdr.lfe_on; |
289 | 290 |
s->bit_alloc_params.sr_shift = hdr.sr_shift; |
290 | 291 |
s->sample_rate = hdr.sample_rate; |
... | ... | |
1307 | 1308 |
avctx->request_channels < s->channels) { |
1308 | 1309 |
s->out_channels = avctx->request_channels; |
1309 | 1310 |
s->output_mode = avctx->request_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO; |
1311 |
s->channel_layout = ff_ac3_channel_layout_tab[s->output_mode]; |
|
1310 | 1312 |
} |
1311 | 1313 |
avctx->channels = s->out_channels; |
1314 |
avctx->channel_layout = s->channel_layout; |
|
1312 | 1315 |
|
1313 | 1316 |
/* set downmixing coefficients if needed */ |
1314 | 1317 |
if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) && |
libavcodec/ac3dec.h | ||
---|---|---|
58 | 58 |
int sample_rate; ///< sample frequency, in Hz |
59 | 59 |
int num_blocks; ///< number of audio blocks |
60 | 60 |
int channel_mode; ///< channel mode (acmod) |
61 |
int channel_layout; ///< channel layout |
|
61 | 62 |
int lfe_on; ///< lfe channel in use |
62 | 63 |
int channel_map; ///< custom channel map |
63 | 64 |
int center_mix_level; ///< Center mix level index |
libavcodec/ac3tab.c | ||
---|---|---|
24 | 24 |
* tables taken directly from the AC-3 spec. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
#include "avcodec.h" |
|
27 | 28 |
#include "ac3tab.h" |
28 | 29 |
|
29 | 30 |
/** |
... | ... | |
79 | 80 |
2, 1, 2, 3, 3, 4, 4, 5 |
80 | 81 |
}; |
81 | 82 |
|
83 |
/** |
|
84 |
* Maps audio coding mode (acmod) to channel layout mask. |
|
85 |
*/ |
|
86 |
const uint16_t ff_ac3_channel_layout_tab[8] = { |
|
87 |
CH_LAYOUT_STEREO, |
|
88 |
CH_LAYOUT_MONO, |
|
89 |
CH_LAYOUT_STEREO, |
|
90 |
CH_LAYOUT_SURROUND, |
|
91 |
CH_LAYOUT_2_1, |
|
92 |
CH_LAYOUT_4POINT0, |
|
93 |
CH_LAYOUT_2_2, |
|
94 |
CH_LAYOUT_5POINT0 |
|
95 |
}; |
|
96 |
|
|
82 | 97 |
#define COMMON_CHANNEL_MAP \ |
83 | 98 |
{ { 0, 1, }, { 0, 1, 2, } },\ |
84 | 99 |
{ { 0, }, { 0, 1, } },\ |
libavcodec/ac3tab.h | ||
---|---|---|
26 | 26 |
|
27 | 27 |
extern const uint16_t ff_ac3_frame_size_tab[38][3]; |
28 | 28 |
extern const uint8_t ff_ac3_channels_tab[8]; |
29 |
extern const uint16_t ff_ac3_channel_layout_tab[8]; |
|
29 | 30 |
extern const uint8_t ff_ac3_enc_channel_map[8][2][6]; |
30 | 31 |
extern const uint8_t ff_ac3_dec_channel_map[8][2][6]; |
31 | 32 |
extern const uint16_t ff_ac3_sample_rate_tab[3]; |
Also available in: Unified diff