#include "global.h"
#include "fixed.h"
#include "frame.h"
#include "synth.h"
#include "D.dat"
Go to the source code of this file.
Defines | |
#define | SHIFT(x) (x) |
FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance. | |
#define | MUL(x, y) mad_f_mul((x), (y)) |
#define | costab1 MAD_F(0x0ffb10f2) |
#define | costab2 MAD_F(0x0fec46d2) |
#define | costab3 MAD_F(0x0fd3aac0) |
#define | costab4 MAD_F(0x0fb14be8) |
#define | costab5 MAD_F(0x0f853f7e) |
#define | costab6 MAD_F(0x0f4fa0ab) |
#define | costab7 MAD_F(0x0f109082) |
#define | costab8 MAD_F(0x0ec835e8) |
#define | costab9 MAD_F(0x0e76bd7a) |
#define | costab10 MAD_F(0x0e1c5979) |
#define | costab11 MAD_F(0x0db941a3) |
#define | costab12 MAD_F(0x0d4db315) |
#define | costab13 MAD_F(0x0cd9f024) |
#define | costab14 MAD_F(0x0c5e4036) |
#define | costab15 MAD_F(0x0bdaef91) |
#define | costab16 MAD_F(0x0b504f33) |
#define | costab17 MAD_F(0x0abeb49a) |
#define | costab18 MAD_F(0x0a267993) |
#define | costab19 MAD_F(0x0987fbfe) |
#define | costab20 MAD_F(0x08e39d9d) |
#define | costab21 MAD_F(0x0839c3cd) |
#define | costab22 MAD_F(0x078ad74e) |
#define | costab23 MAD_F(0x06d74402) |
#define | costab24 MAD_F(0x061f78aa) |
#define | costab25 MAD_F(0x0563e69d) |
#define | costab26 MAD_F(0x04a5018c) |
#define | costab27 MAD_F(0x03e33f2f) |
#define | costab28 MAD_F(0x031f1708) |
#define | costab29 MAD_F(0x0259020e) |
#define | costab30 MAD_F(0x01917a6c) |
#define | costab31 MAD_F(0x00c8fb30) |
#define | ML0(hi, lo, x, y) MAD_F_ML0((hi), (lo), (x), (y)) |
third SSO shift and/or D[] optimization preshift | |
#define | MLA(hi, lo, x, y) MAD_F_MLA((hi), (lo), (x), (y)) |
#define | MLN(hi, lo) MAD_F_MLN((hi), (lo)) |
#define | MLZ(hi, lo) MAD_F_MLZ((hi), (lo)) |
#define | SHIFT(x) (x) |
FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance. | |
#define | MAD_F_SCALEBITS (MAD_F_FRACBITS - 12) |
#define | PRESHIFT(x) (MAD_F(x) >> 12) |
Functions | |
void | mad_synth_init (struct mad_synth *synth) |
Initializes synth struct. | |
void | mad_synth_mute (struct mad_synth *synth) |
Zeroes all polyphase filterbank values, resetting synthesis. | |
static void | dct32 (mad_fixed_t const in[32], unsigned int slot, mad_fixed_t lo[16][8], mad_fixed_t hi[16][8]) |
Performs fast in[32]->out[32] DCT. | |
static void | synth_full (struct mad_synth *synth, struct mad_frame const *frame, unsigned int nch, unsigned int ns) |
perform full frequency PCM synthesis. | |
static void | synth_half (struct mad_synth *synth, struct mad_frame const *frame, unsigned int nch, unsigned int ns) |
perform half frequency PCM synthesis. | |
void | mad_synth_frame (struct mad_synth *synth, struct mad_frame const *frame) |
perform PCM synthesis of frame subband samples. | |
Variables | |
static mad_fixed_t const | D [17][32] |
Definition in file synth.c.
#define costab1 MAD_F(0x0ffb10f2) |
Referenced by dct32().
#define costab10 MAD_F(0x0e1c5979) |
Referenced by dct32().
#define costab11 MAD_F(0x0db941a3) |
Referenced by dct32().
#define costab12 MAD_F(0x0d4db315) |
Referenced by dct32().
#define costab13 MAD_F(0x0cd9f024) |
Referenced by dct32().
#define costab14 MAD_F(0x0c5e4036) |
Referenced by dct32().
#define costab15 MAD_F(0x0bdaef91) |
Referenced by dct32().
#define costab16 MAD_F(0x0b504f33) |
Referenced by dct32().
#define costab17 MAD_F(0x0abeb49a) |
Referenced by dct32().
#define costab18 MAD_F(0x0a267993) |
Referenced by dct32().
#define costab19 MAD_F(0x0987fbfe) |
Referenced by dct32().
#define costab2 MAD_F(0x0fec46d2) |
Referenced by dct32().
#define costab20 MAD_F(0x08e39d9d) |
Referenced by dct32().
#define costab21 MAD_F(0x0839c3cd) |
Referenced by dct32().
#define costab22 MAD_F(0x078ad74e) |
Referenced by dct32().
#define costab23 MAD_F(0x06d74402) |
Referenced by dct32().
#define costab24 MAD_F(0x061f78aa) |
Referenced by dct32().
#define costab25 MAD_F(0x0563e69d) |
Referenced by dct32().
#define costab26 MAD_F(0x04a5018c) |
Referenced by dct32().
#define costab27 MAD_F(0x03e33f2f) |
Referenced by dct32().
#define costab28 MAD_F(0x031f1708) |
Referenced by dct32().
#define costab29 MAD_F(0x0259020e) |
Referenced by dct32().
#define costab3 MAD_F(0x0fd3aac0) |
Referenced by dct32().
#define costab30 MAD_F(0x01917a6c) |
Referenced by dct32().
#define costab31 MAD_F(0x00c8fb30) |
Referenced by dct32().
#define costab4 MAD_F(0x0fb14be8) |
Referenced by dct32().
#define costab5 MAD_F(0x0f853f7e) |
Referenced by dct32().
#define costab6 MAD_F(0x0f4fa0ab) |
Referenced by dct32().
#define costab7 MAD_F(0x0f109082) |
Referenced by dct32().
#define costab8 MAD_F(0x0ec835e8) |
Referenced by dct32().
#define costab9 MAD_F(0x0e76bd7a) |
Referenced by dct32().
#define ML0 | ( | hi, | |||
lo, | |||||
x, | |||||
y | ) | MAD_F_ML0((hi), (lo), (x), (y)) |
third SSO shift and/or D[] optimization preshift
Definition at line 536 of file synth.c.
Referenced by synth_full(), and synth_half().
#define MLA | ( | hi, | |||
lo, | |||||
x, | |||||
y | ) | MAD_F_MLA((hi), (lo), (x), (y)) |
#define MLN | ( | hi, | |||
lo | ) | MAD_F_MLN((hi), (lo)) |
#define MLZ | ( | hi, | |||
lo | ) | MAD_F_MLZ((hi), (lo)) |
static void dct32 | ( | mad_fixed_t const | in[32], | |
unsigned int | slot, | |||
mad_fixed_t | lo[16][8], | |||
mad_fixed_t | hi[16][8] | |||
) | [static] |
Performs fast in[32]->out[32] DCT.
costab[i] = cos(PI / (2 * 32) * i)
Definition at line 129 of file synth.c.
References costab1, costab10, costab11, costab12, costab13, costab14, costab15, costab16, costab17, costab18, costab19, costab2, costab20, costab21, costab22, costab23, costab24, costab25, costab26, costab27, costab28, costab29, costab3, costab30, costab31, costab4, costab5, costab6, costab7, costab8, costab9, MUL, and SHIFT.
Referenced by synth_full(), and synth_half().
perform PCM synthesis of frame subband samples.
Definition at line 835 of file synth.c.
References mad_pcm::channels, mad_frame::header, mad_pcm::length, MAD_NCHANNELS, MAD_NSBSAMPLES, MAD_OPTION_HALFSAMPLERATE, mad_frame::options, mad_synth::pcm, mad_synth::phase, mad_header::samplerate, mad_pcm::samplerate, synth_full(), and synth_half().
Referenced by run_sync().
void mad_synth_init | ( | struct mad_synth * | synth | ) |
Initializes synth struct.
Definition at line 38 of file synth.c.
References mad_pcm::channels, mad_pcm::length, mad_synth_mute(), mad_synth::pcm, mad_synth::phase, and mad_pcm::samplerate.
Referenced by run_sync().
void mad_synth_mute | ( | struct mad_synth * | synth | ) |
Zeroes all polyphase filterbank values, resetting synthesis.
Definition at line 52 of file synth.c.
References mad_synth::filter, and s.
Referenced by mad_synth_init().
static void synth_full | ( | struct mad_synth * | synth, | |
struct mad_frame const * | frame, | |||
unsigned int | nch, | |||
unsigned int | ns | |||
) | [static] |
perform full frequency PCM synthesis.
Definition at line 563 of file synth.c.
References D, dct32(), mad_synth::filter, ML0, MLA, MLN, MLZ, mad_synth::pcm, mad_synth::phase, s, mad_pcm::samples, mad_frame::sbsample, and SHIFT.
Referenced by mad_synth_frame().
static void synth_half | ( | struct mad_synth * | synth, | |
struct mad_frame const * | frame, | |||
unsigned int | nch, | |||
unsigned int | ns | |||
) | [static] |
perform half frequency PCM synthesis.
Definition at line 699 of file synth.c.
References D, dct32(), mad_synth::filter, ML0, MLA, MLN, MLZ, mad_synth::pcm, mad_synth::phase, s, mad_pcm::samples, mad_frame::sbsample, and SHIFT.
Referenced by mad_synth_frame().
mad_fixed_t const D[17][32] [static] |