FFmpeg  4.3
Macros | Functions
diracdsp.c File Reference
#include "avcodec.h"
#include "diracdsp.h"

Go to the source code of this file.

Macros

#define FILTER(src, stride)
 
#define PIXOP_BILINEAR(PFX, OP, WIDTH)
 
#define OP_PUT(dst, val)   (dst) = (val)
 
#define OP_AVG(dst, val)   (dst) = (((dst) + (val) + 1)>>1)
 
#define op_scale1(x)   block[x] = av_clip_uint8( (block[x]*weight + (1<<(log2_denom-1))) >> log2_denom)
 
#define op_scale2(x)   dst[x] = av_clip_uint8( (src[x]*weights + dst[x]*weightd + (1<<(log2_denom-1))) >> log2_denom)
 
#define DIRAC_WEIGHT(W)
 
#define ADD_OBMC(xblen)
 
#define PUT_SIGNED_RECT_CLAMPED(PX)
 
#define DEQUANT_SUBBAND(PX)
 
#define PIXFUNC(PFX, WIDTH)
 

Functions

static void dirac_hpel_filter (uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, const uint8_t *src, int stride, int width, int height)
 
static void put_signed_rect_clamped_8bit_c (uint8_t *dst, int dst_stride, const uint8_t *_src, int src_stride, int width, int height)
 
static void add_rect_clamped_c (uint8_t *dst, const uint16_t *src, int stride, const int16_t *idwt, int idwt_stride, int width, int height)
 
av_cold void ff_diracdsp_init (DiracDSPContext *c)
 

Macro Definition Documentation

◆ FILTER

#define FILTER (   src,
  stride 
)
Value:
((21*((src)[ 0*stride] + (src)[1*stride]) \
-7*((src)[-1*stride] + (src)[2*stride]) \
+3*((src)[-2*stride] + (src)[3*stride]) \
-1*((src)[-3*stride] + (src)[4*stride]) + 16) >> 5)

Definition at line 24 of file diracdsp.c.

◆ PIXOP_BILINEAR

#define PIXOP_BILINEAR (   PFX,
  OP,
  WIDTH 
)
Value:
static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, const uint8_t *src[5], int stride, int h) \
{ \
int x; \
const uint8_t *s0 = src[0]; \
const uint8_t *s1 = src[1]; \
const uint8_t *s2 = src[2]; \
const uint8_t *s3 = src[3]; \
const uint8_t *w = src[4]; \
\
while (h--) { \
for (x = 0; x < WIDTH; x++) { \
OP(dst[x], (s0[x]*w[0] + s1[x]*w[1] + s2[x]*w[2] + s3[x]*w[3] + 8) >> 4); \
} \
\
dst += stride; \
s0 += stride; \
s1 += stride; \
s2 += stride; \
s3 += stride; \
} \
}

Definition at line 52 of file diracdsp.c.

◆ OP_PUT

#define OP_PUT (   dst,
  val 
)    (dst) = (val)

Definition at line 75 of file diracdsp.c.

◆ OP_AVG

#define OP_AVG (   dst,
  val 
)    (dst) = (((dst) + (val) + 1)>>1)

Definition at line 76 of file diracdsp.c.

◆ op_scale1

#define op_scale1 (   x)    block[x] = av_clip_uint8( (block[x]*weight + (1<<(log2_denom-1))) >> log2_denom)

Definition at line 85 of file diracdsp.c.

◆ op_scale2

#define op_scale2 (   x)    dst[x] = av_clip_uint8( (src[x]*weights + dst[x]*weightd + (1<<(log2_denom-1))) >> log2_denom)

Definition at line 86 of file diracdsp.c.

◆ DIRAC_WEIGHT

#define DIRAC_WEIGHT (   W)
Value:
static void weight_dirac_pixels ## W ## _c(uint8_t *block, int stride, int log2_denom, \
int weight, int h) { \
int x; \
while (h--) { \
for (x = 0; x < W; x++) { \
op_scale1(x); \
op_scale1(x+1); \
} \
block += stride; \
} \
} \
static void biweight_dirac_pixels ## W ## _c(uint8_t *dst, const uint8_t *src, int stride, int log2_denom, \
int weightd, int weights, int h) { \
int x; \
while (h--) { \
for (x = 0; x < W; x++) { \
op_scale2(x); \
op_scale2(x+1); \
} \
dst += stride; \
src += stride; \
} \
}

Definition at line 88 of file diracdsp.c.

◆ ADD_OBMC

