|
FFmpeg
|
DSP functions for ATRAC3+ decoder. More...
#include <math.h>#include "libavutil/float_dsp.h"#include "libavutil/libm.h"#include "avcodec.h"#include "sinewin.h"#include "fft.h"#include "atrac3plus.h"Macros | |
| #define | ATRAC3P_MDCT_SIZE (ATRAC3P_SUBBAND_SAMPLES * 2) |
| #define | TWOPI (2 * M_PI) |
| #define | DEQUANT_PHASE(ph) (((ph) & 0x1F) << 6) |
Functions | |
| av_cold void | ff_atrac3p_init_imdct (AVCodecContext *avctx, FFTContext *mdct_ctx) |
| Initialize IMDCT transform. More... | |
| av_cold void | ff_atrac3p_init_wave_synth (void) |
| Initialize sine waves synthesizer. | |
| 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) |
| 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] |
DSP functions for ATRAC3+ decoder.
| 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 |
| 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 |
| av_cold 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 |
| 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 |
| 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 |
| const float ff_atrac3p_mant_tab[8] |
| 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]
| const float ff_atrac3p_sf_tab[64] |
1.8.12