FFmpeg
Macros | Functions
dct32_template.c File Reference
#include "dct32.h"
#include "mathops.h"
#include "libavutil/internal.h"

Go to the source code of this file.

Macros

#define SUINT   unsigned
 
#define SUINT32   uint32_t
 
#define dct32   ff_dct32_fixed
 
#define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
 
#define MULH3(x, y, s)   MULH((s)*(x), y)
 
#define INTFLOAT   int
 
#define SUINTFLOAT   SUINT
 
#define COS0_0   FIXHR(0.50060299823519630134/2)
 
#define COS0_1   FIXHR(0.50547095989754365998/2)
 
#define COS0_2   FIXHR(0.51544730992262454697/2)
 
#define COS0_3   FIXHR(0.53104259108978417447/2)
 
#define COS0_4   FIXHR(0.55310389603444452782/2)
 
#define COS0_5   FIXHR(0.58293496820613387367/2)
 
#define COS0_6   FIXHR(0.62250412303566481615/2)
 
#define COS0_7   FIXHR(0.67480834145500574602/2)
 
#define COS0_8   FIXHR(0.74453627100229844977/2)
 
#define COS0_9   FIXHR(0.83934964541552703873/2)
 
#define COS0_10   FIXHR(0.97256823786196069369/2)
 
#define COS0_11   FIXHR(1.16943993343288495515/4)
 
#define COS0_12   FIXHR(1.48416461631416627724/4)
 
#define COS0_13   FIXHR(2.05778100995341155085/8)
 
#define COS0_14   FIXHR(3.40760841846871878570/8)
 
#define COS0_15   FIXHR(10.19000812354805681150/32)
 
#define COS1_0   FIXHR(0.50241928618815570551/2)
 
#define COS1_1   FIXHR(0.52249861493968888062/2)
 
#define COS1_2   FIXHR(0.56694403481635770368/2)
 
#define COS1_3   FIXHR(0.64682178335999012954/2)
 
#define COS1_4   FIXHR(0.78815462345125022473/2)
 
#define COS1_5   FIXHR(1.06067768599034747134/4)
 
#define COS1_6   FIXHR(1.72244709823833392782/4)
 
#define COS1_7   FIXHR(5.10114861868916385802/16)
 
#define COS2_0   FIXHR(0.50979557910415916894/2)
 
#define COS2_1   FIXHR(0.60134488693504528054/2)
 
#define COS2_2   FIXHR(0.89997622313641570463/2)
 
#define COS2_3   FIXHR(2.56291544774150617881/8)
 
#define COS3_0   FIXHR(0.54119610014619698439/2)
 
#define COS3_1   FIXHR(1.30656296487637652785/4)
 
#define COS4_0   FIXHR(M_SQRT1_2/2)
 
#define BF(a, b, c, s)
 
#define BF0(a, b, c, s)
 
#define BF1(a, b, c, d)
 
#define BF2(a, b, c, d)
 
#define ADD(a, b)   val##a += val##b
 

Functions

void dct32 (INTFLOAT *out, const INTFLOAT *tab_arg)
 

Macro Definition Documentation

◆ SUINT

#define SUINT   unsigned

Definition at line 30 of file dct32_template.c.

◆ SUINT32

#define SUINT32   uint32_t

Definition at line 31 of file dct32_template.c.

◆ dct32

#define dct32   ff_dct32_fixed

Definition at line 41 of file dct32_template.c.

◆ FIXHR

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

Definition at line 42 of file dct32_template.c.

◆ MULH3

#define MULH3 (   x,
  y,
  s 
)    MULH((s)*(x), y)

Definition at line 43 of file dct32_template.c.

◆ INTFLOAT

#define INTFLOAT   int

Definition at line 44 of file dct32_template.c.

◆ SUINTFLOAT

#define SUINTFLOAT   SUINT

Definition at line 45 of file dct32_template.c.

◆ COS0_0

#define COS0_0   FIXHR(0.50060299823519630134/2)

Definition at line 53 of file dct32_template.c.

◆ COS0_1

#define COS0_1   FIXHR(0.50547095989754365998/2)

Definition at line 54 of file dct32_template.c.

◆ COS0_2

#define COS0_2   FIXHR(0.51544730992262454697/2)

Definition at line 55 of file dct32_template.c.

◆ COS0_3

#define COS0_3   FIXHR(0.53104259108978417447/2)

Definition at line 56 of file dct32_template.c.

◆ COS0_4

#define COS0_4   FIXHR(0.55310389603444452782/2)

Definition at line 57 of file dct32_template.c.

◆ COS0_5

#define COS0_5   FIXHR(0.58293496820613387367/2)

Definition at line 58 of file dct32_template.c.

◆ COS0_6

#define COS0_6   FIXHR(0.62250412303566481615/2)

Definition at line 59 of file dct32_template.c.

◆ COS0_7

#define COS0_7   FIXHR(0.67480834145500574602/2)

Definition at line 60 of file dct32_template.c.

◆ COS0_8

#define COS0_8   FIXHR(0.74453627100229844977/2)

Definition at line 61 of file dct32_template.c.

◆ COS0_9

