FFmpeg
atrac3plus.h
Go to the documentation of this file.
1 /*
2  * ATRAC3+ compatible decoder
3  *
4  * Copyright (c) 2010-2013 Maxim Poliakovski
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * Global structures, constants and data for ATRAC3+ decoder.
26  */
27 
28 #ifndef AVCODEC_ATRAC3PLUS_H
29 #define AVCODEC_ATRAC3PLUS_H
30 
31 #include <stdint.h>
32 
33 #include "libavutil/float_dsp.h"
34 #include "atrac.h"
35 #include "avcodec.h"
36 #include "fft.h"
37 #include "get_bits.h"
38 
39 /** Global unit sizes */
40 #define ATRAC3P_SUBBANDS 16 ///< number of PQF subbands
41 #define ATRAC3P_SUBBAND_SAMPLES 128 ///< number of samples per subband
42 #define ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS)
43 
44 #define ATRAC3P_PQF_FIR_LEN 12 ///< length of the prototype FIR of the PQF
45 
46 /** Global constants */
47 #define ATRAC3P_POWER_COMP_OFF 15 ///< disable power compensation
48 
49 /** ATRAC3+ channel unit types */
51  CH_UNIT_MONO = 0, ///< unit containing one coded channel
52  CH_UNIT_STEREO = 1, ///< unit containing two jointly-coded channels
53  CH_UNIT_EXTENSION = 2, ///< unit containing extension information
54  CH_UNIT_TERMINATOR = 3 ///< unit sequence terminator
55 };
56 
57 /** Per-channel IPQF history */
58 typedef struct Atrac3pIPQFChannelCtx {
61  int pos;
63 
64 /** Amplitude envelope of a group of sine waves */
65 typedef struct Atrac3pWaveEnvelope {
66  int has_start_point; ///< indicates start point within the GHA window
67  int has_stop_point; ///< indicates stop point within the GHA window
68  int start_pos; ///< start position expressed in n*4 samples
69  int stop_pos; ///< stop position expressed in n*4 samples
71 
72 /** Parameters of a group of sine waves */
73 typedef struct Atrac3pWavesData {
74  Atrac3pWaveEnvelope pend_env; ///< pending envelope from the previous frame
75  Atrac3pWaveEnvelope curr_env; ///< group envelope from the current frame
76  int num_wavs; ///< number of sine waves in the group
77  int start_index; ///< start index into global tones table for that subband
79 
80 /** Parameters of a single sine wave */
81 typedef struct Atrac3pWaveParam {
82  int freq_index; ///< wave frequency index
83  int amp_sf; ///< quantized amplitude scale factor
84  int amp_index; ///< quantized amplitude index
85  int phase_index; ///< quantized phase index
87 
88 /** Sound channel parameters */
89 typedef struct Atrac3pChanParams {
90  int ch_num;
91  int num_coded_vals; ///< number of transmitted quant unit values
92  int fill_mode;
94  int table_type; ///< table type: 0 - tone?, 1- noise?
95  int qu_wordlen[32]; ///< array of word lengths for each quant unit
96  int qu_sf_idx[32]; ///< array of scale factor indexes for each quant unit
97  int qu_tab_idx[32]; ///< array of code table indexes for each quant unit
98  int16_t spectrum[2048]; ///< decoded IMDCT spectrum
99  uint8_t power_levs[5]; ///< power compensation levels
100 
101  /* imdct window shape history (2 frames) for overlapping. */
102  uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS]; ///< IMDCT window shape, 0=sine/1=steep
103  uint8_t *wnd_shape; ///< IMDCT window shape for current frame
104  uint8_t *wnd_shape_prev; ///< IMDCT window shape for previous frame
105 
106  /* gain control data history (2 frames) for overlapping. */
107  AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS]; ///< gain control data for all subbands
108  AtracGainInfo *gain_data; ///< gain control data for next frame
109  AtracGainInfo *gain_data_prev; ///< gain control data for previous frame
110  int num_gain_subbands; ///< number of subbands with gain control data
111 
112  /* tones data history (2 frames) for overlapping. */
117 
118 /* Per-unit sine wave parameters */
119 typedef struct Atrac3pWaveSynthParams {
120  int tones_present; ///< 1 - tones info present
121  int amplitude_mode; ///< 1 - low range, 0 - high range
122  int num_tone_bands; ///< number of PQF bands with tones
123  uint8_t tone_sharing[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone sharing flags
124  uint8_t tone_master[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone channel swapping
125  uint8_t invert_phase[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise phase inversion
126  int tones_index; ///< total sum of tones in this unit
129 
130 /** Channel unit parameters */
131 typedef struct Atrac3pChanUnitCtx {
132  /* channel unit variables */
133  int unit_type; ///< unit type (mono/stereo)
136  int used_quant_units; ///< number of quant units with coded spectrum
137  int num_coded_subbands; ///< number of subbands with coded spectrum
138  int mute_flag; ///< mute flag
139  int use_full_table; ///< 1 - full table list, 0 - restricted one
140  int noise_present; ///< 1 - global noise info present
141  int noise_level_index; ///< global noise level index
142  int noise_table_index; ///< global noise RNG table index
143  uint8_t swap_channels[ATRAC3P_SUBBANDS]; ///< 1 - perform subband-wise channel swapping
144  uint8_t negate_coeffs[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise IMDCT coefficients negation
146 
147  /* Variables related to GHA tones */
148  Atrac3pWaveSynthParams wave_synth_hist[2]; ///< waves synth history for two frames
151 
153  DECLARE_ALIGNED(32, float, prev_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< overlapping buffer
155 
156 /**
157  * Initialize VLC tables for bitstream parsing.
158  */
159 void ff_atrac3p_init_vlcs(void);
160 
161 /**
162  * Decode bitstream data of a channel unit.
163  *
164  * @param[in] gb the GetBit context
165  * @param[in,out] ctx ptr to the channel unit context
166  * @param[in] num_channels number of channels to process
167  * @param[in] avctx ptr to the AVCodecContext
168  * @return result code: 0 = OK, otherwise - error code
169  */
171  int num_channels, AVCodecContext *avctx);
172 
173 /**
174  * Initialize IMDCT transform.
175  *
176  * @param[in] avctx ptr to the AVCodecContext
177  * @param[in] mdct_ctx pointer to MDCT transform context
178  */
179 void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx);
180 
181 /**
182  * Initialize sine waves synthesizer.
183  */
184 void ff_atrac3p_init_wave_synth(void);
185 
186 /**
187  * Synthesize sine waves for a particular subband.
188  *
189  * @param[in] ch_unit pointer to the channel unit context
190  * @param[in] fdsp pointer to float DSP context
191  * @param[in] ch_num which channel to process
192  * @param[in] sb which subband to process
193  * @param[out] out receives processed data
194  */
196  int ch_num, int sb, float *out);
197 
198 /**
199  * Perform power compensation aka noise dithering.
200  *
201  * @param[in] ctx ptr to the channel context
202  * @param[in] fdsp pointer to float DSP context
203  * @param[in] ch_index which channel to process
204  * @param[in,out] sp ptr to channel spectrum to process
205  * @param[in] rng_index indicates which RNG table to use
206  * @param[in] sb_num which subband to process
207  */
209  int ch_index, float *sp, int rng_index, int sb_num);
210 
211 /**
212  * Regular IMDCT and windowing without overlapping,
213  * with spectrum reversal in the odd subbands.
214  *
215  * @param[in] fdsp pointer to float DSP context
216  * @param[in] mdct_ctx pointer to MDCT transform context
217  * @param[in] pIn float input
218  * @param[out] pOut float output
219  * @param[in] wind_id which MDCT window to apply
220  * @param[in] sb subband number
221  */
222 void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn,
223  float *pOut, int wind_id, int sb);
224 
225 /**
226  * Subband synthesis filter based on the polyphase quadrature (pseudo-QMF)
227  * filter bank.
228  *
229  * @param[in] dct_ctx ptr to the pre-initialized IDCT context
230  * @param[in,out] hist ptr to the filter history
231  * @param[in] in input data to process
232  * @param[out] out receives processed data
233  */
235  const float *in, float *out);
236 
237 extern const uint16_t ff_atrac3p_qu_to_spec_pos[33];
238 extern const float ff_atrac3p_sf_tab[64];
239 extern const float ff_atrac3p_mant_tab[8];
240 
241 #endif /* AVCODEC_ATRAC3PLUS_H */
Atrac3pChanUnitCtx::waves_info
Atrac3pWaveSynthParams * waves_info
Definition: atrac3plus.h:149
Atrac3pChanUnitCtx::num_quant_units
int num_quant_units
Definition: atrac3plus.h:134
Atrac3pWaveSynthParams::tone_master
uint8_t tone_master[ATRAC3P_SUBBANDS]
1 - subband-wise tone channel swapping
Definition: atrac3plus.h:124
Atrac3pChanParams::tones_info_prev
Atrac3pWavesData * tones_info_prev
Definition: atrac3plus.h:115
out
FILE * out
Definition: movenc.c:54
Atrac3pWaveEnvelope::has_stop_point
int has_stop_point
indicates stop point within the GHA window
Definition: atrac3plus.h:67
Atrac3pChanParams::qu_tab_idx
int qu_tab_idx[32]
array of code table indexes for each quant unit
Definition: atrac3plus.h:97
Atrac3pWavesData::num_wavs
int num_wavs
number of sine waves in the group
Definition: atrac3plus.h:76
Atrac3pChanParams::ch_num
int ch_num
Definition: atrac3plus.h:90
Atrac3pChanUnitCtx::ipqf_ctx
Atrac3pIPQFChannelCtx ipqf_ctx[2]
Definition: atrac3plus.h:152
ff_atrac3p_generate_tones
void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp, int ch_num, int sb, float *out)
Synthesize sine waves for a particular subband.
Definition: atrac3plusdsp.c:184
ff_atrac3p_power_compensation
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.
Definition: atrac3plusdsp.c:418
ff_atrac3p_ipqf
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.
Definition: atrac3plusdsp.c:605
Atrac3pChanParams::fill_mode
int fill_mode
Definition: atrac3plus.h:92
Atrac3pChanUnitCtx::negate_coeffs
uint8_t negate_coeffs[ATRAC3P_SUBBANDS]
1 - subband-wise IMDCT coefficients negation
Definition: atrac3plus.h:144
Atrac3pWaveSynthParams::waves
Atrac3pWaveParam waves[48]
Definition: atrac3plus.h:127
Atrac3pChanUnitCtx::use_full_table
int use_full_table
1 - full table list, 0 - restricted one
Definition: atrac3plus.h:139
ATRAC3P_FRAME_SAMPLES
#define ATRAC3P_FRAME_SAMPLES
Definition: atrac3plus.h:42
CH_UNIT_EXTENSION
@ CH_UNIT_EXTENSION
unit containing extension information
Definition: atrac3plus.h:53
Atrac3pChanUnitCtx::noise_level_index
int noise_level_index
global noise level index
Definition: atrac3plus.h:141
Atrac3pChanParams::wnd_shape
uint8_t * wnd_shape
IMDCT window shape for current frame.
Definition: atrac3plus.h:103
GetBitContext
Definition: get_bits.h:61
Atrac3pWaveParam::amp_index
int amp_index
quantized amplitude index
Definition: atrac3plus.h:84
Atrac3pWaveSynthParams
Definition: atrac3plus.h:119
ff_atrac3p_sf_tab
const float ff_atrac3p_sf_tab[64]
Definition: atrac3plusdsp.c:52
Atrac3pChanUnitCtx::used_quant_units
int used_quant_units
number of quant units with coded spectrum
Definition: atrac3plus.h:136
CH_UNIT_MONO
@ CH_UNIT_MONO
unit containing one coded channel
Definition: atrac3plus.h:51
Atrac3pChanUnitCtx::num_coded_subbands
int num_coded_subbands
number of subbands with coded spectrum
Definition: atrac3plus.h:137
Atrac3pWaveSynthParams::tones_index
int tones_index
total sum of tones in this unit
Definition: atrac3plus.h:126
atrac.h
Atrac3pChanUnitCtx::noise_present
int noise_present
1 - global noise info present
Definition: atrac3plus.h:140
ctx
AVFormatContext * ctx
Definition: movenc.c:48
channels
channels
Definition: aptx.h:33
get_bits.h
ff_atrac3p_qu_to_spec_pos
const uint16_t ff_atrac3p_qu_to_spec_pos[33]
Map quant unit number to its position in the spectrum.
Definition: atrac3plusdsp.c:42
Atrac3pChanUnitCtx::waves_info_prev
Atrac3pWaveSynthParams * waves_info_prev
Definition: atrac3plus.h:150
ff_atrac3p_mant_tab
const float ff_atrac3p_mant_tab[8]
Definition: atrac3plusdsp.c:67
ATRAC3P_PQF_FIR_LEN
#define ATRAC3P_PQF_FIR_LEN
length of the prototype FIR of the PQF
Definition: atrac3plus.h:44
CH_UNIT_TERMINATOR
@ CH_UNIT_TERMINATOR
unit sequence terminator
Definition: atrac3plus.h:54
Atrac3pChanUnitCtx::noise_table_index
int noise_table_index
global noise RNG table index
Definition: atrac3plus.h:142
Atrac3pWavesData::pend_env
Atrac3pWaveEnvelope pend_env
pending envelope from the previous frame
Definition: atrac3plus.h:74
Atrac3pChanParams::gain_data_prev
AtracGainInfo * gain_data_prev
gain control data for previous frame
Definition: atrac3plus.h:109
Atrac3pChanParams::spectrum
int16_t spectrum[2048]
decoded IMDCT spectrum
Definition: atrac3plus.h:98
Atrac3pIPQFChannelCtx::buf1
float buf1[ATRAC3P_PQF_FIR_LEN *2][8]
Definition: atrac3plus.h:59
Atrac3pChanParams::num_coded_vals
int num_coded_vals
number of transmitted quant unit values
Definition: atrac3plus.h:91
Atrac3pWaveSynthParams::invert_phase
uint8_t invert_phase[ATRAC3P_SUBBANDS]
1 - subband-wise phase inversion
Definition: atrac3plus.h:125
Atrac3pChanParams::wnd_shape_hist
uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS]
IMDCT window shape, 0=sine/1=steep.
Definition: atrac3plus.h:102
AtracGainInfo
Gain control parameters for one subband.
Definition: atrac.h:35
Atrac3pChanParams::tones_info
Atrac3pWavesData * tones_info
Definition: atrac3plus.h:114
Atrac3pWaveSynthParams::tone_sharing
uint8_t tone_sharing[ATRAC3P_SUBBANDS]
1 - subband-wise tone sharing flags
Definition: atrac3plus.h:123
float_dsp.h
Atrac3pWaveEnvelope::has_start_point
int has_start_point
indicates start point within the GHA window
Definition: atrac3plus.h:66
Atrac3pWavesData::start_index
int start_index
start index into global tones table for that subband
Definition: atrac3plus.h:77
Atrac3pChanParams::gain_data_hist
AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS]
gain control data for all subbands
Definition: atrac3plus.h:107
sp
#define sp
Definition: regdef.h:63
Atrac3pChanParams::qu_sf_idx
int qu_sf_idx[32]
array of scale factor indexes for each quant unit
Definition: atrac3plus.h:96
CH_UNIT_STEREO
@ CH_UNIT_STEREO
unit containing two jointly-coded channels
Definition: atrac3plus.h:52
ff_atrac3p_decode_channel_unit
int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
Decode bitstream data of a channel unit.
Definition: atrac3plus.c:1761
AVFloatDSPContext
Definition: float_dsp.h:24
Atrac3pWaveParam::amp_sf
int amp_sf
quantized amplitude scale factor
Definition: atrac3plus.h:83
Atrac3pIPQFChannelCtx
Per-channel IPQF history.
Definition: atrac3plus.h:58
Atrac3pWaveEnvelope
Amplitude envelope of a group of sine waves.
Definition: atrac3plus.h:65
Atrac3pChanUnitCtx::wave_synth_hist
Atrac3pWaveSynthParams wave_synth_hist[2]
waves synth history for two frames
Definition: atrac3plus.h:148
Atrac3pChanParams
Sound channel parameters.
Definition: atrac3plus.h:89
Atrac3pWaveSynthParams::amplitude_mode
int amplitude_mode
1 - low range, 0 - high range
Definition: atrac3plus.h:121
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem.h:112
in
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
Definition: audio_convert.c:326
FFTContext
Definition: fft.h:88
ff_atrac3p_imdct
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.
Definition: atrac3plusdsp.c:464
Atrac3pChanUnitCtx::unit_type
int unit_type
unit type (mono/stereo)
Definition: atrac3plus.h:133
Atrac3pWaveParam
Parameters of a single sine wave.
Definition: atrac3plus.h:81
ff_atrac3p_init_imdct
void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx)
Initialize IMDCT transform.
Definition: atrac3plusdsp.c:80
uint8_t
uint8_t
Definition: audio_convert.c:194
Atrac3pWaveEnvelope::stop_pos
int stop_pos
stop position expressed in n*4 samples
Definition: atrac3plus.h:69
ff_atrac3p_init_vlcs
void ff_atrac3p_init_vlcs(void)
Initialize VLC tables for bitstream parsing.
Definition: atrac3plus.c:80
avcodec.h
Atrac3pChanParams::tones_info_hist
Atrac3pWavesData tones_info_hist[2][ATRAC3P_SUBBANDS]
Definition: atrac3plus.h:113
Atrac3pChanUnitCtx
Channel unit parameters.
Definition: atrac3plus.h:131
ff_atrac3p_init_wave_synth
void ff_atrac3p_init_wave_synth(void)
Initialize sine waves synthesizer.
Definition: atrac3plusdsp.c:97
Atrac3pWaveParam::phase_index
int phase_index
quantized phase index
Definition: atrac3plus.h:85
Atrac3pChanUnitCtx::prev_buf
float prev_buf[2][ATRAC3P_FRAME_SAMPLES]
overlapping buffer
Definition: atrac3plus.h:153
Atrac3pChanUnitCtx::mute_flag
int mute_flag
mute flag
Definition: atrac3plus.h:138
Atrac3pChanParams::power_levs
uint8_t power_levs[5]
power compensation levels
Definition: atrac3plus.h:99
Atrac3pWaveSynthParams::tones_present
int tones_present
1 - tones info present
Definition: atrac3plus.h:120
Atrac3pChanUnitCtx::swap_channels
uint8_t swap_channels[ATRAC3P_SUBBANDS]
1 - perform subband-wise channel swapping
Definition: atrac3plus.h:143
Atrac3pWaveParam::freq_index
int freq_index
wave frequency index
Definition: atrac3plus.h:82
fft.h
AVCodecContext
main external API structure.
Definition: avcodec.h:526
Atrac3pWavesData
Parameters of a group of sine waves.
Definition: atrac3plus.h:73
Atrac3pChanUnitCtx::num_subbands
int num_subbands
Definition: atrac3plus.h:135
Atrac3pChanParams::wnd_shape_prev
uint8_t * wnd_shape_prev
IMDCT window shape for previous frame.
Definition: atrac3plus.h:104
Atrac3pIPQFChannelCtx::pos
int pos
Definition: atrac3plus.h:61
Atrac3pChanParams::table_type
int table_type
table type: 0 - tone?, 1- noise?
Definition: atrac3plus.h:94
Atrac3pChanParams::split_point
int split_point
Definition: atrac3plus.h:93
Atrac3pWavesData::curr_env
Atrac3pWaveEnvelope curr_env
group envelope from the current frame
Definition: atrac3plus.h:75
ATRAC3P_SUBBANDS
#define ATRAC3P_SUBBANDS
Global unit sizes.
Definition: atrac3plus.h:40
Atrac3pChanParams::num_gain_subbands
int num_gain_subbands
number of subbands with gain control data
Definition: atrac3plus.h:110
Atrac3pChanParams::qu_wordlen
int qu_wordlen[32]
array of word lengths for each quant unit
Definition: atrac3plus.h:95
Atrac3pChanParams::gain_data
AtracGainInfo * gain_data
gain control data for next frame
Definition: atrac3plus.h:108
Atrac3pIPQFChannelCtx::buf2
float buf2[ATRAC3P_PQF_FIR_LEN *2][8]
Definition: atrac3plus.h:60
Atrac3pChannelUnitTypes
Atrac3pChannelUnitTypes
ATRAC3+ channel unit types.
Definition: atrac3plus.h:50
Atrac3pWaveSynthParams::num_tone_bands
int num_tone_bands
number of PQF bands with tones
Definition: atrac3plus.h:122
Atrac3pWaveEnvelope::start_pos
int start_pos
start position expressed in n*4 samples
Definition: atrac3plus.h:68