summaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3enc_float.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-08-07 17:47:42 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-09-05 10:09:44 -0400
commitae264bb29be3506a489347c6e27a04cded0de621 (patch)
tree4944f356bc2065d4b85dafd47e7418a719eee077 /libavcodec/ac3enc_float.c
parenta0d17b6d45b8550bd8826baa9f8eb4e1a596525a (diff)
downloadffmpeg-streaming-ae264bb29be3506a489347c6e27a04cded0de621.zip
ffmpeg-streaming-ae264bb29be3506a489347c6e27a04cded0de621.tar.gz
ac3enc: Add channel coupling support for the fixed-point AC-3 encoder.
Update FATE references accordingly.
Diffstat (limited to 'libavcodec/ac3enc_float.c')
-rw-r--r--libavcodec/ac3enc_float.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c
index 32ec558..598c69d 100644
--- a/libavcodec/ac3enc_float.c
+++ b/libavcodec/ac3enc_float.c
@@ -120,6 +120,18 @@ static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
}
+/**
+ * Calculate a single coupling coordinate.
+ */
+static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
+{
+ float coord = 0.125;
+ if (energy_cpl > 0)
+ coord *= sqrtf(energy_ch / energy_cpl);
+ return FFMIN(coord, COEF_MAX);
+}
+
+
#if CONFIG_AC3_ENCODER
AVCodec ff_ac3_encoder = {
.name = "ac3",
OpenPOWER on IntegriCloud