-/*
- * Normalize the input samples to use the maximum available precision.
- * This assumes signed 16-bit input samples.
- */
-static int normalize_samples(AC3EncodeContext *s)
-{
- int v = s->ac3dsp.ac3_max_msb_abs_int16(s->windowed_samples, AC3_WINDOW_SIZE);
- v = 14 - av_log2(v);
- if (v > 0)
- s->ac3dsp.ac3_lshift_int16(s->windowed_samples, AC3_WINDOW_SIZE, v);
- /* +6 to right-shift from 31-bit to 25-bit */
- return v + 6;
-}
-
-
-/*
- * Scale MDCT coefficients to 25-bit signed fixed-point.
- */
-static void scale_coefficients(AC3EncodeContext *s)
-{
- int blk, ch;
-
- for (blk = 0; blk < s->num_blocks; blk++) {
- AC3Block *block = &s->blocks[blk];
- for (ch = 1; ch <= s->channels; ch++) {
- s->ac3dsp.ac3_rshift_int32(block->mdct_coef[ch], AC3_MAX_COEFS,
- block->coeff_shift[ch]);
- }
- }
-}
-