FFmpeg
Loading...
Searching...
No Matches
mpegaudiodsp_template.c File Reference
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "dct32.h"
#include "mathops.h"
#include "mpegaudiodsp.h"
#include "mpegaudio.h"

Go to the source code of this file.

Macros

#define RENAME(n)
 
#define OUT_SHIFT   (WFRAC_BITS + FRAC_BITS - 15)
 
#define MULS(ra, rb)
 
#define MACS(rt, ra, rb)
 
#define MLSS(rt, ra, rb)
 
#define MULH3(x, y, s)
 
#define MULLx(x, y, s)
 
#define SHR(a, b)
 
#define FIXR(a)
 
#define FIXHR(a)
 
#define SUM8(op, sum, w, p)
 
#define SUM8P2(sum1, op1, sum2, op2, w1, w2, p)
 
#define C1   FIXHR(0.98480775301220805936/2)
 
#define C2   FIXHR(0.93969262078590838405/2)
 
#define C3   FIXHR(0.86602540378443864676/2)
 
#define C4   FIXHR(0.76604444311897803520/2)
 
#define C5   FIXHR(0.64278760968653932632/2)
 
#define C6   FIXHR(0.5/2)
 
#define C7   FIXHR(0.34202014332566873304/2)
 
#define C8   FIXHR(0.17364817766693034885/2)
 

Functions

static int round_sample (int64_t *sum)
 
void ff_mpadsp_apply_window_TMPL (MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, ptrdiff_t incr)
 
void ff_mpa_synth_filter_TMPL (MPADSPContext *s, MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, ptrdiff_t incr, MPA_INT *sb_samples)
 
static av_cold void mpa_synth_init (MPA_INT *window)
 
static av_cold void mpa_synth_window_init (void)
 
av_cold void ff_mpa_synth_init_TMPL (void)
 
static void imdct36 (INTFLOAT *out, INTFLOAT *buf, SUINTFLOAT *in, INTFLOAT *win)
 
void ff_imdct36_blocks_TMPL (INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, int count, int switch_point, int block_type)
 

Variables

INTFLOAT ff_mdct_win_TMPL [8][MDCT_BUF_SIZE]
 Window for MDCT.
 
MPA_INT ff_mpa_synth_window_TMPL [512+256]
 
static const INTFLOAT icos36 [9]
 
static const INTFLOAT icos36h [9]
 

Macro Definition Documentation

◆ RENAME

#define RENAME ( n)
Value:
n##_fixed

Definition at line 53 of file mpegaudiodsp_template.c.

Referenced by ff_imdct36_blocks_TMPL(), and mpa_synth_window_init().

◆ OUT_SHIFT

#define OUT_SHIFT   (WFRAC_BITS + FRAC_BITS - 15)

Definition at line 54 of file mpegaudiodsp_template.c.

◆ MULS

#define MULS ( ra,
rb )
Value:
MUL64(ra, rb)
#define MUL64(a, b)
Definition mathops.h:56

Definition at line 64 of file mpegaudiodsp_template.c.

◆ MACS

#define MACS ( rt,
ra,
rb )
Value:
MAC64(rt, ra, rb)
#define MAC64(d, a, b)
Definition mathops.h:76

Definition at line 65 of file mpegaudiodsp_template.c.

Referenced by ff_mpadsp_apply_window_TMPL().

◆ MLSS

#define MLSS ( rt,
ra,
rb )
Value:
MLS64(rt, ra, rb)
#define MLS64(d, a, b)
Definition mathops.h:80

Definition at line 66 of file mpegaudiodsp_template.c.

Referenced by ff_mpadsp_apply_window_TMPL().

◆ MULH3

#define MULH3 ( x,
y,
s )
Value:
MULH((s)*(x), y)
#define s(width, name)
Definition cbs_vp9.c:198
#define MULH
Definition mathops.h:42

Definition at line 67 of file mpegaudiodsp_template.c.

Referenced by imdct36().

◆ MULLx

#define MULLx ( x,
y,
s )
Value:
MULL((int)(x),(y),s)
#define MULL(a, b, s)
Definition mathops.h:60

