FFmpeg
Macros | Functions | Variables
xvididct.c File Reference
#include "config.h"
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "idctdsp.h"
#include "xvididct.h"

Go to the source code of this file.

Macros

#define ROW_SHIFT   11
 
#define COL_SHIFT   6
 
#define RND0   65536
 
#define RND1   3597
 
#define RND2   2260
 
#define RND3   1203
 
#define RND4   0
 
#define RND5   120
 
#define RND6   512
 
#define RND7   512
 
#define TAN1   0x32EC
 
#define TAN2   0x6A0A
 
#define TAN3   0xAB0E
 
#define SQRT2   0x5A82
 
#define MULT(c, x, n)   ((unsigned)((int)((c) * (unsigned)(x)) >> (n)))
 
#define BUTTERFLY(a, b, tmp)
 
#define LOAD_BUTTERFLY(m1, m2, a, b, tmp, s)
 

Functions

static int idct_row (short *in, const int *const tab, int rnd)
 
static void idct_col_8 (short *const in)
 
static void idct_col_4 (short *const in)
 
static void idct_col_3 (short *const in)
 
void ff_xvid_idct (int16_t *const in)
 
static void xvid_idct_put (uint8_t *dest, ptrdiff_t line_size, int16_t *block)
 
static void xvid_idct_add (uint8_t *dest, ptrdiff_t line_size, int16_t *block)
 
av_cold void ff_xvid_idct_init (IDCTDSPContext *c, AVCodecContext *avctx)
 

Variables

static const int TAB04 [] = { 22725, 21407, 19266, 16384, 12873, 8867, 4520 }
 
static const int TAB17 [] = { 31521, 29692, 26722, 22725, 17855, 12299, 6270 }
 
static const int TAB26 [] = { 29692, 27969, 25172, 21407, 16819, 11585, 5906 }
 
static const int TAB35 [] = { 26722, 25172, 22654, 19266, 15137, 10426, 5315 }
 

Detailed Description

Walken IDCT Alternative IDCT implementation for decoding compatibility.

Author
Skal
Note
This C version is not the original IDCT, but a modified one that yields the same error profile as the MMX/MMXEXT/SSE2 versions.

Definition in file xvididct.c.

Macro Definition Documentation

◆ ROW_SHIFT

#define ROW_SHIFT   11

Definition at line 39 of file xvididct.c.

◆ COL_SHIFT

#define COL_SHIFT   6

Definition at line 40 of file xvididct.c.

◆ RND0

#define RND0   65536

Definition at line 43 of file xvididct.c.

◆ RND1

#define RND1   3597

Definition at line 44 of file xvididct.c.

◆ RND2

#define RND2   2260

Definition at line 45 of file xvididct.c.

◆ RND3

#define RND3   1203

Definition at line 46 of file xvididct.c.

◆ RND4

#define RND4   0

Definition at line 47 of file xvididct.c.

◆ RND5

#define RND5   120

Definition at line 48 of file xvididct.c.

◆ RND6

#define RND6   512

Definition at line 49 of file xvididct.c.

◆ RND7

#define RND7   512

Definition at line 50 of file xvididct.c.

◆ TAN1

#define TAN1   0x32EC

Definition at line 140 of file xvididct.c.

◆ TAN2

#define TAN2   0x6A0A

Definition at line 141 of file xvididct.c.

◆ TAN3

#define TAN3   0xAB0E

Definition at line 142 of file xvididct.c.

◆ SQRT2

#define SQRT2   0x5A82

Definition at line 143 of file xvididct.c.

◆ MULT

#define MULT (   c,
  x,
  n 
)    ((unsigned)((int)((c) * (unsigned)(x)) >> (n)))

Definition at line 145 of file xvididct.c.

◆ BUTTERFLY

#define BUTTERFLY (   a,
  b,
  tmp 
)
Value:
(tmp) = (a) + (b); \
(b) = (a) - (b); \
(a) = (tmp)

Definition at line 149 of file xvididct.c.

◆ LOAD_BUTTERFLY

#define LOAD_BUTTERFLY (   m1,
  m2,
  a,
  b,
  tmp,
  s 
)
Value:
(m1) = (s)[(a)] + (s)[(b)]; \
(m2) = (s)[(a)] - (s)[(b)]

Definition at line 154 of file xvididct.c.

Function Documentation

◆ idct_row()

static int idct_row ( short in,
const int *const  tab,
int  rnd 
)
static

Definition at line 57 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ idct_col_8()

static void idct_col_8 ( short *const  in)
static

Definition at line 158 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ idct_col_4()

static void idct_col_4 ( short *const  in)
static

Definition at line 210 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ idct_col_3()

static void idct_col_3 ( short *const  in)
static

Definition at line 254 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ ff_xvid_idct()

void ff_xvid_idct ( int16_t *const  in)

Definition at line 291 of file xvididct.c.

Referenced by ff_xvid_idct_init(), xvid_idct_add(), and xvid_idct_put().

◆ xvid_idct_put()

static void xvid_idct_put ( uint8_t dest,
ptrdiff_t  line_size,
int16_t *  block 
)
static

Definition at line 321 of file xvididct.c.

Referenced by ff_xvid_idct_init().

◆ xvid_idct_add()

static void xvid_idct_add ( uint8_t dest,
ptrdiff_t  line_size,
int16_t *  block 
)
static

Definition at line 327 of file xvididct.c.

Referenced by ff_xvid_idct_init().

◆ ff_xvid_idct_init()

av_cold void ff_xvid_idct_init ( IDCTDSPContext c,
AVCodecContext avctx 
)

Definition at line 333 of file xvididct.c.

Referenced by ff_idctdsp_init().

Variable Documentation

◆ TAB04

const int TAB04[] = { 22725, 21407, 19266, 16384, 12873, 8867, 4520 }
static

Definition at line 52 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ TAB17

const int TAB17[] = { 31521, 29692, 26722, 22725, 17855, 12299, 6270 }
static

Definition at line 53 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ TAB26

const int TAB26[] = { 29692, 27969, 25172, 21407, 16819, 11585, 5906 }
static

Definition at line 54 of file xvididct.c.

Referenced by ff_xvid_idct().

◆ TAB35

const int TAB35[] = { 26722, 25172, 22654, 19266, 15137, 10426, 5315 }
static

Definition at line 55 of file xvididct.c.

Referenced by ff_xvid_idct().

tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:26
b
#define b
Definition: input.c:41
s
#define s(width, name)
Definition: cbs_vp9.c:257
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