FFmpeg  4.3
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

◆ SIZEOF_PIXEL

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

Definition at line 32 of file vp9dsp.c.

◆ randomize_buffers [1/4]

#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)

Definition at line 540 of file vp9dsp.c.

◆ randomize_buffers [2/4]

#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)

Definition at line 540 of file vp9dsp.c.

◆ SIZEOF_COEF

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

Definition at line 307 of file vp9dsp.c.

◆ setpx

#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)

Definition at line 379 of file vp9dsp.c.

◆ setdx

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

Definition at line 389 of file vp9dsp.c.

◆ setsx

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

Definition at line 390 of file vp9dsp.c.

◆ randomize_buffers [3/4]

#define randomize_buffers (   bidx,
  lineoff,
  str 
)
Value:
randomize_loopfilter_buffers(bidx, lineoff, str, bit_depth, dir, \
E, F, H, I, buf0, buf1)

Definition at line 540 of file vp9dsp.c.

◆ M

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

◆ DST_BUF_SIZE

#define DST_BUF_SIZE   (size * size * SIZEOF_PIXEL)

Definition at line 535 of file vp9dsp.c.

◆ SRC_BUF_STRIDE

#define SRC_BUF_STRIDE   72

Definition at line 536 of file vp9dsp.c.

◆ SRC_BUF_SIZE

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

Definition at line 537 of file vp9dsp.c.

◆ src

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

Definition at line 538 of file vp9dsp.c.

◆ randomize_buffers [4/4]

#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)

Definition at line 540 of file vp9dsp.c.

Typedef Documentation

◆ ftx1d_fn

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

Definition at line 177 of file vp9dsp.c.

Function Documentation

◆ check_ipred()

static void check_ipred ( void  )
static

Definition at line 48 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

◆ fwht_1d()

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

Definition at line 122 of file vp9dsp.c.

Referenced by ftx_2d().

◆ fdct_1d()

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

Definition at line 137 of file vp9dsp.c.

Referenced by ftx_2d().

◆ fadst4_1d()

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

Definition at line 152 of file vp9dsp.c.

Referenced by ftx_2d().

◆ fadst_1d()

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

Definition at line 166 of file vp9dsp.c.

Referenced by ftx_2d().

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

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

◆ copy_subcoefs()

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

◆ iszero()

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

Definition at line 296 of file vp9dsp.c.

Referenced by check_itxfm().

◆ check_itxfm()

static void check_itxfm ( void  )
static

Definition at line 309 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

◆ randomize_loopfilter_buffers()

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 391 of file vp9dsp.c.

◆ check_loopfilter()

static void check_loopfilter ( void  )
static

Definition at line 450 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

◆ check_mc()

static void check_mc ( void  )
static

Definition at line 557 of file vp9dsp.c.

Referenced by checkasm_check_vp9dsp().

◆ checkasm_check_vp9dsp()

void checkasm_check_vp9dsp ( void  )

Definition at line 625 of file vp9dsp.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 31 of file vp9dsp.c.

bit_depth
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:254
randomize_loopfilter_buffers
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:391
b
#define b
Definition: input.c:41
F
#define F(x)
SIZEOF_PIXEL
#define SIZEOF_PIXEL
Definition: vp9dsp.c:32
x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
rnd
#define rnd()
Definition: checkasm.h:107
mask
static const uint16_t mask[17]
Definition: lzw.c:38
src
#define src
Definition: vp9dsp.c:538
op
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:75
E
#define E
Definition: avdct.c:32
int32_t
int32_t
Definition: audio_convert.c:194
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
pixel_mask
static const uint32_t pixel_mask[3]
Definition: vp9dsp.c:31
FFMAX
#define FFMAX(a, b)
Definition: common.h:94
size
int size
Definition: twinvq_data.h:11134
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
H
#define H
Definition: pixlet.c:39
r
#define r
Definition: input.c:40
SRC_BUF_SIZE
#define SRC_BUF_SIZE
Definition: vp9dsp.c:537
convert_header.str
string str
Definition: convert_header.py:20
DST_BUF_SIZE
#define DST_BUF_SIZE
Definition: vp9dsp.c:535