36 #define MUL(X,Y) ((int)((unsigned)(X) * (Y)) >> 11) 38 #define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\ 39 const int a0 = (src)[s0] + (src)[s4]; \ 40 const int a1 = (src)[s0] - (src)[s4]; \ 41 const int a2 = (src)[s2] + (src)[s6]; \ 42 const int a3 = MUL(A1, (src)[s2] - (src)[s6]); \ 43 const int a4 = (src)[s5] + (src)[s3]; \ 44 const int a5 = (src)[s5] - (src)[s3]; \ 45 const int a6 = (src)[s1] + (src)[s7]; \ 46 const int a7 = (src)[s1] - (src)[s7]; \ 47 const int b0 = a4 + a6; \ 48 const int b1 = MUL(A3, a5 + a7); \ 49 const int b2 = MUL(A4, a5) - b0 + b1; \ 50 const int b3 = MUL(A1, a6 - a4) - b2; \ 51 const int b4 = MUL(A2, a7) + b3 - b1; \ 52 (dest)[d0] = munge(a0+a2 +b0); \ 53 (dest)[d1] = munge(a1+a3-a2+b2); \ 54 (dest)[d2] = munge(a1-a3+a2+b3); \ 55 (dest)[d3] = munge(a0-a2 -b4); \ 56 (dest)[d4] = munge(a0-a2 +b4); \ 57 (dest)[d5] = munge(a1-a3+a2-b3); \ 58 (dest)[d6] = munge(a1+a3-a2-b2); \ 59 (dest)[d7] = munge(a0+a2 -b0); \ 63 #define MUNGE_NONE(x) (x) 64 #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) 66 #define MUNGE_ROW(x) (((x) + 0x7F)>>8) 67 #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) 71 if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
90 for (i = 0; i < 8; i++)
92 for (i = 0; i < 8; i++) {
93 IDCT_ROW( (&block[8*i]), (&temp[8*i]) );
102 for (i = 0; i < 8; i++, dest += linesize, block += 8)
103 for (j = 0; j < 8; j++)
111 for (i = 0; i < 8; i++)
113 for (i = 0; i < 8; i++) {
114 IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) );
121 uint16_t *dst1 = (uint16_t *) dst;
122 uint16_t *dst2 = (uint16_t *)(dst + linesize);
124 for (j = 0; j < 8; j++) {
125 for (i = 0; i < 8; i++) {
126 dst1[
i] = dst2[
i] = src[
i] * 0x0101;
139 for (i = 0; i < 8; i++) {
140 pixels[0] += block[0];
141 pixels[1] += block[1];
142 pixels[2] += block[2];
143 pixels[3] += block[3];
144 pixels[4] += block[4];
145 pixels[5] += block[5];
146 pixels[6] += block[6];
147 pixels[7] += block[7];
av_cold void ff_binkdsp_init(BinkDSPContext *c)
static void bink_idct_add_c(uint8_t *dest, int linesize, int32_t *block)
void(* scale_block)(const uint8_t src[64], uint8_t *dst, int linesize)
static void scale_block_c(const uint8_t src[64], uint8_t *dst, int linesize)
Macro definitions for various function/variable attributes.
void(* idct_put)(uint8_t *dest, int line_size, int32_t *block)
The exact code depends on how similar the blocks are and how related they are to the 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_put_c(uint8_t *dest, int linesize, int32_t *block)
#define IDCT_COL(dest, src)
static void bink_idct_col(int *dest, const int32_t *src)
static void bink_idct_c(int32_t *block)
void(* idct_add)(uint8_t *dest, int line_size, int32_t *block)
static void add_pixels8_c(uint8_t *av_restrict pixels, int16_t *block, int line_size)
void(* add_pixels8)(uint8_t *av_restrict pixels, int16_t *block, int line_size)
#define IDCT_ROW(dest, src)