Go to the documentation of this file.
35 #define MUL(X,Y) ((int)((unsigned)(X) * (Y)) >> 11)
37 #define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\
38 const int a0 = (src)[s0] + (src)[s4]; \
39 const int a1 = (src)[s0] - (src)[s4]; \
40 const int a2 = (src)[s2] + (src)[s6]; \
41 const int a3 = MUL(A1, (src)[s2] - (src)[s6]); \
42 const int a4 = (src)[s5] + (src)[s3]; \
43 const int a5 = (src)[s5] - (src)[s3]; \
44 const int a6 = (src)[s1] + (src)[s7]; \
45 const int a7 = (src)[s1] - (src)[s7]; \
46 const int b0 = a4 + a6; \
47 const int b1 = MUL(A3, a5 + a7); \
48 const int b2 = MUL(A4, a5) - b0 + b1; \
49 const int b3 = MUL(A1, a6 - a4) - b2; \
50 const int b4 = MUL(A2, a7) + b3 - b1; \
51 (dest)[d0] = munge(a0+a2 +b0); \
52 (dest)[d1] = munge(a1+a3-a2+b2); \
53 (dest)[d2] = munge(a1-a3+a2+b3); \
54 (dest)[d3] = munge(a0-a2 -b4); \
55 (dest)[d4] = munge(a0-a2 +b4); \
56 (dest)[d5] = munge(a1-a3+a2-b3); \
57 (dest)[d6] = munge(a1+a3-a2-b2); \
58 (dest)[d7] = munge(a0+a2 -b0); \
62 #define MUNGE_NONE(x) (x)
63 #define IDCT_COL(dest,src) IDCT_TRANSFORM(dest,0,8,16,24,32,40,48,56,0,8,16,24,32,40,48,56,MUNGE_NONE,src)
65 #define MUNGE_ROW(x) (((x) + 0x7F)>>8)
66 #define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_ROW,src)
89 for (
i = 0;
i < 8;
i++)
91 for (
i = 0;
i < 8;
i++) {
101 for (
i = 0;
i < 8;
i++, dest += linesize,
block += 8)
102 for (j = 0; j < 8; j++)
110 for (
i = 0;
i < 8;
i++)
112 for (
i = 0;
i < 8;
i++) {
120 uint16_t *dst1 = (uint16_t *) dst;
121 uint16_t *dst2 = (uint16_t *)(dst + linesize);
123 for (j = 0; j < 8; j++) {
124 for (
i = 0;
i < 8;
i++) {
125 dst1[
i] = dst2[
i] =
src[
i] * 0x0101;
138 for (
i = 0;
i < 8;
i++) {
139 pixels[0] +=
block[0];
140 pixels[1] +=
block[1];
141 pixels[2] +=
block[2];
142 pixels[3] +=
block[3];
143 pixels[4] +=
block[4];
144 pixels[5] +=
block[5];
145 pixels[6] +=
block[6];
146 pixels[7] +=
block[7];
av_cold void ff_binkdsp_init(BinkDSPContext *c)
#define IDCT_ROW(dest, src)
static void scale_block_c(const uint8_t src[64], uint8_t *dst, int linesize)
static void bink_idct_add_c(uint8_t *dest, int linesize, int32_t *block)
#define IDCT_COL(dest, src)
static void bink_idct_c(int32_t *block)
static void add_pixels8_c(uint8_t *restrict pixels, int16_t *block, int line_size)
static void bink_idct_put_c(uint8_t *dest, int linesize, int32_t *block)
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
static void bink_idct_col(int *dest, const int32_t *src)
#define i(width, name, range_min, range_max)
The exact code depends on how similar the blocks are and how related they are to the block