FFmpeg
Macros | Functions
rv40dsp_init.c File Reference
#include "libavcodec/rv34dsp.h"
#include "libavutil/attributes.h"
#include "libavutil/mem_internal.h"
#include "libavutil/x86/cpu.h"
#include "hpeldsp.h"

Go to the source code of this file.

Macros

#define DEFINE_FN(op, size, insn)
 
#define DECLARE_WEIGHT(opt)
 
#define LOOPSIZE   8
 
#define HCOFF(x)   (32 * ((x) - 1))
 
#define VCOFF(x)   (32 * ((x) - 1))
 
#define LOOPSIZE   8
 
#define HCOFF(x)   (64 * ((x) - 1))
 
#define VCOFF(x)   (64 * ((x) - 1))
 
#define CHROMA_MC_FUNC(OP, SIZE, XMM)
 
#define QPEL_FUNC_DECL(OP, SIZE, PH, PV, OPT)
 Define one qpel function. More...
 
#define QPEL_FUNCS_DECL(OP, PH, PV, OPT)
 Declare functions for sizes 8 and 16 and given operations and qpel position. More...
 
#define QPEL_MC_DECL(OP, OPT)
 Declare all functions for all sizes and qpel positions. More...
 
#define QPEL_FUNC_SET(OP, SIZE, PH, PV, OPT)   c-> OP ## pixels_tab[2 - SIZE / 8][4 * PV + PH] = OP ## rv40_qpel ##SIZE ## _mc ##PH ##PV ##OPT;
 Set one function. More...
 
#define QPEL_FUNCS_SET(OP, PH, PV, OPT)
 Set functions put and avg for sizes 8 and 16 and a given qpel position. More...
 
#define QPEL_MC_SET(OP, OPT)
 Set all functions for all sizes and qpel positions. More...
 

Functions

av_cold void ff_rv40dsp_init_x86 (RV34DSPContext *c)
 

Detailed Description

RV40 decoder motion compensation functions x86-optimised 2,0 and 0,2 have h264 equivalents. 3,3 is bugged in the rv40 format and maps to _xy2 version

Definition in file rv40dsp_init.c.

Macro Definition Documentation

◆ DEFINE_FN

#define DEFINE_FN (   op,
  size,
  insn 
)
Value:
static void op##_rv40_qpel##size##_mc33_##insn(uint8_t *dst, const uint8_t *src, \
ptrdiff_t stride) \
{ \
ff_##op##_pixels##size##_xy2_##insn(dst, src, stride, size); \
}

Definition at line 35 of file rv40dsp_init.c.

◆ DECLARE_WEIGHT

#define DECLARE_WEIGHT (   opt)
Value:
void ff_rv40_weight_func_rnd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_rnd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_nornd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_nornd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride);

Definition at line 42 of file rv40dsp_init.c.

◆ QPEL_FUNC_DECL

#define QPEL_FUNC_DECL (   OP,
  SIZE,
  PH,
  PV,
  OPT 
)
Value:
static void OP ## rv40_qpel ##SIZE ##_mc ##PH ##PV ##OPT(uint8_t *dst, \
const uint8_t *src, \
ptrdiff_t stride) \
{ \
int i; \
if (PH && PV) { \
LOCAL_ALIGNED(16, uint8_t, tmp, [SIZE * (SIZE + 5)]); \
uint8_t *tmpptr = tmp + SIZE * 2; \
src -= stride * 2; \
for (i = 0; i < SIZE; i += LOOPSIZE) \
ff_put_rv40_qpel_h ##OPT(tmp + i, SIZE, src + i, stride, \
SIZE + 5, HCOFF(PH)); \
for (i = 0; i < SIZE; i += LOOPSIZE) \
ff_ ##OP ##rv40_qpel_v ##OPT(dst + i, stride, tmpptr + i, \
SIZE, SIZE, VCOFF(PV)); \
} else if (PV) { \
for (i = 0; i < SIZE; i += LOOPSIZE) \
ff_ ##OP ##rv40_qpel_v ## OPT(dst + i, stride, src + i, \
stride, SIZE, VCOFF(PV)); \
} else { \
for (i = 0; i < SIZE; i += LOOPSIZE) \
ff_ ##OP ##rv40_qpel_h ## OPT(dst + i, stride, src + i, \
stride, SIZE, HCOFF(PH)); \
} \
}

