FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
h264dsp.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/h264dsp.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Macros

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)
 
#define SIZEOF_COEF   (2 * ((bit_depth + 7) / 8))
 
#define PIXEL_STRIDE   16
 
#define randomize_buffers()
 
#define dct4x4_impl(size, dctcoef)
 
#define DCT8_1D(src, srcstride, dst, dststride)
 
#define dct8x8_impl(size, dctcoef)
 

Functions

 dct4x4_impl (16, int16_t)
 
static void dct8x8 (int16_t *coef, int bit_depth)
 
static void check_idct (void)
 
void checkasm_check_h264dsp (void)
 

Variables

static const uint32_t pixel_mask [3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff }
 

Macro Definition Documentation

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)

Definition at line 31 of file h264dsp.c.

Referenced by check_idct().

#define SIZEOF_COEF   (2 * ((bit_depth + 7) / 8))

Definition at line 32 of file h264dsp.c.

Referenced by check_idct().

#define PIXEL_STRIDE   16

Definition at line 33 of file h264dsp.c.

Referenced by check_idct().

#define randomize_buffers ( )
Value:
do { \
int x, y; \
uint32_t mask = pixel_mask[bit_depth - 8]; \
for (y = 0; y < sz; y++) { \
for (x = 0; x < PIXEL_STRIDE; x += 4) { \
AV_WN32A(src + y * PIXEL_STRIDE + x, rnd() & mask); \
AV_WN32A(dst + y * PIXEL_STRIDE + x, rnd() & mask); \
} \
for (x = 0; x < sz; x++) { \
if (bit_depth == 8) { \
coef[y * sz + x] = src[y * PIXEL_STRIDE + x] - \
dst[y * PIXEL_STRIDE + x]; \
} else { \
((int32_t *)coef)[y * sz + x] = \
((uint16_t *)src)[y * (PIXEL_STRIDE/2) + x] - \
((uint16_t *)dst)[y * (PIXEL_STRIDE/2) + x]; \
} \
} \
} \
} while (0)
#define src
Definition: vp8dsp.c:254
#define AV_WN32A(p, v)
Definition: intreadwrite.h:543
static const uint32_t pixel_mask[3]
Definition: h264dsp.c:29
static const uint16_t mask[17]
Definition: lzw.c:38
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:152
int32_t
#define PIXEL_STRIDE
Definition: h264dsp.c:33
int
if(ret< 0)
Definition: vf_mcdeint.c:279
#define rnd()
Definition: checkasm.h:93
for(j=16;j >0;--j)

Definition at line 35 of file h264dsp.c.

Referenced by check_idct().

#define dct4x4_impl (   size,
  dctcoef 
)

Definition at line 57 of file h264dsp.c.

#define DCT8_1D (   src,
  srcstride,
  dst,
  dststride 
)
Value:
do { \
const int a0 = (src)[srcstride * 0] + (src)[srcstride * 7]; \
const int a1 = (src)[srcstride * 0] - (src)[srcstride * 7]; \
const int a2 = (src)[srcstride * 1] + (src)[srcstride * 6]; \
const int a3 = (src)[srcstride * 1] - (src)[srcstride * 6]; \
const int a4 = (src)[srcstride * 2] + (src)[srcstride * 5]; \
const int a5 = (src)[srcstride * 2] - (src)[srcstride * 5]; \
const int a6 = (src)[srcstride * 3] + (src)[srcstride * 4]; \
const int a7 = (src)[srcstride * 3] - (src)[srcstride * 4]; \
const int b0 = a0 + a6; \
const int b1 = a2 + a4; \
const int b2 = a0 - a6; \
const int b3 = a2 - a4; \
const int b4 = a3 + a5 + (a1 + (a1 >> 1)); \
const int b5 = a1 - a7 - (a5 + (a5 >> 1)); \
const int b6 = a1 + a7 - (a3 + (a3 >> 1)); \
const int b7 = a3 - a5 + (a7 + (a7 >> 1)); \
(dst)[dststride * 0] = b0 + b1; \
(dst)[dststride * 1] = b4 + (b7 >> 2); \
(dst)[dststride * 2] = b2 + (b3 >> 1); \
(dst)[dststride * 3] = b5 + (b6 >> 2); \
(dst)[dststride * 4] = b0 - b1; \
(dst)[dststride * 5] = b6 - (b5 >> 2); \
(dst)[dststride * 6] = (b2 >> 1) - b3; \
(dst)[dststride * 7] = (b4 >> 2) - b7; \
} while (0)
#define a0
Definition: regdef.h:46
#define a1
Definition: regdef.h:47
#define src
Definition: vp8dsp.c:254
#define a3
Definition: regdef.h:49
#define a2
Definition: regdef.h:48
#define a5
Definition: regdef.h:51
#define a4
Definition: regdef.h:50

Definition at line 91 of file h264dsp.c.

#define dct8x8_impl (   size,
  dctcoef 
)
Value:
static void dct8x8_##size(dctcoef *coef) \
{ \
int i, x, y; \
for (i = 0; i < 8; i++) \
DCT8_1D(coef + i, 8, tmp + i, 8); \
for (i = 0; i < 8; i++) \
DCT8_1D(tmp + 8*i, 1, coef + i, 8); \
for (y = 0; y < 8; y++) { \
for (x = 0; x < 8; x++) { \
static const int scale[] = { \
13107 * 20, 11428 * 18, 20972 * 32, \
12222 * 19, 16777 * 25, 15481 * 24, \
}; \
static const int idxmap[] = { \
0, 3, 4, 3, \
3, 1, 5, 1, \
4, 5, 2, 5, \
3, 1, 5, 1, \
}; \
const int idx = idxmap[(y & 3) * 4 + (x & 3)]; \
coef[y*8 + x] = ((int64_t)coef[y*8 + x] * \
scale[idx] + (1 << 17)) >> 18; \
} \
} \
}
ptrdiff_t size
Definition: opengl_enc.c:101
#define dctcoef
#define DCT8_1D(src, srcstride, dst, dststride)
Definition: h264dsp.c:91
int
for(j=16;j >0;--j)
static uint8_t tmp[11]
Definition: aes_ctr.c:26

Definition at line 118 of file h264dsp.c.

Function Documentation

dct4x4_impl ( 16  ,
int16_t   
)

Definition at line 148 of file h264dsp.c.

static void dct8x8 ( int16_t *  coef,
int  bit_depth 
)
static

Definition at line 162 of file h264dsp.c.

Referenced by check_idct().

static void check_idct ( void  )
static

Definition at line 172 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

void checkasm_check_h264dsp ( void  )

Definition at line 229 of file h264dsp.c.

Variable Documentation

const uint32_t pixel_mask[3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff }
static

Definition at line 29 of file h264dsp.c.