FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
xvididct.c
Go to the documentation of this file.
1 /*
2  * Xvid MPEG-4 IDCT
3  *
4  * Copyright (C) 2006-2011 Xvid Solutions GmbH
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * Walken IDCT
26  * Alternative IDCT implementation for decoding compatibility.
27  *
28  * @author Skal
29  * @note This C version is not the original IDCT, but a modified one that
30  * yields the same error profile as the MMX/MMXEXT/SSE2 versions.
31  */
32 
33 #include "config.h"
34 #include "libavutil/attributes.h"
35 #include "idctdsp.h"
36 #include "xvididct.h"
37 
38 #define ROW_SHIFT 11
39 #define COL_SHIFT 6
40 
41 // #define FIX(x) (int)((x) * (1 << ROW_SHIFT))
42 #define RND0 65536 // 1 << (COL_SHIFT + ROW_SHIFT - 1);
43 #define RND1 3597 // FIX (1.75683487303);
44 #define RND2 2260 // FIX (1.10355339059);
45 #define RND3 1203 // FIX (0.587788325588);
46 #define RND4 0
47 #define RND5 120 // FIX (0.058658283817);
48 #define RND6 512 // FIX (0.25);
49 #define RND7 512 // FIX (0.25);
50 
51 static const int TAB04[] = { 22725, 21407, 19266, 16384, 12873, 8867, 4520 };
52 static const int TAB17[] = { 31521, 29692, 26722, 22725, 17855, 12299, 6270 };
53 static const int TAB26[] = { 29692, 27969, 25172, 21407, 16819, 11585, 5906 };
54 static const int TAB35[] = { 26722, 25172, 22654, 19266, 15137, 10426, 5315 };
55 
56 static int idct_row(short *in, const int *const tab, int rnd)
57 {
58  const unsigned c1 = tab[0];
59  const unsigned c2 = tab[1];
60  const unsigned c3 = tab[2];
61  const unsigned c4 = tab[3];
62  const unsigned c5 = tab[4];
63  const unsigned c6 = tab[5];
64  const unsigned c7 = tab[6];
65 
66  const int right = in[5] | in[6] | in[7];
67  const int left = in[1] | in[2] | in[3];
68  if (!(right | in[4])) {
69  const int k = c4 * in[0] + rnd;
70  if (left) {
71  const unsigned a0 = k + c2 * in[2];
72  const unsigned a1 = k + c6 * in[2];
73  const unsigned a2 = k - c6 * in[2];
74  const unsigned a3 = k - c2 * in[2];
75 
76  const int b0 = c1 * in[1] + c3 * in[3];
77  const int b1 = c3 * in[1] - c7 * in[3];
78  const int b2 = c5 * in[1] - c1 * in[3];
79  const int b3 = c7 * in[1] - c5 * in[3];
80 
81  in[0] = (int)(a0 + b0) >> ROW_SHIFT;
82  in[1] = (int)(a1 + b1) >> ROW_SHIFT;
83  in[2] = (int)(a2 + b2) >> ROW_SHIFT;
84  in[3] = (int)(a3 + b3) >> ROW_SHIFT;
85  in[4] = (int)(a3 - b3) >> ROW_SHIFT;
86  in[5] = (int)(a2 - b2) >> ROW_SHIFT;
87  in[6] = (int)(a1 - b1) >> ROW_SHIFT;
88  in[7] = (int)(a0 - b0) >> ROW_SHIFT;
89  } else {
90  const int a0 = k >> ROW_SHIFT;
91  if (a0) {
92  in[0] =
93  in[1] =
94  in[2] =
95  in[3] =
96  in[4] =
97  in[5] =
98  in[6] =
99  in[7] = a0;
100  } else
101  return 0;
102  }
103  } else if (!(left | right)) {
104  const int a0 = (int)(rnd + c4 * (in[0] + in[4])) >> ROW_SHIFT;
105  const int a1 = (int)(rnd + c4 * (in[0] - in[4])) >> ROW_SHIFT;
106 
107  in[0] = a0;
108  in[3] = a0;
109  in[4] = a0;
110  in[7] = a0;
111  in[1] = a1;
112  in[2] = a1;
113  in[5] = a1;
114  in[6] = a1;
115  } else {
116  const unsigned int k = c4 * in[0] + rnd;
117  const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6];
118  const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6];
119  const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6];
120  const unsigned int a3 = k - c2 * in[2] + c4 * in[4] - c6 * in[6];
121 
122  const unsigned int b0 = c1 * in[1] + c3 * in[3] + c5 * in[5] + c7 * in[7];
123  const unsigned int b1 = c3 * in[1] - c7 * in[3] - c1 * in[5] - c5 * in[7];
124  const unsigned int b2 = c5 * in[1] - c1 * in[3] + c7 * in[5] + c3 * in[7];
125  const unsigned int b3 = c7 * in[1] - c5 * in[3] + c3 * in[5] - c1 * in[7];
126 
127  in[0] = (int)(a0 + b0) >> ROW_SHIFT;
128  in[1] = (int)(a1 + b1) >> ROW_SHIFT;
129  in[2] = (int)(a2 + b2) >> ROW_SHIFT;
130  in[3] = (int)(a3 + b3) >> ROW_SHIFT;
131  in[4] = (int)(a3 - b3) >> ROW_SHIFT;
132  in[5] = (int)(a2 - b2) >> ROW_SHIFT;
133  in[6] = (int)(a1 - b1) >> ROW_SHIFT;
134  in[7] = (int)(a0 - b0) >> ROW_SHIFT;
135  }
136  return 1;
137 }
138 
139 #define TAN1 0x32EC
140 #define TAN2 0x6A0A
141 #define TAN3 0xAB0E
142 #define SQRT2 0x5A82
143 
144 #define MULT(c, x, n) ((unsigned)((int)((c) * (unsigned)(x)) >> (n)))
145 // 12b version => #define MULT(c,x, n) ((((c) >> 3) * (x)) >> ((n) - 3))
146 // 12b zero-testing version:
147 
148 #define BUTTERFLY(a, b, tmp) \
149  (tmp) = (a) + (b); \
150  (b) = (a) - (b); \
151  (a) = (tmp)
152 
153 #define LOAD_BUTTERFLY(m1, m2, a, b, tmp, s) \
154  (m1) = (s)[(a)] + (s)[(b)]; \
155  (m2) = (s)[(a)] - (s)[(b)]
156 
157 static void idct_col_8(short *const in)
158 {
159  int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
160 
161  // odd
162 
163  mm4 = (int) in[7 * 8];
164  mm5 = (int) in[5 * 8];
165  mm6 = (int) in[3 * 8];
166  mm7 = (int) in[1 * 8];
167 
168  mm0 = MULT(TAN1, mm4, 16) + mm7;
169  mm1 = MULT(TAN1, mm7, 16) - mm4;
170  mm2 = MULT(TAN3, mm5, 16) + mm6;
171  mm3 = MULT(TAN3, mm6, 16) - mm5;
172 
173  mm7 = mm0 + mm2;
174  mm4 = mm1 - mm3;
175  mm0 = mm0 - mm2;
176  mm1 = mm1 + mm3;
177  mm6 = mm0 + mm1;
178  mm5 = mm0 - mm1;
179  mm5 = 2 * MULT(SQRT2, mm5, 16); // 2*sqrt2
180  mm6 = 2 * MULT(SQRT2, mm6, 16); // Watch out: precision loss but done to match
181  // the pmulhw used in MMX/MMXEXT/SSE2 versions
182 
183  // even
184 
185  mm1 = (int) in[2 * 8];
186  mm2 = (int) in[6 * 8];
187  mm3 = MULT(TAN2, mm2, 16) + mm1;
188  mm2 = MULT(TAN2, mm1, 16) - mm2;
189 
190  LOAD_BUTTERFLY(mm0, mm1, 0 * 8, 4 * 8, spill, in);
191 
192  BUTTERFLY(mm0, mm3, spill);
193  BUTTERFLY(mm0, mm7, spill);
194  in[8 * 0] = (int16_t) (mm0 >> COL_SHIFT);
195  in[8 * 7] = (int16_t) (mm7 >> COL_SHIFT);
196  BUTTERFLY(mm3, mm4, mm0);
197  in[8 * 3] = (int16_t) (mm3 >> COL_SHIFT);
198  in[8 * 4] = (int16_t) (mm4 >> COL_SHIFT);
199 
200  BUTTERFLY(mm1, mm2, mm0);
201  BUTTERFLY(mm1, mm6, mm0);
202  in[8 * 1] = (int16_t) (mm1 >> COL_SHIFT);
203  in[8 * 6] = (int16_t) (mm6 >> COL_SHIFT);
204  BUTTERFLY(mm2, mm5, mm0);
205  in[8 * 2] = (int16_t) (mm2 >> COL_SHIFT);
206  in[8 * 5] = (int16_t) (mm5 >> COL_SHIFT);
207 }
208 
209 static void idct_col_4(short *const in)
210 {
211  int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
212 
213  // odd
214 
215  mm0 = (int) in[1 * 8];
216  mm2 = (int) in[3 * 8];
217 
218  mm1 = MULT(TAN1, mm0, 16);
219  mm3 = MULT(TAN3, mm2, 16);
220 
221  mm7 = mm0 + mm2;
222  mm4 = mm1 - mm3;
223  mm0 = mm0 - mm2;
224  mm1 = mm1 + mm3;
225  mm6 = mm0 + mm1;
226  mm5 = mm0 - mm1;
227  mm6 = 2 * MULT(SQRT2, mm6, 16); // 2*sqrt2
228  mm5 = 2 * MULT(SQRT2, mm5, 16);
229 
230  // even
231 
232  mm0 = mm1 = (int) in[0 * 8];
233  mm3 = (int) in[2 * 8];
234  mm2 = MULT(TAN2, mm3, 16);
235 
236  BUTTERFLY(mm0, mm3, spill);
237  BUTTERFLY(mm0, mm7, spill);
238  in[8 * 0] = (int16_t) (mm0 >> COL_SHIFT);
239  in[8 * 7] = (int16_t) (mm7 >> COL_SHIFT);
240  BUTTERFLY(mm3, mm4, mm0);
241  in[8 * 3] = (int16_t) (mm3 >> COL_SHIFT);
242  in[8 * 4] = (int16_t) (mm4 >> COL_SHIFT);
243 
244  BUTTERFLY(mm1, mm2, mm0);
245  BUTTERFLY(mm1, mm6, mm0);
246  in[8 * 1] = (int16_t) (mm1 >> COL_SHIFT);
247  in[8 * 6] = (int16_t) (mm6 >> COL_SHIFT);
248  BUTTERFLY(mm2, mm5, mm0);
249  in[8 * 2] = (int16_t) (mm2 >> COL_SHIFT);
250  in[8 * 5] = (int16_t) (mm5 >> COL_SHIFT);
251 }
252 
253 static void idct_col_3(short *const in)
254 {
255  int mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7, spill;
256 
257  // odd
258 
259  mm7 = (int) in[1 * 8];
260  mm4 = MULT(TAN1, mm7, 16);
261 
262  mm6 = mm7 + mm4;
263  mm5 = mm7 - mm4;
264  mm6 = 2 * MULT(SQRT2, mm6, 16); // 2*sqrt2
265  mm5 = 2 * MULT(SQRT2, mm5, 16);
266 
267  // even
268 
269  mm0 = mm1 = (int) in[0 * 8];
270  mm3 = (int) in[2 * 8];
271  mm2 = MULT(TAN2, mm3, 16);
272 
273  BUTTERFLY(mm0, mm3, spill);
274  BUTTERFLY(mm0, mm7, spill);
275  in[8 * 0] = (int16_t) (mm0 >> COL_SHIFT);
276  in[8 * 7] = (int16_t) (mm7 >> COL_SHIFT);
277  BUTTERFLY(mm3, mm4, mm0);
278  in[8 * 3] = (int16_t) (mm3 >> COL_SHIFT);
279  in[8 * 4] = (int16_t) (mm4 >> COL_SHIFT);
280 
281  BUTTERFLY(mm1, mm2, mm0);
282  BUTTERFLY(mm1, mm6, mm0);
283  in[8 * 1] = (int16_t) (mm1 >> COL_SHIFT);
284  in[8 * 6] = (int16_t) (mm6 >> COL_SHIFT);
285  BUTTERFLY(mm2, mm5, mm0);
286  in[8 * 2] = (int16_t) (mm2 >> COL_SHIFT);
287  in[8 * 5] = (int16_t) (mm5 >> COL_SHIFT);
288 }
289 
290 void ff_xvid_idct(int16_t *const in)
291 {
292  int i, rows = 0x07;
293 
294  idct_row(in + 0 * 8, TAB04, RND0);
295  idct_row(in + 1 * 8, TAB17, RND1);
296  idct_row(in + 2 * 8, TAB26, RND2);
297  if (idct_row(in + 3 * 8, TAB35, RND3))
298  rows |= 0x08;
299  if (idct_row(in + 4 * 8, TAB04, RND4))
300  rows |= 0x10;
301  if (idct_row(in + 5 * 8, TAB35, RND5))
302  rows |= 0x20;
303  if (idct_row(in + 6 * 8, TAB26, RND6))
304  rows |= 0x40;
305  if (idct_row(in + 7 * 8, TAB17, RND7))
306  rows |= 0x80;
307 
308  if (rows & 0xF0) {
309  for (i = 0; i < 8; i++)
310  idct_col_8(in + i);
311  } else if (rows & 0x08) {
312  for (i = 0; i < 8; i++)
313  idct_col_4(in + i);
314  } else {
315  for (i = 0; i < 8; i++)
316  idct_col_3(in + i);
317  }
318 }
319 
320 static void xvid_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
321 {
323  ff_put_pixels_clamped_c(block, dest, line_size);
324 }
325 
326 static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
327 {
329  ff_add_pixels_clamped_c(block, dest, line_size);
330 }
331 
333 {
334  c->idct_put = xvid_idct_put;
335  c->idct_add = xvid_idct_add;
336  c->idct = ff_xvid_idct;
337  c->perm_type = FF_IDCT_PERM_NONE;
338 
339 #if ARCH_X86
341 #elif ARCH_MIPS
343 #endif
344 }
RND6
#define RND6
Definition: xvididct.c:48
RND2
#define RND2
Definition: xvididct.c:44
xvid_idct_put
static void xvid_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
Definition: xvididct.c:320
ff_xvid_idct_init
av_cold void ff_xvid_idct_init(IDCTDSPContext *c)
Definition: xvididct.c:332
c1
static const uint64_t c1
Definition: murmur3.c:52
b1
static double b1(void *priv, double x, double y)
Definition: vf_xfade.c:2034
tab
static const struct twinvq_data tab
Definition: twinvq_data.h:10345
TAN2
#define TAN2
Definition: xvididct.c:140
a2
static double a2(void *priv, double x, double y)
Definition: vf_xfade.c:2030
TAN3
#define TAN3
Definition: xvididct.c:141
rnd
#define rnd()
Definition: checkasm.h:180
SQRT2
#define SQRT2
Definition: xvididct.c:142
av_cold
#define av_cold
Definition: attributes.h:90
RND0
#define RND0
Definition: xvididct.c:42
idct_col_3
static void idct_col_3(short *const in)
Definition: xvididct.c:253
b3
static double b3(void *priv, double x, double y)
Definition: vf_xfade.c:2036
idct_col_4
static void idct_col_4(short *const in)
Definition: xvididct.c:209
ff_xvid_idct
void ff_xvid_idct(int16_t *const in)
Definition: xvididct.c:290
ff_xvid_idct_init_x86
av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c)
Definition: xvididct_init.c:28
xvididct.h
LOAD_BUTTERFLY
#define LOAD_BUTTERFLY(m1, m2, a, b, tmp, s)
Definition: xvididct.c:153
RND3
#define RND3
Definition: xvididct.c:45
a3
static double a3(void *priv, double x, double y)
Definition: vf_xfade.c:2031
RND5
#define RND5
Definition: xvididct.c:47
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
TAN1
#define TAN1
Definition: xvididct.c:139
FF_IDCT_PERM_NONE
@ FF_IDCT_PERM_NONE
Definition: idctdsp.h:28
b2
static double b2(void *priv, double x, double y)
Definition: vf_xfade.c:2035
MULT
#define MULT(c, x, n)
Definition: xvididct.c:144
a0
static double a0(void *priv, double x, double y)
Definition: vf_xfade.c:2028
attributes.h
TAB35
static const int TAB35[]
Definition: xvididct.c:54
RND7
#define RND7
Definition: xvididct.c:49
TAB26
static const int TAB26[]
Definition: xvididct.c:53
TAB17
static const int TAB17[]
Definition: xvididct.c:52
idct_col_8
static void idct_col_8(short *const in)
Definition: xvididct.c:157
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
RND4
#define RND4
Definition: xvididct.c:46
ff_add_pixels_clamped_c
void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.c:147
ff_xvid_idct_init_mips
av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c)
Definition: xvididct_init_mips.c:25
xvid_idct_add
static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
Definition: xvididct.c:326
TAB04
static const int TAB04[]
Definition: xvididct.c:51
idctdsp.h
IDCTDSPContext
Definition: idctdsp.h:43
left
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled left
Definition: snow.txt:386
RND1
#define RND1
Definition: xvididct.c:43
idct_row
static int idct_row(short *in, const int *const tab, int rnd)
Definition: xvididct.c:56
c2
static const uint64_t c2
Definition: murmur3.c:53
ff_put_pixels_clamped_c
void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.c:73
COL_SHIFT
#define COL_SHIFT
Definition: xvididct.c:39
BUTTERFLY
#define BUTTERFLY(a, b, tmp)
Definition: xvididct.c:148
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
b0
static double b0(void *priv, double x, double y)
Definition: vf_xfade.c:2033
a1
static double a1(void *priv, double x, double y)
Definition: vf_xfade.c:2029
ROW_SHIFT
#define ROW_SHIFT
Definition: xvididct.c:38