Go to the documentation of this file.
28 #ifndef AVCODEC_ATRAC3PLUS_H
29 #define AVCODEC_ATRAC3PLUS_H
42 #define ATRAC3P_SUBBANDS 16
43 #define ATRAC3P_SUBBAND_SAMPLES 128
44 #define ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS)
46 #define ATRAC3P_PQF_FIR_LEN 12
49 #define ATRAC3P_POWER_COMP_OFF 15
198 int ch_num,
int sb,
float *
out);
211 int ch_index,
float *
sp,
int rng_index,
int sb_num);
225 float *pOut,
int wind_id,
int sb);
237 const float *in,
float *
out);
Atrac3pWaveSynthParams * waves_info
void ff_atrac3p_init_dsp_static(void)
Initialize sine waves synthesizer and ff_sine_* tables.
uint8_t tone_master[ATRAC3P_SUBBANDS]
1 - subband-wise tone channel swapping
Atrac3pWavesData * tones_info_prev
int has_stop_point
indicates stop point within the GHA window
int qu_tab_idx[32]
array of code table indexes for each quant unit
int num_wavs
number of sine waves in the group
Atrac3pIPQFChannelCtx ipqf_ctx[2]
void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp, int ch_num, int sb, float *out)
Synthesize sine waves for a particular subband.
void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, AVFloatDSPContext *fdsp, int ch_index, float *sp, int rng_index, int sb_num)
Perform power compensation aka noise dithering.
void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist, const float *in, float *out)
Subband synthesis filter based on the polyphase quadrature (pseudo-QMF) filter bank.
uint8_t negate_coeffs[ATRAC3P_SUBBANDS]
1 - subband-wise IMDCT coefficients negation
Atrac3pWaveParam waves[48]
int use_full_table
1 - full table list, 0 - restricted one
#define ATRAC3P_FRAME_SAMPLES
@ CH_UNIT_EXTENSION
unit containing extension information
int noise_level_index
global noise level index
uint8_t * wnd_shape
IMDCT window shape for current frame.
int amp_index
quantized amplitude index
const float ff_atrac3p_sf_tab[64]
int used_quant_units
number of quant units with coded spectrum
@ CH_UNIT_MONO
unit containing one coded channel
int num_coded_subbands
number of subbands with coded spectrum
int tones_index
total sum of tones in this unit
int noise_present
1 - global noise info present
const uint16_t ff_atrac3p_qu_to_spec_pos[33]
Map quant unit number to its position in the spectrum.
Atrac3pWaveSynthParams * waves_info_prev
const float ff_atrac3p_mant_tab[8]
#define ATRAC3P_PQF_FIR_LEN
length of the prototype FIR of the PQF
@ CH_UNIT_TERMINATOR
unit sequence terminator
int noise_table_index
global noise RNG table index
Atrac3pWaveEnvelope pend_env
pending envelope from the previous frame
AtracGainInfo * gain_data_prev
gain control data for previous frame
int16_t spectrum[2048]
decoded IMDCT spectrum
float buf1[ATRAC3P_PQF_FIR_LEN *2][8]
int num_coded_vals
number of transmitted quant unit values
uint8_t invert_phase[ATRAC3P_SUBBANDS]
1 - subband-wise phase inversion
uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS]
IMDCT window shape, 0=sine/1=steep.
Gain control parameters for one subband.
Atrac3pWavesData * tones_info
uint8_t tone_sharing[ATRAC3P_SUBBANDS]
1 - subband-wise tone sharing flags
int has_start_point
indicates start point within the GHA window
int start_index
start index into global tones table for that subband
AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS]
gain control data for all subbands
int qu_sf_idx[32]
array of scale factor indexes for each quant unit
@ CH_UNIT_STEREO
unit containing two jointly-coded channels
int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
Decode bitstream data of a channel unit.
int amp_sf
quantized amplitude scale factor
Per-channel IPQF history.
Amplitude envelope of a group of sine waves.
Atrac3pWaveSynthParams wave_synth_hist[2]
waves synth history for two frames
Sound channel parameters.
int amplitude_mode
1 - low range, 0 - high range
#define DECLARE_ALIGNED(n, t, v)
void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn, float *pOut, int wind_id, int sb)
Regular IMDCT and windowing without overlapping, with spectrum reversal in the odd subbands.
int unit_type
unit type (mono/stereo)
Parameters of a single sine wave.
void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx)
Initialize IMDCT transform.
int stop_pos
stop position expressed in n*4 samples
void ff_atrac3p_init_vlcs(void)
Initialize VLC tables for bitstream parsing.
Atrac3pWavesData tones_info_hist[2][ATRAC3P_SUBBANDS]
int phase_index
quantized phase index
float prev_buf[2][ATRAC3P_FRAME_SAMPLES]
overlapping buffer
uint8_t power_levs[5]
power compensation levels
int tones_present
1 - tones info present
uint8_t swap_channels[ATRAC3P_SUBBANDS]
1 - perform subband-wise channel swapping
int freq_index
wave frequency index
main external API structure.
Parameters of a group of sine waves.
uint8_t * wnd_shape_prev
IMDCT window shape for previous frame.
int table_type
table type: 0 - tone?, 1- noise?
Atrac3pWaveEnvelope curr_env
group envelope from the current frame
#define ATRAC3P_SUBBANDS
Global unit sizes.
int num_gain_subbands
number of subbands with gain control data
int qu_wordlen[32]
array of word lengths for each quant unit
AtracGainInfo * gain_data
gain control data for next frame
float buf2[ATRAC3P_PQF_FIR_LEN *2][8]
Atrac3pChannelUnitTypes
ATRAC3+ channel unit types.
int num_tone_bands
number of PQF bands with tones
int start_pos
start position expressed in n*4 samples