FFmpeg
Macros | Functions
vf_blend.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavfilter/blend.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.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 28 of file vf_blend.c.

◆ HEIGHT

#define HEIGHT   256

Definition at line 29 of file vf_blend.c.

◆ BUF_UNITS

#define BUF_UNITS   3

Definition at line 30 of file vf_blend.c.

◆ SIZE_PER_UNIT

#define SIZE_PER_UNIT   (WIDTH * HEIGHT)

Definition at line 31 of file vf_blend.c.

◆ BUF_SIZE

#define BUF_SIZE   (BUF_UNITS * SIZE_PER_UNIT)

Definition at line 32 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 34 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, double *values); \
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 63 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 88 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:31
r
const char * r
Definition: vf_curves.c:116
w
uint8_t w
Definition: llviddspenc.c:38
check_func
#define check_func(func,...)
Definition: checkasm.h:118
BUF_UNITS
#define BUF_UNITS
Definition: vf_blend.c:30
val
static double val(void *priv, double ch)
Definition: aeval.c:76
rnd
#define rnd()
Definition: checkasm.h:111
width
#define width
WIDTH
#define WIDTH
Definition: vf_blend.c:28
NULL
#define NULL
Definition: coverity.c:32
HEIGHT
#define HEIGHT
Definition: vf_blend.c:29
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
FilterParams
filter data
Definition: mlp.h:75
height
#define height
BUF_SIZE
#define BUF_SIZE
Definition: vf_blend.c:32
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
values
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return values
Definition: filter_design.txt:263