FFmpeg
Macros | Functions
vf_blend.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavfilter/vf_blend_init.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Macros

#define WIDTH   256
 
#define HEIGHT   256
 
#define BUF_UNITS   3
 
#define SIZE_PER_UNIT   (WIDTH * HEIGHT)
 
#define BUF_SIZE   (BUF_UNITS * SIZE_PER_UNIT)
 
#define randomize_buffers()
 
#define check_blend_func(depth)
 
#define check_and_report(name, val, depth)
 

Functions

void checkasm_check_blend (void)
 

Macro Definition Documentation

◆ WIDTH

#define WIDTH   256

Definition at line 29 of file vf_blend.c.

◆ HEIGHT

#define HEIGHT   256

Definition at line 30 of file vf_blend.c.

◆ BUF_UNITS

#define BUF_UNITS   3

Definition at line 31 of file vf_blend.c.

◆ SIZE_PER_UNIT

#define SIZE_PER_UNIT   (WIDTH * HEIGHT)

Definition at line 32 of file vf_blend.c.

◆ BUF_SIZE

#define BUF_SIZE   (BUF_UNITS * SIZE_PER_UNIT)

Definition at line 33 of file vf_blend.c.

◆ randomize_buffers

#define randomize_buffers ( )
Value:
do { \
int i, j; \
for (i = 0; i < HEIGHT; i++) { \
for (j = 0; j < WIDTH; j++) { \
top1[i * WIDTH + j] = \
top2[i * WIDTH + j] = i; \
bot1[i * WIDTH + j] = \
bot2[i * WIDTH + j] = j; \
} \
} \
for (i = 0; i < SIZE_PER_UNIT; i += 4) { \
uint32_t r = rnd(); \
AV_WN32A(dst1 + i, r); \
AV_WN32A(dst2 + i, r); \
} \
for (; i < BUF_SIZE; i += 4) { \
uint32_t r = rnd(); \
AV_WN32A(top1 + i, r); \
AV_WN32A(top2 + i, r); \
r = rnd(); \
AV_WN32A(bot1 + i, r); \
AV_WN32A(bot2 + i, r); \
r = rnd(); \
AV_WN32A(dst1 + i, r); \
AV_WN32A(dst2 + i, r); \
} \
} while (0)

Definition at line 35 of file vf_blend.c.

◆ check_blend_func

#define check_blend_func (   depth)
Value:
do { \
int i, w; \
declare_func(void, const uint8_t *top, ptrdiff_t top_linesize, \
const uint8_t *bottom, ptrdiff_t bottom_linesize, \
uint8_t *dst, ptrdiff_t dst_linesize, \
ptrdiff_t width, ptrdiff_t height, \
struct FilterParams *param, struct SliceParams *sliceparam); \
w = WIDTH / depth; \
for (i = 0; i < BUF_UNITS - 1; i++) { \
int src_offset = i * SIZE_PER_UNIT + (BUF_UNITS - 1 - i) * depth; /* Test various alignments */ \
int dst_offset = i * SIZE_PER_UNIT; /* dst must be aligned */ \
randomize_buffers(); \
call_ref(top1 + src_offset, w, bot1 + src_offset, w, \
dst1 + dst_offset, w, w, HEIGHT, &param, NULL); \
call_new(top2 + src_offset, w, bot2 + src_offset, w, \
dst2 + dst_offset, w, w, HEIGHT, &param, NULL); \
if (memcmp(top1, top2, BUF_SIZE) || memcmp(bot1, bot2, BUF_SIZE) || memcmp(dst1, dst2, BUF_SIZE)) \
fail(); \
} \
bench_new(top2, w / 4, bot2, w / 4, dst2, w / 4, \
w / 4, HEIGHT / 4, &param, NULL); \
} while (0)

Definition at line 64 of file vf_blend.c.

◆ check_and_report

#define check_and_report (   name,
  val,
  depth 
)
Value:
param.mode = val; \
ff_blend_init(&param, depth * 8); \
if (check_func(param.blend, #name)) \
check_blend_func(depth);

Function Documentation

◆ checkasm_check_blend()

void checkasm_check_blend ( void  )

Definition at line 89 of file vf_blend.c.

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
SIZE_PER_UNIT
#define SIZE_PER_UNIT
Definition: vf_blend.c:32
r
const char * r
Definition: vf_curves.c:127
w
uint8_t w
Definition: llviddspenc.c:38
check_func
#define check_func(func,...)
Definition: checkasm.h:176
BUF_UNITS
#define BUF_UNITS
Definition: vf_blend.c:31
val
static double val(void *priv, double ch)
Definition: aeval.c:78
rnd
#define rnd()
Definition: checkasm.h:169
width
#define width
WIDTH
#define WIDTH
Definition: vf_blend.c:29
NULL
#define NULL
Definition: coverity.c:32
HEIGHT
#define HEIGHT
Definition: vf_blend.c:30
FilterParams
filter data
Definition: mlp.h:86
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
height
#define height
BUF_SIZE
#define BUF_SIZE
Definition: vf_blend.c:33
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
SliceParams
Definition: blend.h:72