FFmpeg
dca_core.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 foo86
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_DCA_CORE_H
22 #define AVCODEC_DCA_CORE_H
23 
24 #include "libavutil/float_dsp.h"
25 #include "libavutil/fixed_dsp.h"
26 #include "libavutil/mem_internal.h"
27 
28 #include "avcodec.h"
29 #include "get_bits.h"
30 #include "dca.h"
31 #include "dca_exss.h"
32 #include "dcadsp.h"
33 #include "dcadct.h"
34 #include "dcamath.h"
35 #include "dcahuff.h"
36 #include "fft.h"
37 #include "synth_filter.h"
38 
39 #define DCA_CHANNELS 7
40 #define DCA_SUBBANDS 32
41 #define DCA_SUBBANDS_X96 64
42 #define DCA_SUBFRAMES 16
43 #define DCA_SUBBAND_SAMPLES 8
44 #define DCA_PCMBLOCK_SAMPLES 32
45 #define DCA_LFE_HISTORY 8
46 #define DCA_ABITS_MAX 26
47 
48 #define DCA_CORE_CHANNELS_MAX 6
49 #define DCA_DMIX_CHANNELS_MAX 4
50 #define DCA_XXCH_CHANNELS_MAX 2
51 #define DCA_EXSS_CHANNELS_MAX 8
52 #define DCA_EXSS_CHSETS_MAX 4
53 
54 #define DCA_FILTER_MODE_X96 0x01
55 #define DCA_FILTER_MODE_FIXED 0x02
56 
58  DCA_AMODE_MONO, // Mode 0: A (mono)
59  DCA_AMODE_MONO_DUAL, // Mode 1: A + B (dual mono)
60  DCA_AMODE_STEREO, // Mode 2: L + R (stereo)
61  DCA_AMODE_STEREO_SUMDIFF, // Mode 3: (L+R) + (L-R) (sum-diff)
62  DCA_AMODE_STEREO_TOTAL, // Mode 4: LT + RT (left and right total)
63  DCA_AMODE_3F, // Mode 5: C + L + R
64  DCA_AMODE_2F1R, // Mode 6: L + R + S
65  DCA_AMODE_3F1R, // Mode 7: C + L + R + S
66  DCA_AMODE_2F2R, // Mode 8: L + R + SL + SR
67  DCA_AMODE_3F2R, // Mode 9: C + L + R + SL + SR
68 
70 };
71 
76 };
77 
83 };
84 
85 typedef struct DCADSPData {
86  union {
87  struct {
88  DECLARE_ALIGNED(32, float, hist1)[1024];
89  DECLARE_ALIGNED(32, float, hist2)[64];
90  } flt;
91  struct {
94  } fix;
95  } u;
96  int offset;
97 } DCADSPData;
98 
99 typedef struct DCACoreDecoder {
103 
104  // Bit stream header
105  int crc_present; ///< CRC present flag
106  int npcmblocks; ///< Number of PCM sample blocks
107  int frame_size; ///< Primary frame byte size
108  int audio_mode; ///< Audio channel arrangement
109  int sample_rate; ///< Core audio sampling frequency
110  int bit_rate; ///< Transmission bit rate
111  int drc_present; ///< Embedded dynamic range flag
112  int ts_present; ///< Embedded time stamp flag
113  int aux_present; ///< Auxiliary data flag
114  int ext_audio_type; ///< Extension audio descriptor flag
115  int ext_audio_present; ///< Extended coding flag
116  int sync_ssf; ///< Audio sync word insertion flag
117  int lfe_present; ///< Low frequency effects flag
118  int predictor_history; ///< Predictor history flag switch
119  int filter_perfect; ///< Multirate interpolator switch
120  int source_pcm_res; ///< Source PCM resolution
121  int es_format; ///< Extended surround (ES) mastering flag
122  int sumdiff_front; ///< Front sum/difference flag
123  int sumdiff_surround; ///< Surround sum/difference flag
124 
125  // Primary audio coding header
126  int nsubframes; ///< Number of subframes
127  int nchannels; ///< Number of primary audio channels (incl. extension channels)
128  int ch_mask; ///< Speaker layout mask (incl. LFE and extension channels)
129  int8_t nsubbands[DCA_CHANNELS]; ///< Subband activity count
130  int8_t subband_vq_start[DCA_CHANNELS]; ///< High frequency VQ start subband
131  int8_t joint_intensity_index[DCA_CHANNELS]; ///< Joint intensity coding index
132  int8_t transition_mode_sel[DCA_CHANNELS]; ///< Transient mode code book
133  int8_t scale_factor_sel[DCA_CHANNELS]; ///< Scale factor code book
134  int8_t bit_allocation_sel[DCA_CHANNELS]; ///< Bit allocation quantizer select
135  int8_t quant_index_sel[DCA_CHANNELS][DCA_CODE_BOOKS]; ///< Quantization index codebook select
136  int32_t scale_factor_adj[DCA_CHANNELS][DCA_CODE_BOOKS]; ///< Scale factor adjustment
137 
138  // Primary audio coding side information
139  int8_t nsubsubframes[DCA_SUBFRAMES]; ///< Subsubframe count for each subframe
140  int8_t prediction_mode[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Prediction mode
141  int16_t prediction_vq_index[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Prediction coefficients VQ address
142  int8_t bit_allocation[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Bit allocation index
143  int8_t transition_mode[DCA_SUBFRAMES][DCA_CHANNELS][DCA_SUBBANDS]; ///< Transition mode
144  int32_t scale_factors[DCA_CHANNELS][DCA_SUBBANDS][2]; ///< Scale factors (2x for transients and X96)
145  int8_t joint_scale_sel[DCA_CHANNELS]; ///< Joint subband codebook select
146  int32_t joint_scale_factors[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Scale factors for joint subband coding
147 
148  // Auxiliary data
149  int prim_dmix_embedded; ///< Auxiliary dynamic downmix flag
150  int prim_dmix_type; ///< Auxiliary primary channel downmix type
151  int prim_dmix_coeff[DCA_DMIX_CHANNELS_MAX * DCA_CORE_CHANNELS_MAX]; ///< Dynamic downmix code coefficients
152 
153  // Core extensions
154  int ext_audio_mask; ///< Bit mask of fully decoded core extensions
155 
156  // XCH extension data
157  int xch_pos; ///< Bit position of XCH frame in core substream
158 
159  // XXCH extension data
160  int xxch_crc_present; ///< CRC presence flag for XXCH channel set header
161  int xxch_mask_nbits; ///< Number of bits for loudspeaker mask
162  int xxch_core_mask; ///< Core loudspeaker activity mask
163  int xxch_spkr_mask; ///< Loudspeaker layout mask
164  int xxch_dmix_embedded; ///< Downmix already performed by encoder
165  int xxch_dmix_scale_inv; ///< Downmix scale factor
166  int xxch_dmix_mask[DCA_XXCH_CHANNELS_MAX]; ///< Downmix channel mapping mask
168  int xxch_pos; ///< Bit position of XXCH frame in core substream
169 
170  // X96 extension data
171  int x96_rev_no; ///< X96 revision number
172  int x96_crc_present; ///< CRC presence flag for X96 channel set header
173  int x96_nchannels; ///< Number of primary channels in X96 extension
174  int x96_high_res; ///< X96 high resolution flag
175  int x96_subband_start; ///< First encoded subband in X96 extension
176  int x96_rand; ///< Random seed for generating samples for unallocated X96 subbands
177  int x96_pos; ///< Bit position of X96 frame in core substream
178 
179  // Sample buffers
180  unsigned int x96_subband_size;
181  int32_t *x96_subband_buffer; ///< X96 subband sample buffer base
183 
184  unsigned int subband_size;
185  int32_t *subband_buffer; ///< Subband sample buffer base
187  int32_t *lfe_samples; ///< Decimated LFE samples
188 
189  // DSP contexts
190  DCADSPData dcadsp_data[DCA_CHANNELS]; ///< FIR history buffers
197 
198  // PCM output data
199  unsigned int output_size;
200  void *output_buffer; ///< PCM output buffer base
201  int32_t *output_samples[DCA_SPEAKER_COUNT]; ///< PCM output for fixed point mode
202  int32_t output_history_lfe_fixed; ///< LFE PCM history for X96 filter
203  float output_history_lfe_float; ///< LFE PCM history for X96 filter
204 
205  int ch_remap[DCA_SPEAKER_COUNT]; ///< Channel to speaker map
206  int request_mask; ///< Requested channel layout (for stereo downmix)
207 
208  int npcmsamples; ///< Number of PCM samples per channel
209  int output_rate; ///< Output sample rate (1x or 2x header rate)
210 
211  int filter_mode; ///< Previous filtering mode for detecting changes
213 
214 static inline int ff_dca_core_map_spkr(DCACoreDecoder *core, int spkr)
215 {
216  if (core->ch_mask & (1U << spkr))
217  return spkr;
218  if (spkr == DCA_SPEAKER_Lss && (core->ch_mask & DCA_SPEAKER_MASK_Ls))
219  return DCA_SPEAKER_Ls;
220  if (spkr == DCA_SPEAKER_Rss && (core->ch_mask & DCA_SPEAKER_MASK_Rs))
221  return DCA_SPEAKER_Rs;
222  return -1;
223 }
224 
225 static inline void ff_dca_core_dequantize(int32_t *output, const int32_t *input,
226  int32_t step_size, int32_t scale, int residual, int len)
227 {
228  // Account for quantizer step size
229  int64_t step_scale = (int64_t)step_size * scale;
230  int n, shift = 0;
231 
232  // Limit scale factor resolution to 22 bits
233  if (step_scale > (1 << 23)) {
234  shift = av_log2(step_scale >> 23) + 1;
235  step_scale >>= shift;
236  }
237 
238  // Scale the samples
239  if (residual) {
240  for (n = 0; n < len; n++)
241  output[n] += clip23(norm__(input[n] * step_scale, 22 - shift));
242  } else {
243  for (n = 0; n < len; n++)
244  output[n] = clip23(norm__(input[n] * step_scale, 22 - shift));
245  }
246 }
247 
248 int ff_dca_core_parse(DCACoreDecoder *s, const uint8_t *data, int size);
249 int ff_dca_core_parse_exss(DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset);
250 int ff_dca_core_filter_fixed(DCACoreDecoder *s, int x96_synth);
255 
256 #endif
dcamath.h
DCACoreDecoder::filter_mode
int filter_mode
Previous filtering mode for detecting changes.
Definition: dca_core.h:211
DCACoreDecoder::joint_scale_factors
int32_t joint_scale_factors[DCA_CHANNELS][DCA_SUBBANDS_X96]
Scale factors for joint subband coding.
Definition: dca_core.h:146
DCADSPData::fix
struct DCADSPData::@53::@55 fix
DCA_SPEAKER_Lss
@ DCA_SPEAKER_Lss
Definition: dca.h:80
DCACoreDecoder::joint_scale_sel
int8_t joint_scale_sel[DCA_CHANNELS]
Joint subband codebook select.
Definition: dca_core.h:145
DCACoreDecoder::gb_in
GetBitContext gb_in
Definition: dca_core.h:102
DCA_LFE_FLAG_INVALID
@ DCA_LFE_FLAG_INVALID
Definition: dca_core.h:82
DCA_EXT_AUDIO_X96
@ DCA_EXT_AUDIO_X96
Definition: dca_core.h:74
mem_internal.h
DCA_LFE_FLAG_NONE
@ DCA_LFE_FLAG_NONE
Definition: dca_core.h:79
dca.h
DCACoreDecoder::imdct
FFTContext imdct[2]
Definition: dca_core.h:193
DCACoreDecoder::lfe_present
int lfe_present
Low frequency effects flag.
Definition: dca_core.h:117
DCACoreDecoder::npcmsamples
int npcmsamples
Number of PCM samples per channel.
Definition: dca_core.h:208
DCACoreDecoder::ts_present
int ts_present
Embedded time stamp flag.
Definition: dca_core.h:112
DCACoreDecoder::sync_ssf
int sync_ssf
Audio sync word insertion flag.
Definition: dca_core.h:116
DCA_LFE_FLAG_128
@ DCA_LFE_FLAG_128
Definition: dca_core.h:80
synth_filter.h
ff_dca_core_filter_frame
int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame)
Definition: dca_core.c:2358
DCA_SPEAKER_MASK_Rs
@ DCA_SPEAKER_MASK_Rs
Definition: dca.h:95
output
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
Definition: filter_design.txt:225
dcadct.h
DCACoreDecoder::output_size
unsigned int output_size
Definition: dca_core.h:199
DCACoreDecoder::audio_mode
int audio_mode
Audio channel arrangement.
Definition: dca_core.h:108
DCACoreDecoder::dcadct
DCADCTContext dcadct
Definition: dca_core.h:192
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
DCACoreDecoder::output_history_lfe_fixed
int32_t output_history_lfe_fixed
LFE PCM history for X96 filter.
Definition: dca_core.h:202
DCACoreDecoder::joint_intensity_index
int8_t joint_intensity_index[DCA_CHANNELS]
Joint intensity coding index.
Definition: dca_core.h:131
DCA_AMODE_STEREO
@ DCA_AMODE_STEREO
Definition: dca_core.h:60
data
const char data[16]
Definition: mxf.c:146
AVFixedDSPContext
Definition: fixed_dsp.h:56
DCA_AMODE_STEREO_SUMDIFF
@ DCA_AMODE_STEREO_SUMDIFF
Definition: dca_core.h:61
DCADSPData::offset
int offset
Definition: dca_core.h:96
DCACoreDecoder::dcadsp
DCADSPContext * dcadsp
Definition: dca_core.h:191
DCACoreDecoder::x96_rev_no
int x96_rev_no
X96 revision number.
Definition: dca_core.h:171
DCACoreDecoder::x96_subband_size
unsigned int x96_subband_size
Definition: dca_core.h:180
DCACoreDecoder::nsubframes
int nsubframes
Number of subframes.
Definition: dca_core.h:126
DCACoreAudioMode
DCACoreAudioMode
Definition: dca_core.h:57
DCAExssAsset
Definition: dca_exss.h:29
DCACoreDecoder::x96_pos
int x96_pos
Bit position of X96 frame in core substream.
Definition: dca_core.h:177
DCA_CORE_CHANNELS_MAX
#define DCA_CORE_CHANNELS_MAX
Definition: dca_core.h:48
DCACoreDecoder::subband_size
unsigned int subband_size
Definition: dca_core.h:184
DCACoreDecoder::scale_factor_sel
int8_t scale_factor_sel[DCA_CHANNELS]
Scale factor code book.
Definition: dca_core.h:133
SynthFilterContext
Definition: synth_filter.h:27
DCACoreDecoder::nchannels
int nchannels
Number of primary audio channels (incl. extension channels)
Definition: dca_core.h:127
DCACoreDecoder::sumdiff_surround
int sumdiff_surround
Surround sum/difference flag.
Definition: dca_core.h:123
GetBitContext
Definition: get_bits.h:61
DCA_EXT_AUDIO_XXCH
@ DCA_EXT_AUDIO_XXCH
Definition: dca_core.h:75
DCACoreDecoder::prediction_vq_index
int16_t prediction_vq_index[DCA_CHANNELS][DCA_SUBBANDS_X96]
Prediction coefficients VQ address.
Definition: dca_core.h:141
scale
static av_always_inline float scale(float x, float s)
Definition: vf_v360.c:1389
clip23
static int32_t clip23(int32_t a)
Definition: dcamath.h:54
DCACoreDecoder::x96_crc_present
int x96_crc_present
CRC presence flag for X96 channel set header.
Definition: dca_core.h:172
DCACoreDecoder
Definition: dca_core.h:99
DCACoreDecoder::sample_rate
int sample_rate
Core audio sampling frequency.
Definition: dca_core.h:109
av_cold
#define av_cold
Definition: attributes.h:90
DCA_AMODE_STEREO_TOTAL
@ DCA_AMODE_STEREO_TOTAL
Definition: dca_core.h:62
DCACoreDecoder::fixed_dsp
AVFixedDSPContext * fixed_dsp
Definition: dca_core.h:196
DCACoreDecoder::output_rate
int output_rate
Output sample rate (1x or 2x header rate)
Definition: dca_core.h:209
DCACoreDecoder::xxch_core_mask
int xxch_core_mask
Core loudspeaker activity mask.
Definition: dca_core.h:162
DCA_SPEAKER_Rss
@ DCA_SPEAKER_Rss
Definition: dca.h:80
DCACoreDecoder::ch_remap
int ch_remap[DCA_SPEAKER_COUNT]
Channel to speaker map.
Definition: dca_core.h:205
s
#define s(width, name)
Definition: cbs_vp9.c:256
ff_dca_core_init
av_cold int ff_dca_core_init(DCACoreDecoder *s)
Definition: dca_core.c:2425
DCADSPData
Definition: dca_core.h:85
DCACoreDecoder::ext_audio_type
int ext_audio_type
Extension audio descriptor flag.
Definition: dca_core.h:114
DCADCTContext
Definition: dcadct.h:27
DCA_AMODE_MONO_DUAL
@ DCA_AMODE_MONO_DUAL
Definition: dca_core.h:59
DCA_SPEAKER_Ls
@ DCA_SPEAKER_Ls
Definition: dca.h:78
DCACoreDecoder::subband_samples
int32_t * subband_samples[DCA_CHANNELS][DCA_SUBBANDS]
Subband samples.
Definition: dca_core.h:186
DCACoreDecoder::crc_present
int crc_present
CRC present flag.
Definition: dca_core.h:105
DCACoreDecoder::sumdiff_front
int sumdiff_front
Front sum/difference flag.
Definition: dca_core.h:122
get_bits.h
DCA_AMODE_MONO
@ DCA_AMODE_MONO
Definition: dca_core.h:58
fixed_dsp.h
dca_exss.h
DCACoreDecoder::x96_rand
int x96_rand
Random seed for generating samples for unallocated X96 subbands.
Definition: dca_core.h:176
DCACoreDecoder::float_dsp
AVFloatDSPContext * float_dsp
Definition: dca_core.h:195
DCADSPData::u
union DCADSPData::@53 u
DCACoreDecoder::filter_perfect
int filter_perfect
Multirate interpolator switch.
Definition: dca_core.h:119
DCACoreDecoder::output_samples
int32_t * output_samples[DCA_SPEAKER_COUNT]
PCM output for fixed point mode.
Definition: dca_core.h:201
DCACoreDecoder::subband_buffer
int32_t * subband_buffer
Subband sample buffer base.
Definition: dca_core.h:185
DCA_SPEAKER_Rs
@ DCA_SPEAKER_Rs
Definition: dca.h:79
DCACoreDecoder::output_buffer
void * output_buffer
PCM output buffer base.
Definition: dca_core.h:200
DCACoreDecoder::nsubsubframes
int8_t nsubsubframes[DCA_SUBFRAMES]
Subsubframe count for each subframe.
Definition: dca_core.h:139
DCACoreDecoder::bit_allocation_sel
int8_t bit_allocation_sel[DCA_CHANNELS]
Bit allocation quantizer select.
Definition: dca_core.h:134
DCACoreDecoder::ext_audio_present
int ext_audio_present
Extended coding flag.
Definition: dca_core.h:115
DCACoreDecoder::scale_factor_adj
int32_t scale_factor_adj[DCA_CHANNELS][DCA_CODE_BOOKS]
Scale factor adjustment.
Definition: dca_core.h:136
DCACoreDecoder::quant_index_sel
int8_t quant_index_sel[DCA_CHANNELS][DCA_CODE_BOOKS]
Quantization index codebook select.
Definition: dca_core.h:135
ff_dca_core_flush
av_cold void ff_dca_core_flush(DCACoreDecoder *s)
Definition: dca_core.c:2412
DCA_DMIX_CHANNELS_MAX
#define DCA_DMIX_CHANNELS_MAX
Definition: dca_core.h:49
DCACoreDecoder::source_pcm_res
int source_pcm_res
Source PCM resolution.
Definition: dca_core.h:120
DCACoreDecoder::prediction_mode
int8_t prediction_mode[DCA_CHANNELS][DCA_SUBBANDS_X96]
Prediction mode.
Definition: dca_core.h:140
DCA_CHANNELS
#define DCA_CHANNELS
Definition: dca_core.h:39
DCADSPContext
Definition: dcadsp.h:30
float_dsp.h
dcahuff.h
DCADSPData::flt
struct DCADSPData::@53::@54 flt
DCACoreDecoder::es_format
int es_format
Extended surround (ES) mastering flag.
Definition: dca_core.h:121
shift
static int shift(int a, int b)
Definition: bonk.c:260
DCACoreExtAudioType
DCACoreExtAudioType
Definition: dca_core.h:72
ff_dca_core_close
av_cold void ff_dca_core_close(DCACoreDecoder *s)
Definition: dca_core.c:2443
DCACoreDecoder::prim_dmix_type
int prim_dmix_type
Auxiliary primary channel downmix type.
Definition: dca_core.h:150
size
int size
Definition: twinvq_data.h:10344
DCACoreDecoder::request_mask
int request_mask
Requested channel layout (for stereo downmix)
Definition: dca_core.h:206
DCA_CODE_BOOKS
#define DCA_CODE_BOOKS
Definition: dcahuff.h:32
DCACoreDecoder::ch_mask
int ch_mask
Speaker layout mask (incl. LFE and extension channels)
Definition: dca_core.h:128
DCA_SUBBANDS_X96
#define DCA_SUBBANDS_X96
Definition: dca_core.h:41
DCA_AMODE_3F2R
@ DCA_AMODE_3F2R
Definition: dca_core.h:67
DCACoreDecoder::bit_allocation
int8_t bit_allocation[DCA_CHANNELS][DCA_SUBBANDS_X96]
Bit allocation index.
Definition: dca_core.h:142
AVFloatDSPContext
Definition: float_dsp.h:24
ff_dca_core_filter_fixed
int ff_dca_core_filter_fixed(DCACoreDecoder *s, int x96_synth)
Definition: dca_core.c:1972
DCACoreDecoder::xxch_spkr_mask
int xxch_spkr_mask
Loudspeaker layout mask.
Definition: dca_core.h:163
DCACoreDecoder::transition_mode
int8_t transition_mode[DCA_SUBFRAMES][DCA_CHANNELS][DCA_SUBBANDS]
Transition mode.
Definition: dca_core.h:143
DCA_AMODE_2F2R
@ DCA_AMODE_2F2R
Definition: dca_core.h:66
DCA_AMODE_3F
@ DCA_AMODE_3F
Definition: dca_core.h:63
DCA_LFE_FLAG_64
@ DCA_LFE_FLAG_64
Definition: dca_core.h:81
DCACoreDecoder::avctx
AVCodecContext * avctx
Definition: dca_core.h:100
DCACoreDecoder::xxch_crc_present
int xxch_crc_present
CRC presence flag for XXCH channel set header.
Definition: dca_core.h:160
input
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
Definition: filter_design.txt:172
dcadsp.h
DCACoreDecoder::ext_audio_mask
int ext_audio_mask
Bit mask of fully decoded core extensions.
Definition: dca_core.h:154
DCACoreDecoder::frame_size
int frame_size
Primary frame byte size.
Definition: dca_core.h:107
DCACoreDecoder::bit_rate
int bit_rate
Transmission bit rate.
Definition: dca_core.h:110
DCACoreDecoder::predictor_history
int predictor_history
Predictor history flag switch.
Definition: dca_core.h:118
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem.h:116
DCACoreDecoder::dcadsp_data
DCADSPData dcadsp_data[DCA_CHANNELS]
FIR history buffers.
Definition: dca_core.h:190
FFTContext
Definition: fft.h:76
DCACoreDecoder::output_history_lfe_float
float output_history_lfe_float
LFE PCM history for X96 filter.
Definition: dca_core.h:203
DCACoreDecoder::xxch_pos
int xxch_pos
Bit position of XXCH frame in core substream.
Definition: dca_core.h:168
ff_dca_core_parse
int ff_dca_core_parse(DCACoreDecoder *s, const uint8_t *data, int size)
Definition: dca_core.c:1811
DCACoreDecoder::lfe_samples
int32_t * lfe_samples
Decimated LFE samples.
Definition: dca_core.h:187
DCADSPData::hist2
float hist2[64]
Definition: dca_core.h:89
DCA_AMODE_2F1R
@ DCA_AMODE_2F1R
Definition: dca_core.h:64
len
int len
Definition: vorbis_enc_data.h:426
norm__
static int32_t norm__(int64_t a, int bits)
Definition: dcamath.h:27
DCA_EXT_AUDIO_XCH
@ DCA_EXT_AUDIO_XCH
Definition: dca_core.h:73
avcodec.h
DCACoreDecoder::prim_dmix_embedded
int prim_dmix_embedded
Auxiliary dynamic downmix flag.
Definition: dca_core.h:149
ff_dca_core_map_spkr
static int ff_dca_core_map_spkr(DCACoreDecoder *core, int spkr)
Definition: dca_core.h:214
DCA_SUBBANDS
#define DCA_SUBBANDS
Definition: dca_core.h:40
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
DCACoreDecoder::x96_nchannels
int x96_nchannels
Number of primary channels in X96 extension.
Definition: dca_core.h:173
DCA_AMODE_3F1R
@ DCA_AMODE_3F1R
Definition: dca_core.h:65
DCACoreDecoder::prim_dmix_coeff
int prim_dmix_coeff[DCA_DMIX_CHANNELS_MAX *DCA_CORE_CHANNELS_MAX]
Dynamic downmix code coefficients.
Definition: dca_core.h:151
DCACoreDecoder::x96_subband_start
int x96_subband_start
First encoded subband in X96 extension.
Definition: dca_core.h:175
DCACoreDecoder::x96_subband_buffer
int32_t * x96_subband_buffer
X96 subband sample buffer base.
Definition: dca_core.h:181
DCACoreDecoder::gb
GetBitContext gb
Definition: dca_core.h:101
U
#define U(x)
Definition: vpx_arith.h:37
DCA_AMODE_COUNT
@ DCA_AMODE_COUNT
Definition: dca_core.h:69
DCACoreDecoder::xxch_dmix_scale_inv
int xxch_dmix_scale_inv
Downmix scale factor.
Definition: dca_core.h:165
ff_dca_core_dequantize
static void ff_dca_core_dequantize(int32_t *output, const int32_t *input, int32_t step_size, int32_t scale, int residual, int len)
Definition: dca_core.h:225
DCACoreDecoder::xch_pos
int xch_pos
Bit position of XCH frame in core substream.
Definition: dca_core.h:157
fft.h
AVCodecContext
main external API structure.
Definition: avcodec.h:398
DCADSPData::hist1
float hist1[1024]
Definition: dca_core.h:88
ff_dca_core_parse_exss
int ff_dca_core_parse_exss(DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset)
Definition: dca_core.c:1844
DCACoreDecoder::nsubbands
int8_t nsubbands[DCA_CHANNELS]
Subband activity count.
Definition: dca_core.h:129
DCACoreDecoder::xxch_dmix_embedded
int xxch_dmix_embedded
Downmix already performed by encoder.
Definition: dca_core.h:164
DCACoreDecoder::x96_high_res
int x96_high_res
X96 high resolution flag.
Definition: dca_core.h:174
DCACoreDecoder::xxch_mask_nbits
int xxch_mask_nbits
Number of bits for loudspeaker mask.
Definition: dca_core.h:161
DCACoreDecoder::transition_mode_sel
int8_t transition_mode_sel[DCA_CHANNELS]
Transient mode code book.
Definition: dca_core.h:132
DCA_XXCH_CHANNELS_MAX
#define DCA_XXCH_CHANNELS_MAX
Definition: dca_core.h:50
DCACoreDecoder::xxch_dmix_coeff
int xxch_dmix_coeff[DCA_XXCH_CHANNELS_MAX *DCA_CORE_CHANNELS_MAX]
Downmix coefficients.
Definition: dca_core.h:167
DCA_SUBFRAMES
#define DCA_SUBFRAMES
Definition: dca_core.h:42
DCA_SPEAKER_MASK_Ls
@ DCA_SPEAKER_MASK_Ls
Definition: dca.h:94
DCACoreDecoder::xxch_dmix_mask
int xxch_dmix_mask[DCA_XXCH_CHANNELS_MAX]
Downmix channel mapping mask.
Definition: dca_core.h:166
DCACoreDecoder::x96_subband_samples
int32_t * x96_subband_samples[DCA_CHANNELS][DCA_SUBBANDS_X96]
X96 subband samples.
Definition: dca_core.h:182
DCACoreDecoder::scale_factors
int32_t scale_factors[DCA_CHANNELS][DCA_SUBBANDS][2]
Scale factors (2x for transients and X96)
Definition: dca_core.h:144
DCACoreDecoder::synth
SynthFilterContext synth
Definition: dca_core.h:194
DCACoreDecoder::subband_vq_start
int8_t subband_vq_start[DCA_CHANNELS]
High frequency VQ start subband.
Definition: dca_core.h:130
int32_t
int32_t
Definition: audioconvert.c:56
DCA_SPEAKER_COUNT
@ DCA_SPEAKER_COUNT
Definition: dca.h:87
DCACoreDecoder::drc_present
int drc_present
Embedded dynamic range flag.
Definition: dca_core.h:111
DCACoreDecoder::npcmblocks
int npcmblocks
Number of PCM sample blocks.
Definition: dca_core.h:106
DCACoreDecoder::aux_present
int aux_present
Auxiliary data flag.
Definition: dca_core.h:113
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
DCACoreLFEFlag
DCACoreLFEFlag
Definition: dca_core.h:78