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