FFmpeg  4.3
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)
 
#define CHECK_LOOP_FILTER(name, align, idc)
 
#define CHECK_LOOP_FILTER(name, align, idc)
 

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)
 
static void check_loop_filter (void)
 
static void check_loop_filter_intra (void)
 
void checkasm_check_h264dsp (void)
 

Variables

static const uint32_t pixel_mask [3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff }
 
static const uint32_t pixel_mask_lf [3] = { 0xff0fff0f, 0x01ff000f, 0x03ff000f }
 

Macro Definition Documentation

◆ SIZEOF_PIXEL

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

Definition at line 33 of file h264dsp.c.

◆ SIZEOF_COEF

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

Definition at line 34 of file h264dsp.c.

◆ PIXEL_STRIDE

#define PIXEL_STRIDE   16

Definition at line 35 of file h264dsp.c.

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

Definition at line 37 of file h264dsp.c.

◆ dct4x4_impl

#define dct4x4_impl (   size,
  dctcoef 
)

Definition at line 59 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)

Definition at line 93 of file h264dsp.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; \
} \
} \
}

Definition at line 120 of file h264dsp.c.

◆ CHECK_LOOP_FILTER [1/2]

#define CHECK_LOOP_FILTER (   name,
  align,
  idc 
)
Value:
do { \
if (check_func(h.name, #name #idc "_%dbpp", bit_depth)) { \
for (j = 0; j < 36; j++) { \
intptr_t off = 8 * 32 + (j & 15) * 4 * !align; \
for (i = 0; i < 1024; i+=4) { \
AV_WN32A(dst + i, rnd() & mask); \
} \
memcpy(dst0, dst, 32 * 16 * 2); \
memcpy(dst1, dst, 32 * 16 * 2); \
call_ref(dst0 + off, 32, alphas[j], betas[j], tc0[j]); \
call_new(dst1 + off, 32, alphas[j], betas[j], tc0[j]); \
if (memcmp(dst0, dst1, 32 * 16 * SIZEOF_PIXEL)) { \
fprintf(stderr, #name #idc ": j:%d, alpha:%d beta:%d " \
"tc0:{%d,%d,%d,%d}\n", j, alphas[j], betas[j], \
tc0[j][0], tc0[j][1], tc0[j][2], tc0[j][3]); \
fail(); \
} \
bench_new(dst1, 32, alphas[j], betas[j], tc0[j]); \
} \
} \
} while (0)

◆ CHECK_LOOP_FILTER [2/2]

#define CHECK_LOOP_FILTER (   name,
  align,
  idc 
)
Value:
do { \
if (check_func(h.name, #name #idc "_%dbpp", bit_depth)) { \
for (j = 0; j < 36; j++) { \
intptr_t off = 8 * 32 + (j & 15) * 4 * !align; \
for (i = 0; i < 1024; i+=4) { \
AV_WN32A(dst + i, rnd() & mask); \
} \
memcpy(dst0, dst, 32 * 16 * 2); \
memcpy(dst1, dst, 32 * 16 * 2); \
call_ref(dst0 + off, 32, alphas[j], betas[j]); \
call_new(dst1 + off, 32, alphas[j], betas[j]); \
if (memcmp(dst0, dst1, 32 * 16 * SIZEOF_PIXEL)) { \
fprintf(stderr, #name #idc ": j:%d, alpha:%d beta:%d\n", \
j, alphas[j], betas[j]); \
fail(); \
} \
bench_new(dst1, 32, alphas[j], betas[j]); \
} \
} \
} while (0)

Function Documentation

◆ dct4x4_impl()

dct4x4_impl ( 16  ,
int16_t   
)

Definition at line 150 of file h264dsp.c.

◆ dct8x8()

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

Definition at line 164 of file h264dsp.c.

Referenced by check_idct(), and check_idct_multiple().

◆ check_idct()

static void check_idct ( void  )
static

Definition at line 174 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ check_idct_multiple()

static void check_idct_multiple ( void  )
static

Definition at line 230 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ check_loop_filter()

static void check_loop_filter ( void  )
static

Definition at line 317 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ check_loop_filter_intra()

static void check_loop_filter_intra ( void  )
static

Definition at line 382 of file h264dsp.c.

Referenced by checkasm_check_h264dsp().

◆ checkasm_check_h264dsp()

void checkasm_check_h264dsp ( void  )

Definition at line 441 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.

◆ pixel_mask_lf

const uint32_t pixel_mask_lf[3] = { 0xff0fff0f, 0x01ff000f, 0x03ff000f }
static

Definition at line 31 of file h264dsp.c.

Referenced by check_loop_filter(), and check_loop_filter_intra().

bit_depth
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:254
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:26
SIZEOF_PIXEL
#define SIZEOF_PIXEL
Definition: h264dsp.c:33
check_func
#define check_func(func,...)
Definition: checkasm.h:114
call_ref
#define call_ref(...)
Definition: checkasm.h:129
b1
static double b1(void *priv, double x, double y)
Definition: vf_xfade.c:1332
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
dctcoef
#define dctcoef
Definition: bit_depth_template.c:84
a1
#define a1
Definition: regdef.h:47
rnd
#define rnd()
Definition: checkasm.h:107
mask
static const uint16_t mask[17]
Definition: lzw.c:38
b3
static double b3(void *priv, double x, double y)
Definition: vf_xfade.c:1334
a4
#define a4
Definition: regdef.h:50
int32_t
int32_t
Definition: audio_convert.c:194
pixel_mask
static const uint32_t pixel_mask[3]
Definition: h264dsp.c:30
src
#define src
Definition: vp8dsp.c:254
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
size
int size
Definition: twinvq_data.h:11134
b2
static double b2(void *priv, double x, double y)
Definition: vf_xfade.c:1333
a0
#define a0
Definition: regdef.h:46
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
PIXEL_STRIDE
#define PIXEL_STRIDE
Definition: h264dsp.c:35
a2
#define a2
Definition: regdef.h:48
a5
#define a5
Definition: regdef.h:51
DCT8_1D
#define DCT8_1D(src, srcstride, dst, dststride)
Definition: h264dsp.c:93
b0
static double b0(void *priv, double x, double y)
Definition: vf_xfade.c:1331
h
h
Definition: vp9dsp_template.c:2038
a3
#define a3
Definition: regdef.h:49