Definition at line 68 of file mpegaudiodsp_template.c.

Referenced by imdct36().

◆ SHR

#define SHR ( a,
b )
Value:
(((int)(a))>>(b))
int a
#define b
Definition input.c:43

Definition at line 69 of file mpegaudiodsp_template.c.

Referenced by imdct36().

◆ FIXR

#define FIXR ( a)
Value:
((int)((a) * FRAC_ONE + 0.5))
#define FRAC_ONE
Definition mpegaudio.h:58

Definition at line 70 of file mpegaudiodsp_template.c.

◆ FIXHR

#define FIXHR ( a)
Value:
((int)((a) * (1LL<<32) + 0.5))

Definition at line 71 of file mpegaudiodsp_template.c.

◆ SUM8

#define SUM8 ( op,
sum,
w,
p )
Value:
{ \
op(sum, (w)[0 * 64], (p)[0 * 64]); \
op(sum, (w)[1 * 64], (p)[1 * 64]); \
op(sum, (w)[2 * 64], (p)[2 * 64]); \
op(sum, (w)[3 * 64], (p)[3 * 64]); \
op(sum, (w)[4 * 64], (p)[4 * 64]); \
op(sum, (w)[5 * 64], (p)[5 * 64]); \
op(sum, (w)[6 * 64], (p)[6 * 64]); \
op(sum, (w)[7 * 64], (p)[7 * 64]); \
}
uint8_t w
Definition llvidencdsp.c:39

Definition at line 82 of file mpegaudiodsp_template.c.

Referenced by ff_mpadsp_apply_window_TMPL().

◆ SUM8P2

#define SUM8P2 ( sum1,
op1,
sum2,
op2,
w1,
w2,
p )
Value:
{ \
tmp = p[0 * 64];\
op1(sum1, (w1)[0 * 64], tmp);\
op2(sum2, (w2)[0 * 64], tmp);\
tmp = p[1 * 64];\
op1(sum1, (w1)[1 * 64], tmp);\
op2(sum2, (w2)[1 * 64], tmp);\
tmp = p[2 * 64];\
op1(sum1, (w1)[2 * 64], tmp);\
op2(sum2, (w2)[2 * 64], tmp);\
tmp = p[3 * 64];\
op1(sum1, (w1)[3 * 64], tmp);\
op2(sum2, (w2)[3 * 64], tmp);\
tmp = p[4 * 64];\
op1(sum1, (w1)[4 * 64], tmp);\
op2(sum2, (w2)[4 * 64], tmp);\
tmp = p[5 * 64];\
op1(sum1, (w1)[5 * 64], tmp);\
op2(sum2, (w2)[5 * 64], tmp);\
tmp = p[6 * 64];\
op1(sum1, (w1)[6 * 64], tmp);\
op2(sum2, (w2)[6 * 64], tmp);\
tmp = p[7 * 64];\
op1(sum1, (w1)[7 * 64], tmp);\
op2(sum2, (w2)[7 * 64], tmp);\
}
#define INTFLOAT
static uint8_t tmp[40]
Definition aes_ctr.c:52

Definition at line 94 of file mpegaudiodsp_template.c.

Referenced by ff_mpadsp_apply_window_TMPL().

◆ C1

#define C1   FIXHR(0.98480775301220805936/2)

◆ C2

#define C2   FIXHR(0.93969262078590838405/2)

◆ C3

#define C3   FIXHR(0.86602540378443864676/2)

Definition at line 240 of file mpegaudiodsp_template.c.

◆ C4

#define C4   FIXHR(0.76604444311897803520/2)

Definition at line 241 of file mpegaudiodsp_template.c.

◆ C5

#define C5   FIXHR(0.64278760968653932632/2)

Definition at line 242 of file mpegaudiodsp_template.c.

◆ C6

#define C6   FIXHR(0.5/2)

Definition at line 243 of file mpegaudiodsp_template.c.

◆ C7

#define C7   FIXHR(0.34202014332566873304/2)

Definition at line 244 of file mpegaudiodsp_template.c.

Referenced by imdct36().

