FFmpeg
Macros | Functions
rv60dsp.c File Reference
#include "rv60dsp.h"
#include "libavutil/common.h"

Go to the source code of this file.

Macros

#define IDCT4X4(src, src_stride, src_step, dst, dst_stride, dst_step)
 
#define STORE(a, b)   a = b
 
#define STORE(a, b)   a = av_clip_uint8(a + (b))
 
#define IDCT8X8(src, src_stride, src_step, dst, dst_stride, dst_step)
 
#define STORE(a, b)   a = b
 
#define STORE(a, b)   a = av_clip_uint8(a + (b))
 
#define IDCT16X16(src, src_stride, src_step, dst, dst_stride, dst_step)
 
#define STORE(a, x)   a = av_clip_intp2(x, 15)
 
#define STORE(a, x)   a = av_clip_uint8(a + (x))
 

Functions

void ff_rv60_idct4x4_add (const int16_t *block, uint8_t *dst, int dst_stride)
 
void ff_rv60_idct8x8_add (const int16_t *block, uint8_t *dst, int dst_stride)
 
void ff_rv60_idct16x16_add (const int16_t *block, uint8_t *dst, int dst_stride)
 

Macro Definition Documentation

◆ IDCT4X4

#define IDCT4X4 (   src,
  src_stride,
  src_step,
  dst,
  dst_stride,
  dst_step 
)
Value:
for (int y = 0; y < 4; y++) { \
int a = src[y*src_stride + 0*src_step]; \
int b = src[y*src_stride + 1*src_step]; \
int c = src[y*src_stride + 2*src_step]; \
int d = src[y*src_stride + 3*src_step]; \
int t0 = 13 * (a + c); \
int t1 = 13 * (a - c); \
int t2 = 7 * b - 17 * d; \
int t3 = 7 * d + 17 * b; \
STORE(dst[y*dst_stride + 0*dst_step], (t0 + t3 + 16) >> 5); \
STORE(dst[y*dst_stride + 1*dst_step], (t1 + t2 + 16) >> 5); \
STORE(dst[y*dst_stride + 2*dst_step], (t1 - t2 + 16) >> 5); \
STORE(dst[y*dst_stride + 3*dst_step], (t0 - t3 + 16) >> 5); \
}

◆ STORE [1/6]

#define STORE (   a,
  b 
)    a = b

◆ STORE [2/6]

#define STORE (   a,
  b 
)    a = av_clip_uint8(a + (b))

◆ IDCT8X8

#define IDCT8X8 (   src,
  src_stride,
  src_step,
  dst,
  dst_stride,
  dst_step 
)
Value:
for (int y = 0; y < 8; y++) { \
int a = src[y*src_stride + 0*src_step]; \
int b = src[y*src_stride + 1*src_step]; \
int c = src[y*src_stride + 2*src_step]; \
int d = src[y*src_stride + 3*src_step]; \
int e = src[y*src_stride + 4*src_step]; \
int f = src[y*src_stride + 5*src_step]; \
int g = src[y*src_stride + 6*src_step]; \
int h = src[y*src_stride + 7*src_step]; \
int t0 = 37 * (a + e); \
int t1 = 37 * (a - e); \
int t2 = 48 * c + 20 * g; \
int t3 = 20 * c - 48 * g; \
int t4 = t0 + t2; \
int t5 = t0 - t2; \
int t6 = t1 + t3; \
int t7 = t1 - t3; \
int t8 = 51 * b + 43 * d + 29 * f + 10 * h; \
int t9 = 43 * b - 10 * d - 51 * f - 29 * h; \
int ta = 29 * b - 51 * d + 10 * f + 43 * h; \
int tb = 10 * b - 29 * d + 43 * f - 51 * h; \
STORE(dst[y*dst_stride + 0*dst_step], (t4 + t8 + 64) >> 7); \
STORE(dst[y*dst_stride + 1*dst_step], (t6 + t9 + 64) >> 7); \
STORE(dst[y*dst_stride + 2*dst_step], (t7 + ta + 64) >> 7); \
STORE(dst[y*dst_stride + 3*dst_step], (t5 + tb + 64) >> 7); \
STORE(dst[y*dst_stride + 4*dst_step], (t5 - tb + 64) >> 7); \
STORE(dst[y*dst_stride + 5*dst_step], (t7 - ta + 64) >> 7); \
STORE(dst[y*dst_stride + 6*dst_step], (t6 - t9 + 64) >> 7); \
STORE(dst[y*dst_stride + 7*dst_step], (t4 - t8 + 64) >> 7); \
}

◆ STORE [3/6]

#define STORE (   a,
  b 
)    a = b

◆ STORE [4/6]

#define STORE (   a,
  b 
)    a = av_clip_uint8(a + (b))

◆ IDCT16X16

#define IDCT16X16 (   src,
  src_stride,
  src_step,
  dst,
  dst_stride,
  dst_step 
)

◆ STORE [5/6]

#define STORE (   a,
 
)    a = av_clip_intp2(x, 15)

◆ STORE [6/6]

#define STORE (   a,
 
)    a = av_clip_uint8(a + (x))

Function Documentation

◆ ff_rv60_idct4x4_add()

void ff_rv60_idct4x4_add ( const int16_t *  block,
uint8_t *  dst,
int  dst_stride 
)

Definition at line 24 of file rv60dsp.c.

Referenced by decode_cu_r().

◆ ff_rv60_idct8x8_add()

void ff_rv60_idct8x8_add ( const int16_t *  block,
uint8_t *  dst,
int  dst_stride 
)

Definition at line 50 of file rv60dsp.c.

Referenced by decode_cu_r().

◆ ff_rv60_idct16x16_add()

void ff_rv60_idct16x16_add ( const int16_t *  block,
uint8_t *  dst,
int  dst_stride 
)

Definition at line 92 of file rv60dsp.c.

Referenced by decode_cu_r().

b
#define b
Definition: input.c:41
g
const char * g
Definition: vf_curves.c:128
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
f
f
Definition: af_crystalizer.c:122
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
h
h
Definition: vp9dsp_template.c:2070
src
#define src
Definition: vp8dsp.c:248