FFmpeg  4.0
Macros | Functions | Variables
h264dsp.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/h264dsp.h"
#include "libavcodec/h264data.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)
 
static void check_idct_multiple (void)
 
void checkasm_check_h264dsp (void)
 

Variables

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

Macro Definition Documentation

◆ SIZEOF_PIXEL

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

Definition at line 32 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ SIZEOF_COEF

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

Definition at line 33 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ PIXEL_STRIDE

#define PIXEL_STRIDE   16

Definition at line 34 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ randomize_buffers

#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
static const uint32_t pixel_mask[3]
Definition: h264dsp.c:30
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:34
#define rnd()
Definition: checkasm.h:100

Definition at line 36 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ dct4x4_impl

#define dct4x4_impl (   size,
  dctcoef 
)

Definition at line 58 of file h264dsp.c.

◆ DCT8_1D

#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 92 of file h264dsp.c.

Referenced by dct_sad8x8_c().

◆ dct8x8_impl

#define dct8x8_impl (   size,
  dctcoef 
)
Value:
static void dct8x8_##size(dctcoef *coef) \
{ \
int i, x, y; \
dctcoef tmp[64]; \
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; \
} \
} \
}
int size
#define dctcoef
#define DCT8_1D(src, srcstride, dst, dststride)
Definition: h264dsp.c:92
for(j=16;j >0;--j)
static uint8_t tmp[11]
Definition: aes_ctr.c:26

Definition at line 119 of file h264dsp.c.

Function Documentation

◆ dct4x4_impl()

dct4x4_impl ( 16  ,
int16_t   
)

Definition at line 149 of file h264dsp.c.

◆ dct8x8()

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

Definition at line 163 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ check_idct()

static void check_idct ( void  )
static

Definition at line 173 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ check_idct_multiple()

static void check_idct_multiple ( void  )
static

Definition at line 229 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ checkasm_check_h264dsp()

void checkasm_check_h264dsp ( void  )

Definition at line 315 of file h264dsp.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 30 of file h264dsp.c.