#define COS0_9   FIXHR(0.83934964541552703873/2)

Definition at line 62 of file dct32_template.c.

◆ COS0_10

#define COS0_10   FIXHR(0.97256823786196069369/2)

Definition at line 63 of file dct32_template.c.

◆ COS0_11

#define COS0_11   FIXHR(1.16943993343288495515/4)

Definition at line 64 of file dct32_template.c.

◆ COS0_12

#define COS0_12   FIXHR(1.48416461631416627724/4)

Definition at line 65 of file dct32_template.c.

◆ COS0_13

#define COS0_13   FIXHR(2.05778100995341155085/8)

Definition at line 66 of file dct32_template.c.

◆ COS0_14

#define COS0_14   FIXHR(3.40760841846871878570/8)

Definition at line 67 of file dct32_template.c.

◆ COS0_15

#define COS0_15   FIXHR(10.19000812354805681150/32)

Definition at line 68 of file dct32_template.c.

◆ COS1_0

#define COS1_0   FIXHR(0.50241928618815570551/2)

Definition at line 70 of file dct32_template.c.

◆ COS1_1

#define COS1_1   FIXHR(0.52249861493968888062/2)

Definition at line 71 of file dct32_template.c.

◆ COS1_2

#define COS1_2   FIXHR(0.56694403481635770368/2)

Definition at line 72 of file dct32_template.c.

◆ COS1_3

#define COS1_3   FIXHR(0.64682178335999012954/2)

Definition at line 73 of file dct32_template.c.

◆ COS1_4

#define COS1_4   FIXHR(0.78815462345125022473/2)

Definition at line 74 of file dct32_template.c.

◆ COS1_5

#define COS1_5   FIXHR(1.06067768599034747134/4)

Definition at line 75 of file dct32_template.c.

◆ COS1_6

#define COS1_6   FIXHR(1.72244709823833392782/4)

Definition at line 76 of file dct32_template.c.

◆ COS1_7

#define COS1_7   FIXHR(5.10114861868916385802/16)

Definition at line 77 of file dct32_template.c.

◆ COS2_0

#define COS2_0   FIXHR(0.50979557910415916894/2)

Definition at line 79 of file dct32_template.c.

◆ COS2_1

#define COS2_1   FIXHR(0.60134488693504528054/2)

Definition at line 80 of file dct32_template.c.

◆ COS2_2

#define COS2_2   FIXHR(0.89997622313641570463/2)

Definition at line 81 of file dct32_template.c.

◆ COS2_3

#define COS2_3   FIXHR(2.56291544774150617881/8)

Definition at line 82 of file dct32_template.c.

◆ COS3_0

#define COS3_0   FIXHR(0.54119610014619698439/2)

Definition at line 84 of file dct32_template.c.

◆ COS3_1

#define COS3_1   FIXHR(1.30656296487637652785/4)

Definition at line 85 of file dct32_template.c.

◆ COS4_0

#define COS4_0   FIXHR(M_SQRT1_2/2)

Definition at line 87 of file dct32_template.c.

◆ BF

#define BF (   a,
  b,
  c,
  s 
)
Value:
{\
tmp0 = val##a + val##b;\
tmp1 = val##a - val##b;\
val##a = tmp0;\
val##b = MULH3(tmp1, c, 1<<(s));\
}

Definition at line 90 of file dct32_template.c.

◆ BF0

#define BF0 (   a,
  b,
  c,
  s 
)
Value:
{\
tmp0 = tab[a] + tab[b];\
tmp1 = tab[a] - tab[b];\
val##a = tmp0;\
val##b = MULH3(tmp1, c, 1<<(s));\
}

Definition at line 98 of file dct32_template.c.

◆ BF1

#define BF1 (   a,
  b,
  c,
  d 
)
Value:
{\
BF(a, b, COS4_0, 1);\
BF(c, d,-COS4_0, 1);\
val##c += val##d;\
}

Definition at line 106 of file dct32_template.c.

◆ BF2

#define BF2 (   a,
  b,
  c,
  d 
)
Value:
{\
BF(a, b, COS4_0, 1);\
BF(c, d,-COS4_0, 1);\
val##c += val##d;\
val##a += val##c;\
val##c += val##b;\
val##b += val##d;\
}

Definition at line 113 of file dct32_template.c.

◆ ADD

#define ADD (   a,
  b 
)    val##a += val##b

Definition at line 123 of file dct32_template.c.

Function Documentation

◆ dct32()

void dct32 ( INTFLOAT out,
const INTFLOAT tab_arg 
)

Definition at line 126 of file dct32_template.c.

Referenced by ff_mpa_synth_filter_TMPL().

b
#define b
Definition: input.c:41
MULH3
#define MULH3(x, y, s)
Definition: dct32_template.c:43
tab
static const struct twinvq_data tab
Definition: twinvq_data.h:10345
val
static double val(void *priv, double ch)
Definition: aeval.c:76
s
#define s(width, name)
Definition: cbs_vp9.c:257
COS4_0
#define COS4_0
Definition: dct32_template.c:87
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
d
d
Definition: ffmpeg_filter.c:156