21 #ifndef AVCODEC_DCA_CORE_H
22 #define AVCODEC_DCA_CORE_H
41 #define DCA_CHANNELS 7
42 #define DCA_SUBBANDS 32
43 #define DCA_SUBBANDS_X96 64
44 #define DCA_SUBFRAMES 16
45 #define DCA_SUBBAND_SAMPLES 8
46 #define DCA_PCMBLOCK_SAMPLES 32
47 #define DCA_LFE_HISTORY 8
48 #define DCA_ABITS_MAX 26
50 #define DCA_CORE_CHANNELS_MAX 6
51 #define DCA_DMIX_CHANNELS_MAX 4
52 #define DCA_XXCH_CHANNELS_MAX 2
53 #define DCA_EXSS_CHANNELS_MAX 8
54 #define DCA_EXSS_CHSETS_MAX 4
56 #define DCA_FILTER_MODE_X96 0x01
57 #define DCA_FILTER_MODE_FIXED 0x02
218 if (core->
ch_mask & (1U << spkr))
231 int64_t step_scale = (int64_t)step_size * scale;
235 if (step_scale > (1 << 23)) {
237 step_scale >>=
shift;
242 for (n = 0; n <
len; n++)
245 for (n = 0; n <
len; n++)
Libavcodec external API header.
common internal and external API header
static void ff_dca_core_dequantize(int32_t *output, const int32_t *input, int32_t step_size, int32_t scale, int residual, int len)
#define DCA_XXCH_CHANNELS_MAX
int ff_dca_core_filter_fixed(DCACoreDecoder *s, int x96_synth)
#define DCA_CORE_CHANNELS_MAX
static int ff_dca_core_map_spkr(DCACoreDecoder *core, int spkr)
int ff_dca_core_parse(DCACoreDecoder *s, uint8_t *data, int size)
int ff_dca_core_parse_exss(DCACoreDecoder *s, uint8_t *data, DCAExssAsset *asset)
av_cold int ff_dca_core_init(DCACoreDecoder *s)
av_cold void ff_dca_core_flush(DCACoreDecoder *s)
@ DCA_AMODE_STEREO_SUMDIFF
#define DCA_DMIX_CHANNELS_MAX
av_cold void ff_dca_core_close(DCACoreDecoder *s)
int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame)
static int32_t norm__(int64_t a, int bits)
static int32_t clip23(int32_t a)
bitstream reader API header.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
common internal API header
static int shift(int a, int b)
main external API structure.
This structure describes decoded (raw) audio or video data.
int x96_subband_start
First encoded subband in X96 extension.
int filter_perfect
Multirate interpolator switch.
int nchannels
Number of primary audio channels (incl. extension channels)
int xxch_dmix_coeff[DCA_XXCH_CHANNELS_MAX *DCA_CORE_CHANNELS_MAX]
Downmix coefficients.
int prim_dmix_embedded
Auxiliary dynamic downmix flag.
int32_t * subband_buffer
Subband sample buffer base.
int filter_mode
Previous filtering mode for detecting changes.
int x96_high_res
X96 high resolution flag.
int8_t nsubbands[DCA_CHANNELS]
Subband activity count.
int npcmblocks
Number of PCM sample blocks.
int sync_ssf
Audio sync word insertion flag.
AVFloatDSPContext * float_dsp
int xxch_spkr_mask
Loudspeaker layout mask.
int source_pcm_res
Source PCM resolution.
int16_t prediction_vq_index[DCA_CHANNELS][DCA_SUBBANDS_X96]
Prediction coefficients VQ address.
int x96_pos
Bit position of X96 frame in core substream.
float output_history_lfe_float
LFE PCM history for X96 filter.
int x96_crc_present
CRC presence flag for X96 channel set header.
DCADSPData dcadsp_data[DCA_CHANNELS]
FIR history buffers.
int es_format
Extended surround (ES) mastering flag.
int xch_pos
Bit position of XCH frame in core substream.
AVFixedDSPContext * fixed_dsp
int8_t transition_mode_sel[DCA_CHANNELS]
Transient mode code book.
int8_t prediction_mode[DCA_CHANNELS][DCA_SUBBANDS_X96]
Prediction mode.
int8_t bit_allocation_sel[DCA_CHANNELS]
Bit allocation quantizer select.
int8_t bit_allocation[DCA_CHANNELS][DCA_SUBBANDS_X96]
Bit allocation index.
int npcmsamples
Number of PCM samples per channel.
int xxch_core_mask
Core loudspeaker activity mask.
int ext_audio_mask
Bit mask of fully decoded core extensions.
int prim_dmix_type
Auxiliary primary channel downmix type.
int8_t quant_index_sel[DCA_CHANNELS][DCA_CODE_BOOKS]
Quantization index codebook select.
int audio_mode
Audio channel arrangement.
int crc_present
CRC present flag.
int ch_remap[DCA_SPEAKER_COUNT]
Channel to speaker map.
int32_t scale_factor_adj[DCA_CHANNELS][DCA_CODE_BOOKS]
Scale factor adjustment.
int aux_present
Auxiliary data flag.
int nsubframes
Number of subframes.
int request_mask
Requested channel layout (for stereo downmix)
int32_t output_history_lfe_fixed
LFE PCM history for X96 filter.
void * output_buffer
PCM output buffer base.
int xxch_dmix_embedded
Downmix already performed by encoder.
int32_t * lfe_samples
Decimated LFE samples.
int32_t * x96_subband_buffer
X96 subband sample buffer base.
int8_t nsubsubframes[DCA_SUBFRAMES]
Subsubframe count for each subframe.
int output_rate
Output sample rate (1x or 2x header rate)
int8_t joint_intensity_index[DCA_CHANNELS]
Joint intensity coding index.
int32_t * x96_subband_samples[DCA_CHANNELS][DCA_SUBBANDS_X96]
X96 subband samples.
int ext_audio_type
Extension audio descriptor flag.
int x96_nchannels
Number of primary channels in X96 extension.
int8_t scale_factor_sel[DCA_CHANNELS]
Scale factor code book.
int lfe_present
Low frequency effects flag.
int xxch_crc_present
CRC presence flag for XXCH channel set header.
int ts_present
Embedded time stamp flag.
int8_t joint_scale_sel[DCA_CHANNELS]
Joint subband codebook select.
int frame_size
Primary frame byte size.
int predictor_history
Predictor history flag switch.
int8_t subband_vq_start[DCA_CHANNELS]
High frequency VQ start subband.
int32_t * subband_samples[DCA_CHANNELS][DCA_SUBBANDS]
Subband samples.
int prim_dmix_coeff[DCA_DMIX_CHANNELS_MAX *DCA_CORE_CHANNELS_MAX]
Dynamic downmix code coefficients.
int xxch_mask_nbits
Number of bits for loudspeaker mask.
unsigned int subband_size
int sumdiff_surround
Surround sum/difference flag.
unsigned int x96_subband_size
int bit_rate
Transmission bit rate.
int xxch_dmix_mask[DCA_XXCH_CHANNELS_MAX]
Downmix channel mapping mask.
int drc_present
Embedded dynamic range flag.
int sample_rate
Core audio sampling frequency.
int x96_rev_no
X96 revision number.
int32_t scale_factors[DCA_CHANNELS][DCA_SUBBANDS][2]
Scale factors (2x for transients and X96)
int xxch_pos
Bit position of XXCH frame in core substream.
int sumdiff_front
Front sum/difference flag.
int8_t transition_mode[DCA_SUBFRAMES][DCA_CHANNELS][DCA_SUBBANDS]
Transition mode.
int ch_mask
Speaker layout mask (incl. LFE and extension channels)
int ext_audio_present
Extended coding flag.
int x96_rand
Random seed for generating samples for unallocated X96 subbands.
int32_t * output_samples[DCA_SPEAKER_COUNT]
PCM output for fixed point mode.
int32_t joint_scale_factors[DCA_CHANNELS][DCA_SUBBANDS_X96]
Scale factors for joint subband coding.
int xxch_dmix_scale_inv
Downmix scale factor.
struct DCADSPData::@45::@47 fix
struct DCADSPData::@45::@46 flt