paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Macros | Typedefs | Functions
imdct.c File Reference

Inverse modified discrete cosine transform. More...

#include <math.h>
#include <regex.h>
#include "para.h"
#include "error.h"
#include "string.h"
#include "imdct.h"
#include "wma.h"

Macros

#define BF(x, y, a, b)
 
#define BUTTERFLIES(a0, a1, a2, a3)
 
#define BUTTERFLIES_BIG(a0, a1, a2, a3)
 
#define TRANSFORM(a0, a1, a2, a3, wre, wim)
 
#define TRANSFORM_ZERO(a0, a1, a2, a3)
 
#define BUTTERFLIES   BUTTERFLIES_BIG
 
#define DECL_FFT(n, n2, n4)
 
#define CMUL(pre, pim, are, aim, bre, bim)
 

Typedefs

typedef float fftsample_t
 

Functions

void imdct (struct mdct_context *ctx, float *output, const float *input)
 Compute the inverse MDCT. More...
 
int imdct_init (int nbits, struct mdct_context **result)
 Initialize the inverse modified cosine transform. More...
 
void imdct_end (struct mdct_context *ctx)
 Deallocate imdct resources. More...
 

Detailed Description

Inverse modified discrete cosine transform.

Macro Definition Documentation

◆ BF

#define BF (   x,
  y,
  a,
 
)
Value:
{\
x = a - b;\
y = a + b;\
}

◆ BUTTERFLIES [1/2]

#define BUTTERFLIES (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
BF(t3, t5, t5, t1);\
BF(a2.re, a0.re, a0.re, t5);\
BF(a3.im, a1.im, a1.im, t3);\
BF(t4, t6, t2, t6);\
BF(a3.re, a1.re, a1.re, t4);\
BF(a2.im, a0.im, a0.im, t6);\
}

◆ BUTTERFLIES_BIG

#define BUTTERFLIES_BIG (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
fftsample_t r0 = a0.re, i0 = a0.im, r1 = a1.re, i1 = a1.im;\
BF(t3, t5, t5, t1);\
BF(a2.re, a0.re, r0, t5);\
BF(a3.im, a1.im, i1, t3);\
BF(t4, t6, t2, t6);\
BF(a3.re, a1.re, r1, t4);\
BF(a2.im, a0.im, i0, t6);\
}

◆ TRANSFORM

#define TRANSFORM (   a0,
  a1,
  a2,
  a3,
  wre,
  wim 
)
Value:
{\
t1 = a2.re * wre + a2.im * wim;\
t2 = a2.im * wre - a2.re * wim;\
t5 = a3.re * wre - a3.im * wim;\
t6 = a3.im * wre + a3.re * wim;\
BUTTERFLIES(a0, a1, a2, a3)\
}

◆ TRANSFORM_ZERO

#define TRANSFORM_ZERO (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
t1 = a2.re;\
t2 = a2.im;\
t5 = a3.re;\
t6 = a3.im;\
BUTTERFLIES(a0, a1, a2, a3)\
}

◆ BUTTERFLIES [2/2]

#define BUTTERFLIES   BUTTERFLIES_BIG

◆ DECL_FFT

#define DECL_FFT (   n,
  n2,
  n4 
)
Value:
static void fft##n(struct fft_complex *z)\
{\
fft ## n2(z);\
fft ## n4(z + n4 * 2);\
fft ## n4(z + n4 * 3);\
pass(z, cos_ ## n, n4 / 2);\
}

◆ CMUL

#define CMUL (   pre,
  pim,
  are,
  aim,
  bre,
  bim 
)
Value:
{\
fftsample_t _are = (are);\
fftsample_t _aim = (aim);\
fftsample_t _bre = (bre);\
fftsample_t _bim = (bim);\
(pre) = _are * _bre - _aim * _bim;\
(pim) = _are * _bim + _aim * _bre;\
}

Typedef Documentation

◆ fftsample_t

typedef float fftsample_t

Function Documentation

◆ imdct()

void imdct ( struct mdct_context *  ctx,
float *  output,
const float *  input 
)

Compute the inverse MDCT.

Parameters
ctxThe initialized context structure.
outputN samples.
inputN/2 samples.
See also
imdct_init().

◆ imdct_init()

int imdct_init ( int  nbits,
struct mdct_context **  result 
)

Initialize the inverse modified cosine transform.

Parameters
nbitsThe number of bits to use (4 <= nbits <= 18).
resultOpaque structure that must be passed to imdct().
Returns
Standard.

References arr_alloc(), and zalloc().

◆ imdct_end()

void imdct_end ( struct mdct_context *  ctx)

Deallocate imdct resources.

Parameters
ctxThe pointer obtained by imdct_init().