FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
xvididct.c File Reference

Walken IDCT Alternative IDCT implementation for decoding compatibility. More...

#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)   (((c) * (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, int line_size, int16_t *block)
 
static void xvid_idct_add (uint8_t *dest, int 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

#define ROW_SHIFT   11

Definition at line 39 of file xvididct.c.

Referenced by idct_row().

#define COL_SHIFT   6

Definition at line 40 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

#define RND0   65536

Definition at line 43 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND1   3597

Definition at line 44 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND2   2260

Definition at line 45 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND3   1203

Definition at line 46 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND4   0

Definition at line 47 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND5   120

Definition at line 48 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND6   512

Definition at line 49 of file xvididct.c.

Referenced by ff_xvid_idct().

#define RND7   512

Definition at line 50 of file xvididct.c.

Referenced by ff_xvid_idct().

#define TAN1   0x32EC

Definition at line 140 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

#define TAN2   0x6A0A

Definition at line 141 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

#define TAN3   0xAB0E

Definition at line 142 of file xvididct.c.

Referenced by idct_col_4(), and idct_col_8().

#define SQRT2   0x5A82

Definition at line 143 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

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

Definition at line 145 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

#define BUTTERFLY (   a,
  b,
  tmp 
)
Value:
(tmp) = (a) + (b); \
(b) = (a) - (b); \
(a) = (tmp)
const char * b
Definition: vf_curves.c:109
static uint8_t tmp[8]
Definition: des.c:38

Definition at line 149 of file xvididct.c.

Referenced by idct_col_3(), idct_col_4(), and idct_col_8().

#define LOAD_BUTTERFLY (   m1,
  m2,
  a,
  b,
  tmp,
  s 
)
Value:
(m1) = (s)[(a)] + (s)[(b)]; \
(m2) = (s)[(a)] - (s)[(b)]
const char * s
Definition: avisynth_c.h:631
const char * b
Definition: vf_curves.c:109

Definition at line 154 of file xvididct.c.

Referenced by idct_col_8().

Function Documentation

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().

static void idct_col_8 ( short *const  in)
static

Definition at line 158 of file xvididct.c.

Referenced by ff_xvid_idct().

static void idct_col_4 ( short *const  in)
static

Definition at line 210 of file xvididct.c.

Referenced by ff_xvid_idct().

static void idct_col_3 ( short *const  in)
static

Definition at line 254 of file xvididct.c.

Referenced by 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().

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

Definition at line 321 of file xvididct.c.

Referenced by ff_xvid_idct_init().

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

Definition at line 327 of file xvididct.c.

Referenced by 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

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

Definition at line 52 of file xvididct.c.

Referenced by ff_xvid_idct().

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

Definition at line 53 of file xvididct.c.

Referenced by ff_xvid_idct().

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

Definition at line 54 of file xvididct.c.

Referenced by ff_xvid_idct().

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

Definition at line 55 of file xvididct.c.

Referenced by ff_xvid_idct().