64 #define EAC3_SR_CODE_REDUCED 3
75 num_copy_sections = 0;
84 for (i = 0; i < bandsize; i += copysize) {
101 for (i = 0; i < num_copy_sections; i++) {
104 copy_sizes[i]*
sizeof(
float));
105 bin += copy_sizes[i];
113 for (i = 0; i < bandsize; i++) {
115 accum += coeff *
coeff;
117 rms_energy[bnd] = sqrtf(accum / bandsize);
128 coeffs[0] *= atten_tab[0];
129 coeffs[1] *= atten_tab[1];
130 coeffs[2] *= atten_tab[2];
131 coeffs[3] *= atten_tab[1];
132 coeffs[4] *= atten_tab[0];
143 float nscale = s->
spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
156 #define COEFF_0 10273905LL
159 #define COEFF_1 11863283LL
162 #define COEFF_2 3070444LL
171 int even0, even1, even2, odd0, odd1, odd2;
173 odd1 = pre_mant[1] - pre_mant[3] - pre_mant[5];
175 even2 = ( pre_mant[2] *
COEFF_0) >> 23;
176 tmp = ( pre_mant[4] *
COEFF_1) >> 23;
177 odd0 = ((pre_mant[1] + pre_mant[5]) *
COEFF_2) >> 23;
179 even0 = pre_mant[0] + (tmp >> 1);
180 even1 = pre_mant[0] - tmp;
187 odd0 = tmp + pre_mant[1] + pre_mant[3];
188 odd2 = tmp + pre_mant[5] - pre_mant[3];
190 pre_mant[0] = even0 + odd0;
191 pre_mant[1] = even1 + odd1;
192 pre_mant[2] = even2 + odd2;
193 pre_mant[3] = even2 - odd2;
194 pre_mant[4] = even1 - odd1;
195 pre_mant[5] = even0 - odd0;
201 int end_bap, gaq_mode;
206 end_bap = (gaq_mode < 2) ? 12 : 17;
213 for (bin = s->
start_freq[ch]; bin < s->end_freq[ch]; bin++) {
214 if (s->
bap[ch][bin] > 7 && s->
bap[ch][bin] < end_bap)
215 gaq_gain[gs++] =
get_bits1(gbc) << (gaq_mode-1);
220 for (bin = s->
start_freq[ch]; bin < s->end_freq[ch]; bin++) {
221 if (s->
bap[ch][bin] > 7 && s->
bap[ch][bin] < 17) {
224 if (group_code > 26) {
238 for (bin = s->
start_freq[ch]; bin < s->end_freq[ch]; bin++) {
239 int hebap = s->
bap[ch][bin];
243 for (blk = 0; blk < 6; blk++) {
246 }
else if (hebap < 8) {
249 for (blk = 0; blk < 6; blk++) {
256 log_gain = gaq_gain[gs++];
260 gbits = bits - log_gain;
262 for (blk = 0; blk < 6; blk++) {
264 if (log_gain && mant == -(1 << (gbits-1))) {
267 int mbits = bits - (2 - log_gain);
269 mant <<= (23 - (mbits - 1));
272 b = 1 << (23 - log_gain);
294 int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;
295 int parse_transient_proc_info;
383 int mix_data_size = (
get_bits(gbc, 5) + 2) << 3;
448 for (i = 0; i < addbsil + 1; i++) {
461 ac3_exponent_strategy = 1;
466 parse_transient_proc_info =
get_bits1(gbc);
511 if (ac3_exponent_strategy) {
514 for (ch = !s->
cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {
520 for (ch = !((s->
channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {
522 for (blk = 0; blk < 6; blk++) {
540 if (parse_aht_info) {
546 for (ch = (num_cpl_blocks != 6); ch <= s->
channels; ch++) {
548 for (blk = 1; blk < 6; blk++) {
563 int csnroffst = (
get_bits(gbc, 6) - 15) << 4;
564 int snroffst = (csnroffst +
get_bits(gbc, 4)) << 2;
565 for (ch = 0; ch <= s->
channels; ch++)
570 if (parse_transient_proc_info) {
581 if (parse_spx_atten_data &&
get_bits1(gbc)) {