diff options
author | Alexandra Hájková <alexandra.khirnova@gmail.com> | 2015-12-17 15:52:47 +0100 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2015-12-23 11:50:18 +0100 |
commit | aebf07075f4244caf591a3af71e5872fe314e87b (patch) | |
tree | 6341986176d7d58b58e7f25cbde1b25ba8445efa /libavcodec/fmtconvert.c | |
parent | 85990140e7302d1e7fcc9fc0eea316178c19fe03 (diff) |
dca: change the core to work with integer coefficients.
The DCA core decoder converts integer coefficients read from the
bitstream to floats just after reading them (along with dequantization).
All the other steps of the audio reconstruction are done with floats
which makes the output for the DTS lossless extension (XLL)
actually lossy.
This patch changes the DCA core to work with integer coefficients
until QMF. At this point the integer coefficients are converted to floats.
The coefficients for the LFE channel (lfe_data) are not touched.
This is the first step for the really lossless XLL decoding.
Diffstat (limited to 'libavcodec/fmtconvert.c')
-rw-r--r-- | libavcodec/fmtconvert.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c index 5e29bfa20a..f94d438ba2 100644 --- a/libavcodec/fmtconvert.c +++ b/libavcodec/fmtconvert.c @@ -32,6 +32,14 @@ static void int32_to_float_fmul_scalar_c(float *dst, const int32_t *src, dst[i] = src[i] * mul; } +static void int32_to_float_c(float *dst, const int32_t *src, intptr_t len) +{ + int i; + + for (i = 0; i < len; i++) + dst[i] = (float)src[i]; +} + static void int32_to_float_fmul_array8_c(FmtConvertContext *c, float *dst, const int32_t *src, const float *mul, int len) @@ -43,6 +51,7 @@ static void int32_to_float_fmul_array8_c(FmtConvertContext *c, float *dst, av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) { + c->int32_to_float = int32_to_float_c; c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c; c->int32_to_float_fmul_array8 = int32_to_float_fmul_array8_c; |