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

Go to the source code of this file.

Macros

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)
 
#define randomize_buffers()
 
#define randomize_buffers()
 
#define SIZEOF_COEF   (2 * ((bit_depth + 7) / 8))
 
#define setpx(a, b, c)
 
#define setdx(a, b, c, d)   setpx(a,b,c-(d)+(rnd()%((d)*2+1)))
 
#define setsx(a, b, c, d)   setdx(a,b,c,(d) << (bit_depth - 8))
 
#define randomize_buffers(bidx, lineoff, str)
 
#define M(a)   (((a)[1] << 8) | (a)[0])
 
#define DST_BUF_SIZE   (size * size * SIZEOF_PIXEL)
 
#define SRC_BUF_STRIDE   72
 
#define SRC_BUF_SIZE   ((size + 7) * SRC_BUF_STRIDE * SIZEOF_PIXEL)
 
#define src   (buf + 3 * SIZEOF_PIXEL * (SRC_BUF_STRIDE + 1))
 
#define randomize_buffers()
 

Typedefs

typedef void(* ftx1d_fn )(double *out, const double *in, int sz)
 

Functions

static void check_ipred (void)
 
static void fwht_1d (double *out, const double *in, int sz)
 
static void fdct_1d (double *out, const double *in, int sz)
 
static void fadst4_1d (double *out, const double *in, int sz)
 
static void fadst_1d (double *out, const double *in, int sz)
 
static void ftx_2d (double *out, const double *in, enum TxfmMode tx, enum TxfmType txtp, int sz)
 
static void ftx (int16_t *buf, enum TxfmMode tx, enum TxfmType txtp, int sz, int bit_depth)
 
static int copy_subcoefs (int16_t *out, const int16_t *in, enum TxfmMode tx, enum TxfmType txtp, int sz, int sub, int bit_depth)
 
static int iszero (const int16_t *c, int sz)
 
static void check_itxfm (void)
 
static void randomize_loopfilter_buffers (int bidx, int lineoff, int str, int bit_depth, int dir, const int *E, const int *F, const int *H, const int *I, uint8_t *buf0, uint8_t *buf1)
 
static void check_loopfilter (void)
 
static void check_mc (void)
 
void checkasm_check_vp9dsp (void)
 

Variables

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

Macro Definition Documentation

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

Definition at line 32 of file vp9dsp.c.

Referenced by check_ipred(), check_itxfm(), check_loopfilter(), and check_mc().

#define randomize_buffers ( )
Value:
do { \
uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
int k; \
for (k = -4; k < SIZEOF_PIXEL * FFMAX(8, size); k += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(a + k, r); \
} \
for (k = 0; k < size * SIZEOF_PIXEL; k += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(l + k, r); \
} \
} while (0)
#define AV_WN32A(p, v)
Definition: intreadwrite.h:543
ptrdiff_t size
Definition: opengl_enc.c:101
static const uint16_t mask[17]
Definition: lzw.c:38
const char * r
Definition: vf_curves.c:111
#define FFMAX(a, b)
Definition: common.h:94
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:150
#define SIZEOF_PIXEL
Definition: vp9dsp.c:32
static const uint32_t pixel_mask[3]
Definition: vp9dsp.c:31
int
#define rnd()
Definition: checkasm.h:74
for(j=16;j >0;--j)

Definition at line 546 of file vp9dsp.c.

Referenced by check_ipred(), check_itxfm(), check_loopfilter(), and check_mc().

#define randomize_buffers ( )
Value:
do { \
uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
for (y = 0; y < sz; y++) { \
for (x = 0; x < sz * SIZEOF_PIXEL; x += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(dst + y * sz * SIZEOF_PIXEL + x, r); \
AV_WN32A(src + y * sz * SIZEOF_PIXEL + x, rnd() & mask); \
} \
for (x = 0; x < sz; x++) { \
if (bit_depth == 8) { \
coef[y * sz + x] = src[y * sz + x] - dst[y * sz + x]; \
} else { \
((int32_t *) coef)[y * sz + x] = \
((uint16_t *) src)[y * sz + x] - \
((uint16_t *) dst)[y * sz + x]; \
} \
} \
} \
} while(0)
#define AV_WN32A(p, v)
Definition: intreadwrite.h:543
#define src
Definition: vp9dsp.c:544
static const uint16_t mask[17]
Definition: lzw.c:38
const char * r
Definition: vf_curves.c:111
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:150
int32_t
#define SIZEOF_PIXEL
Definition: vp9dsp.c:32
static const uint32_t pixel_mask[3]
Definition: vp9dsp.c:31
if(ret< 0)
Definition: vf_mcdeint.c:282
#define rnd()
Definition: checkasm.h:74
for(j=16;j >0;--j)

Definition at line 546 of file vp9dsp.c.

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

Definition at line 307 of file vp9dsp.c.

Referenced by check_itxfm().

#define setpx (   a,
  b,
  c 
)
Value:
do { \
if (SIZEOF_PIXEL == 1) { \
buf0[(a) + (b) * jstride] = av_clip_uint8(c); \
} else { \
((uint16_t *)buf0)[(a) + (b) * jstride] = av_clip_uintp2(c, bit_depth); \
} \
} while (0)
const char * b
Definition: vf_curves.c:113
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:150
#define SIZEOF_PIXEL
Definition: vp9dsp.c:32
if(ret< 0)
Definition: vf_mcdeint.c:282
static double c[64]