◆ C8

#define C8   FIXHR(0.17364817766693034885/2)

Definition at line 245 of file mpegaudiodsp_template.c.

Referenced by imdct36().

Function Documentation

◆ round_sample()

static int round_sample ( int64_t * sum)
inlinestatic

Definition at line 56 of file mpegaudiodsp_template.c.

Referenced by ff_mpadsp_apply_window_TMPL().

◆ ff_mpadsp_apply_window_TMPL()

void ff_mpadsp_apply_window_TMPL ( MPA_INT * synth_buf,
MPA_INT * window,
int * dither_state,
OUT_INT * samples,
ptrdiff_t incr )

Definition at line 123 of file mpegaudiodsp_template.c.

◆ ff_mpa_synth_filter_TMPL()

void ff_mpa_synth_filter_TMPL ( MPADSPContext * s,
MPA_INT * synth_buf_ptr,
int * synth_buf_offset,
MPA_INT * window,
int * dither_state,
OUT_INT * samples,
ptrdiff_t incr,
MPA_INT * sb_samples )

Definition at line 178 of file mpegaudiodsp_template.c.

◆ mpa_synth_init()

static av_cold void mpa_synth_init ( MPA_INT * window)
static

Definition at line 197 of file mpegaudiodsp_template.c.

Referenced by mpa_synth_window_init().

◆ mpa_synth_window_init()

static av_cold void mpa_synth_window_init ( void )
static

Definition at line 226 of file mpegaudiodsp_template.c.

Referenced by ff_mpa_synth_init_TMPL().

◆ ff_mpa_synth_init_TMPL()

av_cold void ff_mpa_synth_init_TMPL ( void )

Definition at line 231 of file mpegaudiodsp_template.c.

◆ imdct36()

static void imdct36 ( INTFLOAT * out,
INTFLOAT * buf,
SUINTFLOAT * in,
INTFLOAT * win )
static

Definition at line 274 of file mpegaudiodsp_template.c.

Referenced by ff_imdct36_blocks_TMPL().

◆ ff_imdct36_blocks_TMPL()

void ff_imdct36_blocks_TMPL ( INTFLOAT * out,
INTFLOAT * buf,
INTFLOAT * in,
int count,
int switch_point,
int block_type )

Definition at line 354 of file mpegaudiodsp_template.c.

Variable Documentation

◆ ff_mdct_win_TMPL

INTFLOAT ff_mdct_win_TMPL[8][MDCT_BUF_SIZE]

Window for MDCT.

Actually only the elements in [0,17] and [MDCT_BUF_SIZE/2, MDCT_BUF_SIZE/2 + 17] are actually used. The rest is just to preserve alignment for SIMD implementations.

Definition at line 78 of file mpegaudiodsp_template.c.

◆ ff_mpa_synth_window_TMPL

MPA_INT ff_mpa_synth_window_TMPL[512+256]

Definition at line 80 of file mpegaudiodsp_template.c.

◆ icos36

const INTFLOAT icos36[9]
static
Initial value:
= {
FIXR(0.50190991877167369479),
FIXR(0.51763809020504152469),
FIXR(0.55168895948124587824),
FIXR(0.61038729438072803416),
FIXR(0.70710678118654752439),
FIXR(0.87172339781054900991),
FIXR(1.18310079157624925896),
FIXR(1.93185165257813657349),
FIXR(5.73685662283492756461),
}
#define FIXR(x)

Definition at line 248 of file mpegaudiodsp_template.c.

Referenced by imdct36().

◆ icos36h

const INTFLOAT icos36h[9]
static
Initial value:
= {
FIXHR(0.50190991877167369479/2),
FIXHR(0.51763809020504152469/2),
FIXHR(0.55168895948124587824/2),
FIXHR(0.61038729438072803416/2),
FIXHR(0.70710678118654752439/2),
FIXHR(0.87172339781054900991/2),
FIXHR(1.18310079157624925896/4),
FIXHR(1.93185165257813657349/4),
}
#define FIXHR(a)

Definition at line 261 of file mpegaudiodsp_template.c.

Referenced by imdct36().