#define ADD_OBMC (   xblen)
Value:
static void add_obmc ## xblen ## _c(uint16_t *dst, const uint8_t *src, int stride, \
const uint8_t *obmc_weight, int yblen) \
{ \
int x; \
while (yblen--) { \
for (x = 0; x < xblen; x += 2) { \
dst[x ] += src[x ] * obmc_weight[x ]; \
dst[x+1] += src[x+1] * obmc_weight[x+1]; \
} \
dst += stride; \
src += stride; \
obmc_weight += 32; \
} \
}

Definition at line 117 of file diracdsp.c.

◆ PUT_SIGNED_RECT_CLAMPED

#define PUT_SIGNED_RECT_CLAMPED (   PX)
Value:
static void put_signed_rect_clamped_ ## PX ## bit_c(uint8_t *_dst, int dst_stride, const uint8_t *_src, \
int src_stride, int width, int height) \
{ \
int x, y; \
uint16_t *dst = (uint16_t *)_dst; \
int32_t *src = (int32_t *)_src; \
for (y = 0; y < height; y++) { \
for (x = 0; x < width; x+=4) { \
dst[x ] = av_clip_uintp2(src[x ] + (1U << (PX - 1)), PX); \
dst[x+1] = av_clip_uintp2(src[x+1] + (1U << (PX - 1)), PX); \
dst[x+2] = av_clip_uintp2(src[x+2] + (1U << (PX - 1)), PX); \
dst[x+3] = av_clip_uintp2(src[x+3] + (1U << (PX - 1)), PX); \
} \
dst += dst_stride >> 1; \
src += src_stride >> 2; \
} \
}

Definition at line 153 of file diracdsp.c.

◆ DEQUANT_SUBBAND

#define DEQUANT_SUBBAND (   PX)
Value:
static void dequant_subband_ ## PX ## _c(uint8_t *src, uint8_t *dst, ptrdiff_t stride, \
const int qf, const int qs, int tot_v, int tot_h) \
{ \
int i, y; \
for (y = 0; y < tot_v; y++) { \
PX c, sign, *src_r = (PX *)src, *dst_r = (PX *)dst; \
for (i = 0; i < tot_h; i++) { \
c = *src_r++; \
sign = FFSIGN(c)*(!!c); \
c = (FFABS(c)*(unsigned)qf + qs) >> 2; \
*dst_r++ = c*sign; \
} \
src += tot_h << (sizeof(PX) >> 1); \
dst += stride; \
} \
}

Definition at line 192 of file diracdsp.c.

◆ PIXFUNC

#define PIXFUNC (   PFX,
  WIDTH 
)
Value:
c->PFX ## _dirac_pixels_tab[WIDTH>>4][0] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _c; \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][1] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _l2_c; \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][2] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _l4_c; \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][3] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c

Definition at line 213 of file diracdsp.c.

Function Documentation

◆ dirac_hpel_filter()

static void dirac_hpel_filter ( uint8_t dsth,
uint8_t dstv,
uint8_t dstc,
const uint8_t src,
int  stride,
int  width,
int  height 
)
static

Definition at line 30 of file diracdsp.c.

Referenced by ff_diracdsp_init().

◆ put_signed_rect_clamped_8bit_c()

static void put_signed_rect_clamped_8bit_c ( uint8_t dst,
int  dst_stride,
const uint8_t _src,
int  src_stride,
int  width,
int  height 
)
static

Definition at line 137 of file diracdsp.c.

Referenced by ff_diracdsp_init().

◆ add_rect_clamped_c()

static void add_rect_clamped_c ( uint8_t dst,
const uint16_t *  src,
int  stride,
const int16_t *  idwt,
int  idwt_stride,
int  width,
int  height 
)
static

Definition at line 175 of file diracdsp.c.

Referenced by ff_diracdsp_init().

◆ ff_diracdsp_init()

av_cold void ff_diracdsp_init ( DiracDSPContext c)

Definition at line 219 of file diracdsp.c.

Referenced by dirac_decode_init().

stride
int stride
Definition: mace.c:144
W
@ W
Definition: vf_addroi.c:26
s3
#define s3
Definition: regdef.h:40
U
#define U(x)
Definition: vp56_arith.h:37
FFSIGN
#define FFSIGN(a)
Definition: common.h:73
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
width
#define width
s1
#define s1
Definition: regdef.h:38
int32_t
int32_t
Definition: audio_convert.c:194
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
src
#define src
Definition: vp8dsp.c:254
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
weight
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1560
s2
#define s2
Definition: regdef.h:39
WIDTH
#define WIDTH
Definition: c93.c:43
height
#define height
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
uint8_t
uint8_t
Definition: audio_convert.c:194
w
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 ug o o w
Definition: fate.txt:150
s0
#define s0
Definition: regdef.h:37
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
h
h
Definition: vp9dsp_template.c:2038