FFmpeg
Loading...
Searching...
No Matches
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)
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define rnd
Definition checkasm.h:135
#define r
Definition input.c:42
#define WIDTH
Definition c93.c:45
#define HEIGHT
Definition c93.c:46
#define BUF_SIZE
Definition setpts.c:159
#define SIZE_PER_UNIT
Definition vf_blend.c:32

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)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define NULL
Definition coverity.c:32
uint8_t w
Definition llvidencdsp.c:39
filter data
Definition mlp.h:86
#define BUF_UNITS
Definition pixblockdsp.c:29
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89

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);
static double val(void *priv, double ch)
Definition aeval.c:77
#define check_func
Definition test.h:481
const char * name
Definition qsvenc.c:142

Referenced by checkasm_check_blend().

Function Documentation

◆ checkasm_check_blend()

void checkasm_check_blend ( void )

Definition at line 89 of file vf_blend.c.