Definition at line 385 of file vp9dsp.c.

Referenced by randomize_loopfilter_buffers().

#define setdx (   a,
  b,
  c,
 
)    setpx(a,b,c-(d)+(rnd()%((d)*2+1)))

Definition at line 395 of file vp9dsp.c.

#define setsx (   a,
  b,
  c,
 
)    setdx(a,b,c,(d) << (bit_depth - 8))

Definition at line 396 of file vp9dsp.c.

Referenced by randomize_loopfilter_buffers().

#define randomize_buffers (   bidx,
  lineoff,
  str 
)
Value:
randomize_loopfilter_buffers(bidx, lineoff, str, bit_depth, dir, \
E, F, H, I, buf0, buf1)
static void randomize_loopfilter_buffers(int bidx, int lineoff, int str, int bit_depth, int dir, const int *E, const int *F, const int *H, const int *I, uint8_t *buf0, uint8_t *buf1)
Definition: vp9dsp.c:397
#define E
Definition: avdct.c:32
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:150
#define F(x)
#define H
Definition: pixlet.c:37

Definition at line 546 of file vp9dsp.c.

#define M (   a)    (((a)[1] << 8) | (a)[0])

Referenced by check_loopfilter().

#define DST_BUF_SIZE   (size * size * SIZEOF_PIXEL)

Definition at line 541 of file vp9dsp.c.

Referenced by check_mc().

#define SRC_BUF_STRIDE   72

Definition at line 542 of file vp9dsp.c.

Referenced by check_mc().

#define SRC_BUF_SIZE   ((size + 7) * SRC_BUF_STRIDE * SIZEOF_PIXEL)

Definition at line 543 of file vp9dsp.c.

#define src   (buf + 3 * SIZEOF_PIXEL * (SRC_BUF_STRIDE + 1))

Definition at line 544 of file vp9dsp.c.

Referenced by check_itxfm(), and check_mc().

#define randomize_buffers ( )
Value:
do { \
uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
int k; \
for (k = 0; k < SRC_BUF_SIZE; k += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(buf + k, r); \
} \
if (op == 1) { \
for (k = 0; k < DST_BUF_SIZE; k += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(dst0 + k, r); \
AV_WN32A(dst1 + k, r); \
} \
} \
} while (0)
#define AV_WN32A(p, v)
Definition: intreadwrite.h:543
#define DST_BUF_SIZE
Definition: vp9dsp.c:541
static const uint16_t mask[17]
Definition: lzw.c:38
const char * r
Definition: vf_curves.c:111
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:150
void * buf
Definition: avisynth_c.h:690
static const uint32_t pixel_mask[3]
Definition: vp9dsp.c:31
#define SRC_BUF_SIZE
Definition: vp9dsp.c:543
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition: anm.c:78
int
if(ret< 0)
Definition: vf_mcdeint.c:282
#define rnd()
Definition: checkasm.h:74
for(j=16;j >0;--j)

Definition at line 546 of file vp9dsp.c.

Typedef Documentation

typedef void(* ftx1d_fn)(double *out, const double *in, int sz)

Definition at line 177 of file vp9dsp.c.

Function Documentation

static void check_ipred ( void  )
static

Definition at line 48 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

static void fwht_1d ( double *  out,
const double *  in,
int  sz 
)
static

Definition at line 122 of file vp9dsp.c.

Referenced by ftx_2d().

static void fdct_1d ( double *  out,
const double *  in,
int  sz 
)
static

Definition at line 137 of file vp9dsp.c.

Referenced by ftx_2d().

static void fadst4_1d ( double *  out,
const double *  in,
int  sz 
)
static

Definition at line 152 of file vp9dsp.c.

Referenced by ftx_2d().

static void fadst_1d ( double *  out,
const double *  in,
int  sz 
)
static

Definition at line 166 of file vp9dsp.c.

Referenced by ftx_2d().

static void ftx_2d ( double *  out,
const double *  in,
enum TxfmMode  tx,
enum TxfmType  txtp,
int  sz 
)
static

Definition at line 178 of file vp9dsp.c.

Referenced by ftx().

static void ftx ( int16_t *  buf,
enum TxfmMode  tx,
enum TxfmType  txtp,
int  sz,
int  bit_depth 
)
static

Definition at line 229 of file vp9dsp.c.

Referenced by check_itxfm().

static int copy_subcoefs ( int16_t *  out,
const int16_t *  in,
enum TxfmMode  tx,
enum TxfmType  txtp,
int  sz,
int  sub,
int  bit_depth 
)
static

Definition at line 251 of file vp9dsp.c.

Referenced by check_itxfm().

static int iszero ( const int16_t *  c,
int  sz 
)
static

Definition at line 296 of file vp9dsp.c.

Referenced by check_itxfm().

static void check_itxfm ( void  )
static

Definition at line 309 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

static void randomize_loopfilter_buffers ( int  bidx,
int  lineoff,
int  str,
int  bit_depth,
int  dir,
const int E,
const int F,
const int H,
const int I,
uint8_t buf0,
uint8_t buf1 
)
static

Definition at line 397 of file vp9dsp.c.

static void check_loopfilter ( void  )
static

Definition at line 456 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

static void check_mc ( void  )
static

Definition at line 563 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

void checkasm_check_vp9dsp ( void  )

Definition at line 631 of file vp9dsp.c.

Variable Documentation

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

Definition at line 31 of file vp9dsp.c.