56 sizeof(*s->windowed_samples), alloc_fail);
57 FF_ALLOC_OR_GOTO(s->avctx, s->planar_samples, s->channels *
sizeof(*s->planar_samples),
59 for (ch = 0; ch < s->channels; ch++) {
80 for (ch = 0; ch < s->
channels; ch++) {
102 for (ch = 0; ch < s->
channels; ch++) {
107 #if CONFIG_AC3ENC_FLOAT
131 #if CONFIG_AC3ENC_FLOAT
138 int cpl_start, num_cpl_coefs;
141 #if CONFIG_AC3ENC_FLOAT
142 memset(fixed_cpl_coords, 0,
AC3_MAX_BLOCKS *
sizeof(*cpl_coords));
149 cpl_start =
FFMIN(256, cpl_start + num_cpl_coefs) - num_cpl_coefs;
157 memset(cpl_coef, 0, num_cpl_coefs *
sizeof(*cpl_coef));
162 for (i = 0; i < num_cpl_coefs; i++)
163 cpl_coef[i] += ch_coef[i];
181 for (j = 0; j < band_size; j++) {
231 coord_diff +=
FFABS(cpl_coords[
blk-1][ch][bnd] -
232 cpl_coords[
blk ][ch][bnd]);
261 energy_ch = energy[
blk][ch][bnd];
265 energy_cpl += energy[blk1][
CPL_CH][bnd];
266 energy_ch += energy[blk1][ch][bnd];
282 #if CONFIG_AC3ENC_FLOAT
288 fixed_cpl_coords[blk][1],
292 int bnd, min_exp, max_exp, master_exp;
301 min_exp =
FFMIN(exp, min_exp);
302 max_exp =
FFMAX(exp, max_exp);
304 master_exp = ((max_exp - 15) + 2) / 3;
305 master_exp =
FFMAX(master_exp, 0);
306 while (min_exp < master_exp * 3)
310 master_exp * 3, 0, 15);
317 int cpl_mant = (fixed_cpl_coords[
blk][ch][bnd] << (5 + cpl_exp + master_exp * 3)) >> 24;
328 if (CONFIG_EAC3_ENCODER && s->
eac3)
369 block->
mdct_coef[2] + start, end - start);
372 if (
FFMIN(sum[2], sum[3]) <
FFMIN(sum[0], sum[1]))