Merge remote-tracking branch 'qatar/master'
[ffmpeg.git] / libavcodec / dcaenc.c
index d2862b1..8d0655d 100644 (file)
@@ -29,6 +29,7 @@
 #include "dcadata.h"
 #include "dcaenc.h"
 #include "internal.h"
+#include "mathops.h"
 #include "put_bits.h"
 
 #define MAX_CHANNELS 6
@@ -168,8 +169,13 @@ static int encode_init(AVCodecContext *avctx)
             cb_to_level[i] = (int32_t)(0x7fffffff * pow(10, -0.005 * i));
         }
 
+        /* FIXME: probably incorrect */
+        for (i = 0; i < 256; i++) {
+            lfe_fir_64i[i] = (int32_t)(0x01ffffff * lfe_fir_64[i]);
+            lfe_fir_64i[511 - i] = (int32_t)(0x01ffffff * lfe_fir_64[i]);
+        }
+
         for (i = 0; i < 512; i++) {
-            lfe_fir_64i[i]           = (int32_t)(0x01ffffff * lfe_fir_64[i]);
             band_interpolation[0][i] = (int32_t)(0x1000000000ULL * fir_32bands_perfect[i]);
             band_interpolation[1][i] = (int32_t)(0x1000000000ULL * fir_32bands_nonperfect[i]);
         }
@@ -949,6 +955,7 @@ static const AVCodecDefault defaults[] = {
 
 AVCodec ff_dca_encoder = {
     .name                  = "dca",
+    .long_name             = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
     .type                  = AVMEDIA_TYPE_AUDIO,
     .id                    = AV_CODEC_ID_DTS,
     .priv_data_size        = sizeof(DCAContext),
@@ -957,7 +964,6 @@ AVCodec ff_dca_encoder = {
     .capabilities          = CODEC_CAP_EXPERIMENTAL,
     .sample_fmts           = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
                                                             AV_SAMPLE_FMT_NONE },
-    .long_name             = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
     .supported_samplerates = sample_rates,
     .channel_layouts       = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
                                                   AV_CH_LAYOUT_STEREO,