| OLD | NEW |
| 1 /* | 1 /* |
| 2 * DCA compatible decoder | 2 * DCA compatible decoder |
| 3 * Copyright (C) 2004 Gildas Bazin | 3 * Copyright (C) 2004 Gildas Bazin |
| 4 * Copyright (C) 2004 Benjamin Zores | 4 * Copyright (C) 2004 Benjamin Zores |
| 5 * Copyright (C) 2006 Benjamin Larsson | 5 * Copyright (C) 2006 Benjamin Larsson |
| 6 * Copyright (C) 2007 Konstantin Shishkov | 6 * Copyright (C) 2007 Konstantin Shishkov |
| 7 * | 7 * |
| 8 * This file is part of FFmpeg. | 8 * This file is part of FFmpeg. |
| 9 * | 9 * |
| 10 * FFmpeg is free software; you can redistribute it and/or | 10 * FFmpeg is free software; you can redistribute it and/or |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "dcahuff.h" | 37 #include "dcahuff.h" |
| 38 #include "dca.h" | 38 #include "dca.h" |
| 39 #include "synth_filter.h" | 39 #include "synth_filter.h" |
| 40 #include "dcadsp.h" | 40 #include "dcadsp.h" |
| 41 | 41 |
| 42 //#define TRACE | 42 //#define TRACE |
| 43 | 43 |
| 44 #define DCA_PRIM_CHANNELS_MAX (5) | 44 #define DCA_PRIM_CHANNELS_MAX (5) |
| 45 #define DCA_SUBBANDS (32) | 45 #define DCA_SUBBANDS (32) |
| 46 #define DCA_ABITS_MAX (32) /* Should be 28 */ | 46 #define DCA_ABITS_MAX (32) /* Should be 28 */ |
| 47 #define DCA_SUBSUBFAMES_MAX (4) | 47 #define DCA_SUBSUBFRAMES_MAX (4) |
| 48 #define DCA_LFE_MAX (3) | 48 #define DCA_LFE_MAX (3) |
| 49 | 49 |
| 50 enum DCAMode { | 50 enum DCAMode { |
| 51 DCA_MONO = 0, | 51 DCA_MONO = 0, |
| 52 DCA_CHANNEL, | 52 DCA_CHANNEL, |
| 53 DCA_STEREO, | 53 DCA_STEREO, |
| 54 DCA_STEREO_SUMDIFF, | 54 DCA_STEREO_SUMDIFF, |
| 55 DCA_STEREO_TOTAL, | 55 DCA_STEREO_TOTAL, |
| 56 DCA_3F, | 56 DCA_3F, |
| 57 DCA_2F1R, | 57 DCA_2F1R, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< bit alloca
tion index | 215 int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< bit alloca
tion index |
| 216 int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< transition
mode (transients) | 216 int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< transition
mode (transients) |
| 217 int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2]; ///< scale fact
ors (2 if transient) | 217 int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2]; ///< scale fact
ors (2 if transient) |
| 218 int joint_huff[DCA_PRIM_CHANNELS_MAX]; ///< joint subb
and scale factors codebook | 218 int joint_huff[DCA_PRIM_CHANNELS_MAX]; ///< joint subb
and scale factors codebook |
| 219 int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< joint subb
and scale factors | 219 int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< joint subb
and scale factors |
| 220 int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]; ///< stereo dow
nmix coefficients | 220 int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]; ///< stereo dow
nmix coefficients |
| 221 int dynrange_coef; ///< dynamic ra
nge coefficient | 221 int dynrange_coef; ///< dynamic ra
nge coefficient |
| 222 | 222 |
| 223 int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded
high frequency subbands | 223 int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded
high frequency subbands |
| 224 | 224 |
| 225 float lfe_data[2 * DCA_SUBSUBFAMES_MAX * DCA_LFE_MAX * | 225 float lfe_data[2 * DCA_SUBSUBFRAMES_MAX * DCA_LFE_MAX * |
| 226 2 /*history */ ]; ///< Low frequency effect data | 226 2 /*history */ ]; ///< Low frequency effect data |
| 227 int lfe_scale_factor; | 227 int lfe_scale_factor; |
| 228 | 228 |
| 229 /* Subband samples history (for ADPCM) */ | 229 /* Subband samples history (for ADPCM) */ |
| 230 float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4]; | 230 float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4]; |
| 231 DECLARE_ALIGNED(16, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512]; | 231 DECLARE_ALIGNED(16, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512]; |
| 232 DECLARE_ALIGNED(16, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32]; | 232 DECLARE_ALIGNED(16, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32]; |
| 233 int hist_index[DCA_PRIM_CHANNELS_MAX]; | 233 int hist_index[DCA_PRIM_CHANNELS_MAX]; |
| 234 DECLARE_ALIGNED(16, float, raXin)[32]; | 234 DECLARE_ALIGNED(16, float, raXin)[32]; |
| 235 | 235 |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 AVCodec dca_decoder = { | 1324 AVCodec dca_decoder = { |
| 1325 .name = "dca", | 1325 .name = "dca", |
| 1326 .type = AVMEDIA_TYPE_AUDIO, | 1326 .type = AVMEDIA_TYPE_AUDIO, |
| 1327 .id = CODEC_ID_DTS, | 1327 .id = CODEC_ID_DTS, |
| 1328 .priv_data_size = sizeof(DCAContext), | 1328 .priv_data_size = sizeof(DCAContext), |
| 1329 .init = dca_decode_init, | 1329 .init = dca_decode_init, |
| 1330 .decode = dca_decode_frame, | 1330 .decode = dca_decode_frame, |
| 1331 .close = dca_decode_end, | 1331 .close = dca_decode_end, |
| 1332 .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), | 1332 .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), |
| 1333 }; | 1333 }; |
| OLD | NEW |