Define one qpel function.

LOOPSIZE must be already set to the number of pixels processed per iteration in the inner loop of the called functions. COFF(x) must be already defined so as to provide the offset into any array of coeffs used by the called function for the qpel position x.

Definition at line 62 of file rv40dsp_init.c.

◆ QPEL_FUNCS_DECL

#define QPEL_FUNCS_DECL (   OP,
  PH,
  PV,
  OPT 
)
Value:
QPEL_FUNC_DECL(OP, 8, PH, PV, OPT) \
QPEL_FUNC_DECL(OP, 16, PH, PV, OPT)

Declare functions for sizes 8 and 16 and given operations and qpel position.

Definition at line 92 of file rv40dsp_init.c.

◆ QPEL_MC_DECL

#define QPEL_MC_DECL (   OP,
  OPT 
)
Value:
void ff_ ##OP ##rv40_qpel_h ##OPT(uint8_t *dst, ptrdiff_t dstStride, \
const uint8_t *src, \
ptrdiff_t srcStride, \
int len, int m); \
void ff_ ##OP ##rv40_qpel_v ##OPT(uint8_t *dst, ptrdiff_t dstStride, \
const uint8_t *src, \
ptrdiff_t srcStride, \
int len, int m); \
QPEL_FUNCS_DECL(OP, 0, 1, OPT) \
QPEL_FUNCS_DECL(OP, 0, 3, OPT) \
QPEL_FUNCS_DECL(OP, 1, 0, OPT) \
QPEL_FUNCS_DECL(OP, 1, 1, OPT) \
QPEL_FUNCS_DECL(OP, 1, 2, OPT) \
QPEL_FUNCS_DECL(OP, 1, 3, OPT) \
QPEL_FUNCS_DECL(OP, 2, 1, OPT) \
QPEL_FUNCS_DECL(OP, 2, 2, OPT) \
QPEL_FUNCS_DECL(OP, 2, 3, OPT) \
QPEL_FUNCS_DECL(OP, 3, 0, OPT) \
QPEL_FUNCS_DECL(OP, 3, 1, OPT) \
QPEL_FUNCS_DECL(OP, 3, 2, OPT)

Declare all functions for all sizes and qpel positions.

Definition at line 97 of file rv40dsp_init.c.

◆ LOOPSIZE [1/2]

#define LOOPSIZE   8

Definition at line 129 of file rv40dsp_init.c.

◆ HCOFF [1/2]

#define HCOFF (   x)    (32 * ((x) - 1))

Definition at line 130 of file rv40dsp_init.c.

◆ VCOFF [1/2]

#define VCOFF (   x)    (32 * ((x) - 1))

Definition at line 131 of file rv40dsp_init.c.

◆ LOOPSIZE [2/2]

#define LOOPSIZE   8

Definition at line 129 of file rv40dsp_init.c.

◆ HCOFF [2/2]

#define HCOFF (   x)    (64 * ((x) - 1))

Definition at line 130 of file rv40dsp_init.c.

◆ VCOFF [2/2]

#define VCOFF (   x)    (64 * ((x) - 1))

Definition at line 131 of file rv40dsp_init.c.

◆ QPEL_FUNC_SET

#define QPEL_FUNC_SET (   OP,
  SIZE,
  PH,
  PV,
  OPT 
)    c-> OP ## pixels_tab[2 - SIZE / 8][4 * PV + PH] = OP ## rv40_qpel ##SIZE ## _mc ##PH ##PV ##OPT;

Set one function.

Definition at line 137 of file rv40dsp_init.c.

