[svn] / branches / dev-api-4 / xvidcore / src / motion / motion_comp.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/motion/motion_comp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 152, Wed May 1 13:00:02 2002 UTC revision 373, Thu Aug 15 18:13:02 2002 UTC
# Line 10  Line 10 
10  #define ABS(X) (((X)>0)?(X):-(X))  #define ABS(X) (((X)>0)?(X):-(X))
11  #define SIGN(X) (((X)>0)?1:-1)  #define SIGN(X) (((X)>0)?1:-1)
12    
13  static __inline void compensate8x8_halfpel(  static __inline void
14                                  int16_t * const dct_codes,  compensate8x8_halfpel(int16_t * const dct_codes,
15                                  uint8_t * const cur,                                  uint8_t * const cur,
16                                  const uint8_t * const ref,                                  const uint8_t * const ref,
17                                  const uint8_t * const refh,                                  const uint8_t * const refh,
18                                  const uint8_t * const refv,                                  const uint8_t * const refv,
19                                  const uint8_t * const refhv,                                  const uint8_t * const refhv,
20                                  const uint32_t x, const uint32_t y,                                            const uint32_t x,
21                                  const int32_t dx,  const int dy,                                            const uint32_t y,
22                                              const int32_t dx,
23                                              const int dy,
24                                  const uint32_t stride)                                  const uint32_t stride)
25  {  {
26          int32_t ddx,ddy;          int32_t ddx,ddy;
# Line 29  Line 31 
31                  ddx = dx/2;                  ddx = dx/2;
32                  ddy = dy/2;                  ddy = dy/2;
33                  transfer_8to16sub(dct_codes, cur + y*stride + x,                  transfer_8to16sub(dct_codes, cur + y*stride + x,
34                                  ref + (y+ddy)*stride + x+ddx, stride);                                                    ref + (int) ((y + ddy) * stride + x + ddx), stride);
35                  break;                  break;
36    
37      case 1 :      case 1 :
38                  ddx = dx/2;                  ddx = dx/2;
39                  ddy = (dy-1)/2;                  ddy = (dy-1)/2;
40                  transfer_8to16sub(dct_codes, cur + y*stride + x,                  transfer_8to16sub(dct_codes, cur + y*stride + x,
41                                  refv + (y+ddy)*stride + x+ddx, stride);                                                    refv + (int) ((y + ddy) * stride + x + ddx), stride);
42                  break;                  break;
43    
44      case 2 :      case 2 :
45                  ddx = (dx-1)/2;                  ddx = (dx-1)/2;
46                  ddy = dy/2;                  ddy = dy/2;
47                  transfer_8to16sub(dct_codes, cur + y*stride + x,                  transfer_8to16sub(dct_codes, cur + y*stride + x,
48                                  refh + (y+ddy)*stride + x+ddx, stride);                                                    refh + (int) ((y + ddy) * stride + x + ddx), stride);
49                  break;                  break;
50    
51          default :       // case 3:          default :       // case 3:
52                  ddx = (dx-1)/2;                  ddx = (dx-1)/2;
53                  ddy = (dy-1)/2;                  ddy = (dy-1)/2;
54                  transfer_8to16sub(dct_codes, cur + y*stride + x,                  transfer_8to16sub(dct_codes, cur + y*stride + x,
55                                  refhv + (y+ddy)*stride + x+ddx, stride);                                                    refhv + (int) ((y + ddy) * stride + x + ddx), stride);
56                  break;                  break;
57      }      }
58  }  }
59    
60    
61    
62  void MBMotionCompensation(  void
63          MACROBLOCK * const mb,  MBMotionCompensation(MACROBLOCK * const mb,
64          const uint32_t i,          const uint32_t i,
65          const uint32_t j,          const uint32_t j,
66          const IMAGE * const ref,          const IMAGE * const ref,
# Line 76  Line 78 
78                  { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 };                  { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 };
79    
80    
81          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q)          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) {
         {  
82                  int32_t dx = mb->mvs[0].x;                  int32_t dx = mb->mvs[0].x;
83                  int32_t dy = mb->mvs[0].y;                  int32_t dy = mb->mvs[0].y;
84    
85                  compensate8x8_halfpel(&dct_codes[0*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                  compensate8x8_halfpel(&dct_codes[0 * 64], cur->y, ref->y, refh->y,
86                                        16*i,     16*j,     dx, dy, edged_width);                                                            refv->y, refhv->y, 16 * i, 16 * j, dx, dy,
87                  compensate8x8_halfpel(&dct_codes[1*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                                                            edged_width);
88                                        16*i + 8, 16*j,     dx, dy, edged_width);                  compensate8x8_halfpel(&dct_codes[1 * 64], cur->y, ref->y, refh->y,
89                  compensate8x8_halfpel(&dct_codes[2*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                                                            refv->y, refhv->y, 16 * i + 8, 16 * j, dx, dy,
90                                        16*i,     16*j + 8, dx, dy, edged_width);                                                            edged_width);
91                  compensate8x8_halfpel(&dct_codes[3*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                  compensate8x8_halfpel(&dct_codes[2 * 64], cur->y, ref->y, refh->y,
92                                        16*i + 8, 16*j + 8, dx, dy, edged_width);                                                            refv->y, refhv->y, 16 * i, 16 * j + 8, dx, dy,
93                                                              edged_width);
94                    compensate8x8_halfpel(&dct_codes[3 * 64], cur->y, ref->y, refh->y,
95                                                              refv->y, refhv->y, 16 * i + 8, 16 * j + 8, dx,
96                                                              dy, edged_width);
97    
98                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;
99                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;
100    
101                  /* uv-image-based compensation */                  /* uv-image-based compensation */
102  #ifdef BFRAMES  #ifdef BUGGY_BFRAMES
103                     compensate8x8_halfpel(&dct_codes[4*64], cur->u, ref->u, refh->u, refv->u, refhv->u,  /* was #ifdef BFRAMES, but that's not possible because non-halfpel is _allowed_
104                     8*i, 8*j, dx, dy, edged_width/2);     if max_bframes<=0 . We should better check for XVID_HALFPEL flag */
105                     compensate8x8_halfpel(&dct_codes[5*64], cur->v, ref->v, refh->v, refv->v, refhv->v,  
106                     8*i, 8*j, dx, dy, edged_width/2);                  compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, ref->u, refh->u,
107                                                              refv->u, refhv->u, 8 * i, 8 * j, dx, dy,
108                                                              edged_width / 2);
109                    compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, ref->v, refh->v,
110                                                              refv->v, refhv->v, 8 * i, 8 * j, dx, dy,
111                                                              edged_width / 2);
112  #else  #else
113    
114    
115                  /* uv-block-based compensation */                  /* uv-block-based compensation */
116                  interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding);                  interpolate8x8_switch(refv->u, ref->u, 8 * i, 8 * j, dx, dy,
117                                                              edged_width / 2, rounding);
118                  transfer_8to16sub(&dct_codes[4*64],                  transfer_8to16sub(&dct_codes[4*64],
119                                    cur->u + 8*j*edged_width/2 + 8*i,                                    cur->u + 8*j*edged_width/2 + 8*i,
120                                    refv->u + 8*j*edged_width/2 + 8*i, edged_width/2);                                                    refv->u + 8 * j * edged_width / 2 + 8 * i,
121                                                      edged_width / 2);
122    
123                  interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding);                  interpolate8x8_switch(refv->v, ref->v, 8 * i, 8 * j, dx, dy,
124                                                              edged_width / 2, rounding);
125                  transfer_8to16sub(&dct_codes[5*64],                  transfer_8to16sub(&dct_codes[5*64],
126                                    cur->v + 8*j*edged_width/2 + 8*i,                                    cur->v + 8*j*edged_width/2 + 8*i,
127                                    refv->v + 8*j*edged_width/2 + 8*i, edged_width/2);                                                    refv->v + 8 * j * edged_width / 2 + 8 * i,
128                                                      edged_width / 2);
129  #endif  #endif
130          }          } else                                          // mode == MODE_INTER4V
         else    // mode == MODE_INTER4V  
131          {          {
132                  int32_t sum, dx, dy;                  int32_t sum, dx, dy;
133    
134                  compensate8x8_halfpel(&dct_codes[0*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                  compensate8x8_halfpel(&dct_codes[0 * 64], cur->y, ref->y, refh->y,
135                                        16*i,     16*j,     mb->mvs[0].x, mb->mvs[0].y, edged_width);                                                            refv->y, refhv->y, 16 * i, 16 * j, mb->mvs[0].x,
136                  compensate8x8_halfpel(&dct_codes[1*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                                                            mb->mvs[0].y, edged_width);
137                                        16*i + 8, 16*j,     mb->mvs[1].x, mb->mvs[1].y, edged_width);                  compensate8x8_halfpel(&dct_codes[1 * 64], cur->y, ref->y, refh->y,
138                  compensate8x8_halfpel(&dct_codes[2*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                                                            refv->y, refhv->y, 16 * i + 8, 16 * j,
139                                        16*i,     16*j + 8, mb->mvs[2].x, mb->mvs[2].y, edged_width);                                                            mb->mvs[1].x, mb->mvs[1].y, edged_width);
140                  compensate8x8_halfpel(&dct_codes[3*64], cur->y, ref->y, refh->y, refv->y, refhv->y,                  compensate8x8_halfpel(&dct_codes[2 * 64], cur->y, ref->y, refh->y,
141                                        16*i + 8, 16*j + 8, mb->mvs[3].x, mb->mvs[3].y, edged_width);                                                            refv->y, refhv->y, 16 * i, 16 * j + 8,
142                                                              mb->mvs[2].x, mb->mvs[2].y, edged_width);
143                    compensate8x8_halfpel(&dct_codes[3 * 64], cur->y, ref->y, refh->y,
144                                                              refv->y, refhv->y, 16 * i + 8, 16 * j + 8,
145                                                              mb->mvs[3].x, mb->mvs[3].y, edged_width);
146    
147                  sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x;                  sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x;
148                  dx = (sum ? SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);                  dx = (sum ? SIGN(sum) *
149                              (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);
150    
151                  sum = mb->mvs[0].y + mb->mvs[1].y + mb->mvs[2].y + mb->mvs[3].y;                  sum = mb->mvs[0].y + mb->mvs[1].y + mb->mvs[2].y + mb->mvs[3].y;
152                  dy = (sum ? SIGN(sum) * (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);                  dy = (sum ? SIGN(sum) *
153                              (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);
154    
155                  /* uv-image-based compensation */                  /* uv-image-based compensation */
156  #ifdef BFRAMES  #ifdef BFRAMES
157                     compensate8x8_halfpel(&dct_codes[4*64], cur->u, ref->u, refh->u, refv->u, refhv->u,                  compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, ref->u, refh->u,
158                     8*i, 8*j, dx, dy, edged_width/2);                                                            refv->u, refhv->u, 8 * i, 8 * j, dx, dy,
159                     compensate8x8_halfpel(&dct_codes[5*64], cur->v, ref->v, refh->v, refv->v, refhv->v,                                                            edged_width / 2);
160                     8*i, 8*j, dx, dy, edged_width/2);                  compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, ref->v, refh->v,
161                                                              refv->v, refhv->v, 8 * i, 8 * j, dx, dy,
162                                                              edged_width / 2);
163  #else  #else
164                  /* uv-block-based compensation */                  /* uv-block-based compensation */
165                  interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding);                  interpolate8x8_switch(refv->u, ref->u, 8 * i, 8 * j, dx, dy,
166                                                              edged_width / 2, rounding);
167                  transfer_8to16sub(&dct_codes[4*64],                  transfer_8to16sub(&dct_codes[4*64],
168                                    cur->u + 8*j*edged_width/2 + 8*i,                                    cur->u + 8*j*edged_width/2 + 8*i,
169                                    refv->u + 8*j*edged_width/2 + 8*i, edged_width/2);                                                    refv->u + 8 * j * edged_width / 2 + 8 * i,
170                                                      edged_width / 2);
171    
172                  interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding);                  interpolate8x8_switch(refv->v, ref->v, 8 * i, 8 * j, dx, dy,
173                                                              edged_width / 2, rounding);
174                  transfer_8to16sub(&dct_codes[5*64],                  transfer_8to16sub(&dct_codes[5*64],
175                                    cur->v + 8*j*edged_width/2 + 8*i,                                    cur->v + 8*j*edged_width/2 + 8*i,
176                                    refv->v + 8*j*edged_width/2 + 8*i, edged_width/2);                                                    refv->v + 8 * j * edged_width / 2 + 8 * i,
177                                                      edged_width / 2);
178  #endif  #endif
179          }          }
180  }  }
181    
182    
183  void MBMotionCompensationBVOP(  void
184                          MBParam * pParam,  MBMotionCompensationBVOP(MBParam * pParam,
185                          MACROBLOCK * const mb,                          MACROBLOCK * const mb,
186                      const uint32_t i,                      const uint32_t i,
187                          const uint32_t j,                          const uint32_t j,
# Line 180  Line 207 
207    
208    
209    
210          switch(mb->mode)          switch (mb->mode) {
         {  
211          case MODE_FORWARD :          case MODE_FORWARD :
212                  dx = mb->mvs[0].x;                  dx = mb->mvs[0].x;
213                  dy = mb->mvs[0].y;                  dy = mb->mvs[0].y;
214    
215                  transfer_8to16sub_c(                  transfer_8to16sub_c(&dct_codes[0 * 64],
                         &dct_codes[0*64],  
216                          cur->y + (j*16)*edged_width + (i*16),                          cur->y + (j*16)*edged_width + (i*16),
217                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,
218                                                          i*16, j*16, 1, dx, dy, edged_width),                                                          i*16, j*16, 1, dx, dy, edged_width),
219                          edged_width);                          edged_width);
220    
221                  transfer_8to16sub(                  transfer_8to16sub(&dct_codes[1 * 64],
                         &dct_codes[1*64],  
222                          cur->y + (j*16)*edged_width + (i*16+8),                          cur->y + (j*16)*edged_width + (i*16+8),
223                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,
224                                                          i*16+8, j*16, 1, dx, dy, edged_width),                                                          i*16+8, j*16, 1, dx, dy, edged_width),
225                          edged_width);                          edged_width);
226    
227                  transfer_8to16sub_c(                  transfer_8to16sub_c(&dct_codes[2 * 64],
                         &dct_codes[2*64],  
228                          cur->y + (j*16+8)*edged_width + (i*16),                          cur->y + (j*16+8)*edged_width + (i*16),
229                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,
230                                                          i*16, j*16+8, 1, dx, dy, edged_width),                                                                          i * 16, j * 16 + 8, 1, dx, dy,
231                          edged_width);                                                                          edged_width), edged_width);
232    
233                  transfer_8to16sub(                  transfer_8to16sub(&dct_codes[3 * 64],
                         &dct_codes[3*64],  
234                          cur->y + (j*16+8)*edged_width + (i*16+8),                          cur->y + (j*16+8)*edged_width + (i*16+8),
235                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                          get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,
236                                                          i*16+8, j*16+8, 1, dx, dy, edged_width),                                                                    i * 16 + 8, j * 16 + 8, 1, dx, dy,
237                          edged_width);                                                                    edged_width), edged_width);
238    
239    
240                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;
241                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;
242    
243                  /* uv-image-based compensation */                  /* uv-image-based compensation */
244                  compensate8x8_halfpel(&dct_codes[4*64], cur->u, f_ref->u, f_refh->u, f_refv->u, f_refhv->u,                  compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, f_ref->u, f_refh->u,
245                                                                  8*i, 8*j, dx, dy, edged_width/2);                                                            f_refv->u, f_refhv->u, 8 * i, 8 * j, dx, dy,
246                  compensate8x8_halfpel(&dct_codes[5*64], cur->v, f_ref->v, f_refh->v, f_refv->v, f_refhv->v,                                                            edged_width / 2);
247                                                                  8*i, 8*j, dx, dy, edged_width/2);                  compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, f_ref->v, f_refh->v,
248                                                              f_refv->v, f_refhv->v, 8 * i, 8 * j, dx, dy,
249                                                              edged_width / 2);
250    
251                  break;                  break;
252    
# Line 230  Line 254 
254                  b_dx = mb->b_mvs[0].x;                  b_dx = mb->b_mvs[0].x;
255                  b_dy = mb->b_mvs[0].y;                  b_dy = mb->b_mvs[0].y;
256    
257                  transfer_8to16sub_c(                  transfer_8to16sub_c(&dct_codes[0 * 64],
                         &dct_codes[0*64],  
258                          cur->y + (j*16)*edged_width + (i*16),                          cur->y + (j*16)*edged_width + (i*16),
259                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,
260                                                          i*16, j*16, 1, b_dx, b_dy, edged_width),                                                                          i * 16, j * 16, 1, b_dx, b_dy,
261                          edged_width);                                                                          edged_width), edged_width);
262    
263                  transfer_8to16sub(                  transfer_8to16sub(&dct_codes[1 * 64],
                         &dct_codes[1*64],  
264                          cur->y + (j*16)*edged_width + (i*16+8),                          cur->y + (j*16)*edged_width + (i*16+8),
265                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,
266                                                          i*16+8, j*16, 1, b_dx, b_dy, edged_width),                                                                    i * 16 + 8, j * 16, 1, b_dx, b_dy,
267                          edged_width);                                                                    edged_width), edged_width);
268    
269                  transfer_8to16sub_c(                  transfer_8to16sub_c(&dct_codes[2 * 64],
                         &dct_codes[2*64],  
270                          cur->y + (j*16+8)*edged_width + (i*16),                          cur->y + (j*16+8)*edged_width + (i*16),
271                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,
272                                                          i*16, j*16+8, 1, b_dx, b_dy, edged_width),                                                                          i * 16, j * 16 + 8, 1, b_dx, b_dy,
273                          edged_width);                                                                          edged_width), edged_width);
274    
275                  transfer_8to16sub(                  transfer_8to16sub(&dct_codes[3 * 64],
                         &dct_codes[3*64],  
276                          cur->y + (j*16+8)*edged_width + (i*16+8),                          cur->y + (j*16+8)*edged_width + (i*16+8),
277                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                          get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,
278                                                          i*16+8, j*16+8, 1, b_dx, b_dy, edged_width),                                                                    i * 16 + 8, j * 16 + 8, 1, b_dx, b_dy,
279                          edged_width);                                                                    edged_width), edged_width);
280    
281                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;
282                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;
283    
284                  /* uv-image-based compensation */                  /* uv-image-based compensation */
285                  compensate8x8_halfpel(&dct_codes[4*64], cur->u,                  compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, b_ref->u, b_refh->u,
286                                          b_ref->u, b_refh->u, b_refv->u, b_refhv->u,                                                            b_refv->u, b_refhv->u, 8 * i, 8 * j, b_dx, b_dy,
287                                          8*i, 8*j, b_dx, b_dy, edged_width/2);                                                            edged_width / 2);
288                  compensate8x8_halfpel(&dct_codes[5*64], cur->v,                  compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, b_ref->v, b_refh->v,
289                                          b_ref->v, b_refh->v, b_refv->v, b_refhv->v,                                                            b_refv->v, b_refhv->v, 8 * i, 8 * j, b_dx, b_dy,
290                                          8*i, 8*j, b_dx, b_dy, edged_width/2);                                                            edged_width / 2);
291    
292                  break;                  break;
293    
# Line 278  Line 298 
298                  b_dx = mb->b_mvs[0].x;                  b_dx = mb->b_mvs[0].x;
299                  b_dy = mb->b_mvs[0].y;                  b_dy = mb->b_mvs[0].y;
300    
301                  transfer_8to16sub2_c(                  transfer_8to16sub2_c(&dct_codes[0 * 64],
                                 &dct_codes[0*64],  
302                                  cur->y + (i*16) + (j*16)*edged_width,                                  cur->y + (i*16) + (j*16)*edged_width,
303                                  get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,
304                                                          16*i, 16*j, 1, dx, dy, edged_width),                                                                           f_refhv->y, 16 * i, 16 * j, 1, dx, dy,
305                                  get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                                                                           edged_width), get_ref(b_ref->y, b_refh->y,
306                                                          16*i, 16*j, 1, b_dx, b_dy, edged_width),                                                                                                                     b_refv->y,
307                                                                                                                       b_refhv->y, 16 * i,
308                                                                                                                       16 * j, 1, b_dx,
309                                                                                                                       b_dy, edged_width),
310                                  edged_width);                                  edged_width);
311    
312                  transfer_8to16sub2_c(                  transfer_8to16sub2_c(&dct_codes[1 * 64],
                                 &dct_codes[1*64],  
313                                  cur->y + (i*16+8) + (j*16)*edged_width,                                  cur->y + (i*16+8) + (j*16)*edged_width,
314                                  get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,
315                                                          16*i+8, 16*j, 1, dx, dy, edged_width),                                                                           f_refhv->y, 16 * i + 8, 16 * j, 1, dx, dy,
316                                  get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                                                                           edged_width), get_ref(b_ref->y, b_refh->y,
317                                                          16*i+8, 16*j, 1, b_dx, b_dy, edged_width),                                                                                                                     b_refv->y,
318                                                                                                                       b_refhv->y,
319                                                                                                                       16 * i + 8, 16 * j,
320                                                                                                                       1, b_dx, b_dy,
321                                                                                                                       edged_width),
322                                  edged_width);                                  edged_width);
323    
324                  transfer_8to16sub2_c(                  transfer_8to16sub2_c(&dct_codes[2 * 64],
                                 &dct_codes[2*64],  
325                                  cur->y + (i*16) + (j*16+8)*edged_width,                                  cur->y + (i*16) + (j*16+8)*edged_width,
326                                  get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,
327                                                          16*i, 16*j+8, 1, dx, dy, edged_width),                                                                           f_refhv->y, 16 * i, 16 * j + 8, 1, dx, dy,
328                                  get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                                                                           edged_width), get_ref(b_ref->y, b_refh->y,
329                                                          16*i, 16*j+8, 1, b_dx, b_dy, edged_width),                                                                                                                     b_refv->y,
330                                  edged_width);                                                                                                                     b_refhv->y, 16 * i,
331                                                                                                                       16 * j + 8, 1, b_dx,
332                  transfer_8to16sub2_c(                                                                                                                     b_dy, edged_width),
333                                  &dct_codes[3*64],                                                           edged_width);
334                                  cur->y + (i*16+8) + (j*16+8)*edged_width,  
335                                  get_ref(f_ref->y, f_refh->y, f_refv->y, f_refhv->y,                  transfer_8to16sub2_c(&dct_codes[3 * 64],
336                                                          16*i + 8, 16*j + 8, 1, dx, dy, edged_width),                                                           cur->y + (i * 16 + 8) + (j * 16 +
337                                  get_ref(b_ref->y, b_refh->y, b_refv->y, b_refhv->y,                                                                                                            8) * edged_width,
338                                                          16*i + 8, 16*j + 8, 1, b_dx, b_dy, edged_width),                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,
339                                                                             f_refhv->y, 16 * i + 8, 16 * j + 8, 1, dx,
340                                                                             dy, edged_width), get_ref(b_ref->y,
341                                                                                                                               b_refh->y,
342                                                                                                                               b_refv->y,
343                                                                                                                               b_refhv->y,
344                                                                                                                               16 * i + 8,
345                                                                                                                               16 * j + 8, 1,
346                                                                                                                               b_dx, b_dy,
347                                                                                                                               edged_width),
348                                  edged_width);                                  edged_width);
349    
350    
# Line 321  Line 354 
354                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;
355                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;
356    
357                  transfer_8to16sub2_c(                  transfer_8to16sub2_c(&dct_codes[4 * 64],
                                 &dct_codes[4*64],  
358                                  cur->u + (y*8)*edged_width/2 + (x*8),                                  cur->u + (y*8)*edged_width/2 + (x*8),
359                                  get_ref(f_ref->u, f_refh->u, f_refv->u, f_refhv->u,                                                           get_ref(f_ref->u, f_refh->u, f_refv->u,
360                                                          8*i, 8*j, 1, dx, dy, edged_width/2),                                                                           f_refhv->u, 8 * i, 8 * j, 1, dx, dy,
361                                  get_ref(b_ref->u, b_refh->u, b_refv->u, b_refhv->u,                                                                           edged_width / 2), get_ref(b_ref->u,
362                                                          8*i, 8*j, 1, b_dx, b_dy, edged_width/2),                                                                                                                             b_refh->u,
363                                                                                                                               b_refv->u,
364                                                                                                                               b_refhv->u,
365                                                                                                                               8 * i, 8 * j, 1,
366                                                                                                                               b_dx, b_dy,
367                                                                                                                               edged_width /
368                                                                                                                               2),
369                                  edged_width/2);                                  edged_width/2);
370    
371                  transfer_8to16sub2_c(                  transfer_8to16sub2_c(&dct_codes[5 * 64],
                                 &dct_codes[5*64],  
372                                  cur->v + (y*8)*edged_width/2 + (x*8),                                  cur->v + (y*8)*edged_width/2 + (x*8),
373                                  get_ref(f_ref->v, f_refh->v, f_refv->v, f_refhv->v,                                                           get_ref(f_ref->v, f_refh->v, f_refv->v,
374                                                          8*i, 8*j, 1, dx, dy, edged_width/2),                                                                           f_refhv->v, 8 * i, 8 * j, 1, dx, dy,
375                                  get_ref(b_ref->v, b_refh->v, b_refv->v, b_refhv->v,                                                                           edged_width / 2), get_ref(b_ref->v,
376                                                          8*i, 8*j, 1, b_dx, b_dy, edged_width/2),                                                                                                                             b_refh->v,
377                                                                                                                               b_refv->v,
378                                                                                                                               b_refhv->v,
379                                                                                                                               8 * i, 8 * j, 1,
380                                                                                                                               b_dx, b_dy,
381                                                                                                                               edged_width /
382                                                                                                                               2),
383                                  edged_width/2);                                  edged_width/2);
384    
385                  break;                  break;

Legend:
Removed from v.152  
changed lines
  Added in v.373

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4