FFmpeg
|
#include <stdint.h>
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "atrac.h"
#include "avcodec.h"
#include "fft.h"
#include "get_bits.h"
Go to the source code of this file.
Data Structures | |
struct | Atrac3pIPQFChannelCtx |
Per-channel IPQF history. More... | |
struct | Atrac3pWaveEnvelope |
Amplitude envelope of a group of sine waves. More... | |
struct | Atrac3pWavesData |
Parameters of a group of sine waves. More... | |
struct | Atrac3pWaveParam |
Parameters of a single sine wave. More... | |
struct | Atrac3pChanParams |
Sound channel parameters. More... | |
struct | Atrac3pWaveSynthParams |
struct | Atrac3pChanUnitCtx |
Channel unit parameters. More... | |
Macros | |
#define | ATRAC3P_SUBBANDS 16 |
Global unit sizes. More... | |
#define | ATRAC3P_SUBBAND_SAMPLES 128 |
number of samples per subband More... | |
#define | ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS) |
#define | ATRAC3P_PQF_FIR_LEN 12 |
length of the prototype FIR of the PQF More... | |
#define | ATRAC3P_POWER_COMP_OFF 15 |
Global constants. More... | |
Enumerations | |
enum | Atrac3pChannelUnitTypes { CH_UNIT_MONO = 0, CH_UNIT_STEREO = 1, CH_UNIT_EXTENSION = 2, CH_UNIT_TERMINATOR = 3 } |
ATRAC3+ channel unit types. More... | |
Functions | |
void | ff_atrac3p_init_vlcs (void) |
Initialize VLC tables for bitstream parsing. More... | |
int | ff_atrac3p_decode_channel_unit (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx) |
Decode bitstream data of a channel unit. More... | |
void | ff_atrac3p_init_imdct (AVCodecContext *avctx, FFTContext *mdct_ctx) |
Initialize IMDCT transform. More... | |
void | ff_atrac3p_init_dsp_static (void) |
Initialize sine waves synthesizer and ff_sine_* tables. More... | |
void | ff_atrac3p_generate_tones (Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp, int ch_num, int sb, float *out) |
Synthesize sine waves for a particular subband. More... | |
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. More... | |
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. More... | |
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. More... | |
Variables | |
const uint16_t | ff_atrac3p_qu_to_spec_pos [33] |
Map quant unit number to its position in the spectrum. More... | |
const float | ff_atrac3p_sf_tab [64] |
const float | ff_atrac3p_mant_tab [8] |
Global structures, constants and data for ATRAC3+ decoder.
Definition in file atrac3plus.h.
#define ATRAC3P_SUBBANDS 16 |
#define ATRAC3P_SUBBAND_SAMPLES 128 |
number of samples per subband
Definition at line 43 of file atrac3plus.h.
#define ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS) |
Definition at line 44 of file atrac3plus.h.
#define ATRAC3P_PQF_FIR_LEN 12 |
length of the prototype FIR of the PQF
Definition at line 46 of file atrac3plus.h.
#define ATRAC3P_POWER_COMP_OFF 15 |
ATRAC3+ channel unit types.
Definition at line 52 of file atrac3plus.h.
void ff_atrac3p_init_vlcs | ( | void | ) |
Initialize VLC tables for bitstream parsing.
Definition at line 76 of file atrac3plus.c.
Referenced by atrac3p_init_static().
int ff_atrac3p_decode_channel_unit | ( | GetBitContext * | gb, |
Atrac3pChanUnitCtx * | ctx, | ||
int | num_channels, | ||
AVCodecContext * | avctx | ||
) |
Decode bitstream data of a channel unit.
[in] | gb | the GetBit context |
[in,out] | ctx | ptr to the channel unit context |
[in] | num_channels | number of channels to process |
[in] | avctx | ptr to the AVCodecContext |
Definition at line 1662 of file atrac3plus.c.
Referenced by atrac3p_decode_frame().
void ff_atrac3p_init_imdct | ( | AVCodecContext * | avctx, |
FFTContext * | mdct_ctx | ||
) |
Initialize IMDCT transform.
[in] | avctx | ptr to the AVCodecContext |
[in] | mdct_ctx | pointer to MDCT transform context |
Definition at line 82 of file atrac3plusdsp.c.
Referenced by atrac3p_decode_init().
void ff_atrac3p_init_dsp_static | ( | void | ) |
Initialize sine waves synthesizer and ff_sine_* tables.
Definition at line 96 of file atrac3plusdsp.c.
Referenced by atrac3p_init_static().
void ff_atrac3p_generate_tones | ( | Atrac3pChanUnitCtx * | ch_unit, |
AVFloatDSPContext * | fdsp, | ||
int | ch_num, | ||
int | sb, | ||
float * | out | ||
) |
Synthesize sine waves for a particular subband.
[in] | ch_unit | pointer to the channel unit context |
[in] | fdsp | pointer to float DSP context |
[in] | ch_num | which channel to process |
[in] | sb | which subband to process |
[out] | out | receives processed data |
Definition at line 186 of file atrac3plusdsp.c.
Referenced by reconstruct_frame().
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.
[in] | ctx | ptr to the channel context |
[in] | fdsp | pointer to float DSP context |
[in] | ch_index | which channel to process |
[in,out] | sp | ptr to channel spectrum to process |
[in] | rng_index | indicates which RNG table to use |
[in] | sb_num | which subband to process |
Definition at line 420 of file atrac3plusdsp.c.
Referenced by decode_residual_spectrum().
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.
[in] | fdsp | pointer to float DSP context |
[in] | mdct_ctx | pointer to MDCT transform context |
[in] | pIn | float input |
[out] | pOut | float output |
[in] | wind_id | which MDCT window to apply |
[in] | sb | subband number |
Definition at line 466 of file atrac3plusdsp.c.
Referenced by reconstruct_frame().
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.
[in] | dct_ctx | ptr to the pre-initialized IDCT context |
[in,out] | hist | ptr to the filter history |
[in] | in | input data to process |
[out] | out | receives processed data |
Definition at line 607 of file atrac3plusdsp.c.
Referenced by reconstruct_frame().
const uint16_t ff_atrac3p_qu_to_spec_pos[33] |
Map quant unit number to its position in the spectrum.
To get the number of spectral lines in each quant unit do the following: num_specs = qu_to_spec_pos[i+1] - qu_to_spec_pos[i]
Definition at line 44 of file atrac3plusdsp.c.
Referenced by decode_residual_spectrum(), decode_spectrum(), and ff_atrac3p_power_compensation().
const float ff_atrac3p_sf_tab[64] |
Definition at line 54 of file atrac3plusdsp.c.
Referenced by decode_residual_spectrum(), and ff_atrac3p_power_compensation().
const float ff_atrac3p_mant_tab[8] |
Definition at line 69 of file atrac3plusdsp.c.
Referenced by decode_residual_spectrum(), and ff_atrac3p_power_compensation().