◆ QPEL_FUNCS_SET

#define QPEL_FUNCS_SET (   OP,
  PH,
  PV,
  OPT 
)
Value:
QPEL_FUNC_SET(OP, 8, PH, PV, OPT) \
QPEL_FUNC_SET(OP, 16, PH, PV, OPT)

Set functions put and avg for sizes 8 and 16 and a given qpel position.

Definition at line 141 of file rv40dsp_init.c.

◆ QPEL_MC_SET

#define QPEL_MC_SET (   OP,
  OPT 
)
Value:
QPEL_FUNCS_SET (OP, 0, 1, OPT) \
QPEL_FUNCS_SET (OP, 0, 3, OPT) \
QPEL_FUNCS_SET (OP, 1, 0, OPT) \
QPEL_FUNCS_SET (OP, 1, 1, OPT) \
QPEL_FUNCS_SET (OP, 1, 2, OPT) \
QPEL_FUNCS_SET (OP, 1, 3, OPT) \
QPEL_FUNCS_SET (OP, 2, 1, OPT) \
QPEL_FUNCS_SET (OP, 2, 2, OPT) \
QPEL_FUNCS_SET (OP, 2, 3, OPT) \
QPEL_FUNCS_SET (OP, 3, 0, OPT) \
QPEL_FUNCS_SET (OP, 3, 1, OPT) \
QPEL_FUNCS_SET (OP, 3, 2, OPT)

Set all functions for all sizes and qpel positions.

Definition at line 146 of file rv40dsp_init.c.

◆ CHROMA_MC_FUNC

#define CHROMA_MC_FUNC (   OP,
  SIZE,
  XMM 
)
Value:
void ff_rv40_ ## OP ## _chroma_mc ## SIZE ## _ ## XMM(uint8_t *dst, const uint8_t *src, \
ptrdiff_t stride, int h, int x, int y);\
c->OP ## _chroma_pixels_tab[SIZE == 4] = ff_rv40_ ## OP ## _chroma_mc ## SIZE ## _ ## XMM

Definition at line 171 of file rv40dsp_init.c.

Function Documentation

◆ ff_rv40dsp_init_x86()

av_cold void ff_rv40dsp_init_x86 ( RV34DSPContext c)

Definition at line 176 of file rv40dsp_init.c.

Referenced by ff_rv40dsp_init().

QPEL_FUNC_DECL
#define QPEL_FUNC_DECL(OP, SIZE, PH, PV, OPT)
Define one qpel function.
Definition: rv40dsp_init.c:62
src1
const pixel * src1
Definition: h264pred_template.c:420
VCOFF
#define VCOFF(x)
Definition: rv40dsp_init.c:131
OPT
#define OPT(name, field, help)
Definition: vf_drawvg.c:2517
op
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition: anm.c:76
tmp
static uint8_t tmp[40]
Definition: aes_ctr.c:52
QPEL_FUNCS_SET
#define QPEL_FUNCS_SET(OP, PH, PV, OPT)
Set functions put and avg for sizes 8 and 16 and a given qpel position.
Definition: rv40dsp_init.c:141
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:424
size
int size
Definition: twinvq_data.h:10344
SIZE
#define SIZE
Definition: bitstream_template.c:36
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
src2
const pixel * src2
Definition: h264pred_template.c:421
len
int len
Definition: vorbis_enc_data.h:426
HCOFF
#define HCOFF(x)
Definition: rv40dsp_init.c:130
OP
#define OP(gb, pixel, count)
_
#define _
LOOPSIZE
#define LOOPSIZE
Definition: rv40dsp_init.c:129
h
h
Definition: vp9dsp_template.c:2070
stride
#define stride
Definition: h264pred_template.c:536
QPEL_FUNC_SET
#define QPEL_FUNC_SET(OP, SIZE, PH, PV, OPT)
Set one function.
Definition: rv40dsp_init.c:137
src
#define src
Definition: vp8dsp.c:248