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

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

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

revision 449, Sun Sep 8 09:49:55 2002 UTC revision 530, Mon Sep 23 20:36: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    
14  static __inline void  static __inline void
15  compensate8x8_halfpel(int16_t * const dct_codes,  compensate8x8_halfpel(int16_t * const dct_codes,
16                                            uint8_t * const cur,                                            uint8_t * const cur,
# Line 23  Line 24 
24                                            const int dy,                                            const int dy,
25                                            const uint32_t stride)                                            const uint32_t stride)
26  {  {
27          int32_t ddx, ddy;          const uint8_t * reference;
28    
29          switch (((dx & 1) << 1) + (dy & 1))     // ((dx%2)?2:0)+((dy%2)?1:0)          switch (((dx & 1) << 1) + (dy & 1))     // ((dx%2)?2:0)+((dy%2)?1:0)
30          {          {
31          case 0:          case 0: reference = ref + ((y + dy / 2) * stride + x + dx / 2); break;
32                  ddx = dx / 2;          case 1: reference = refv + ((y + (dy-1) / 2) * stride + x + dx / 2); break;
33                  ddy = dy / 2;          case 2: reference = refh + ((y + dy / 2) * stride + x + (dx-1) / 2); break;
                 transfer_8to16sub(dct_codes, cur + y * stride + x,  
                                                   ref + (int) ((y + ddy) * stride + x + ddx), stride);  
                 break;  
   
         case 1:  
                 ddx = dx / 2;  
                 ddy = (dy - 1) / 2;  
                 transfer_8to16sub(dct_codes, cur + y * stride + x,  
                                                   refv + (int) ((y + ddy) * stride + x + ddx), stride);  
                 break;  
   
         case 2:  
                 ddx = (dx - 1) / 2;  
                 ddy = dy / 2;  
                 transfer_8to16sub(dct_codes, cur + y * stride + x,  
                                                   refh + (int) ((y + ddy) * stride + x + ddx), stride);  
                 break;  
   
34          default:                                        // case 3:          default:                                        // case 3:
35                  ddx = (dx - 1) / 2;                  reference = refhv + ((y + (dy-1) / 2) * stride + x + (dx-1) / 2); break;
                 ddy = (dy - 1) / 2;  
                 transfer_8to16sub(dct_codes, cur + y * stride + x,  
                                                   refhv + (int) ((y + ddy) * stride + x + ddx), stride);  
                 break;  
36          }          }
37            transfer_8to16sub(dct_codes, cur + y * stride + x,
38                                                      reference, stride);
39  }  }
40    
   
   
41  void  void
42  MBMotionCompensation(MACROBLOCK * const mb,  MBMotionCompensation(MACROBLOCK * const mb,
43                                           const uint32_t i,                                           const uint32_t i,
# Line 77  Line 56 
56          static const uint32_t roundtab[16] =          static const uint32_t roundtab[16] =
57                  { 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 };
58    
59            if (mb->mode == MODE_NOT_CODED) {
60                    transfer8x8_copy(cur->y + 16 * (i + j * edged_width),
61                                                            ref->y + 16 * (i + j * edged_width),
62                                                            edged_width);
63                    transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8,
64                                                            ref->y + 16 * (i + j * edged_width) + 8,
65                                                            edged_width);
66                    transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8 * edged_width,
67                                                            ref->y + 16 * (i + j * edged_width) + 8 * edged_width,
68                                                            edged_width);
69                    transfer8x8_copy(cur->y + 16 * (i + j * edged_width) + 8 * (edged_width+1),
70                                                            ref->y + 16 * (i + j * edged_width) + 8 * (edged_width+1),
71                                                            edged_width);
72    
73                    transfer8x8_copy(cur->u + 8 * (i + j * edged_width/2),
74                                                            ref->u + 8 * (i + j * edged_width/2),
75                                                            edged_width / 2);
76                    transfer8x8_copy(cur->v + 8 * (i + j * edged_width/2),
77                                                            ref->v + 8 * (i + j * edged_width/2),
78                                                            edged_width / 2);
79                    return;
80            }
81    
82          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) {          if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) {
83                  int32_t dx = mb->mvs[0].x;                  int32_t dx = mb->mvs[0].x;
# Line 98  Line 99 
99                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;
100                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;
101    
102                  /* u,v-image-based compensation                  /* uv-block-based compensation */
                 compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, ref->u, refh->u,  
                                                           refv->u, refhv->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, ref->v, refh->v,  
                                                           refv->v, refhv->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 */  
   
   
                 /* --- u,v-block-based interpolation & compensation --- */  
   
                 interpolate8x8_switch(refv->u, ref->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, rounding);  
103                  transfer_8to16sub(&dct_codes[4 * 64],                  transfer_8to16sub(&dct_codes[4 * 64],
104                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,
105                                                    refv->u + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(refv->u, ref->u, 8 * i, 8 * j,
106                                                                                                            dx, dy, edged_width / 2, rounding),
107                                                    edged_width / 2);                                                    edged_width / 2);
108    
                 interpolate8x8_switch(refv->v, ref->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, rounding);  
109                  transfer_8to16sub(&dct_codes[5 * 64],                  transfer_8to16sub(&dct_codes[5 * 64],
110                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,
111                                                    refv->v + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(refv->u, ref->v, 8 * i, 8 * j,
112                                                                                                            dx, dy, edged_width / 2, rounding),
113                                                    edged_width / 2);                                                    edged_width / 2);
                 /* */  
114    
115          } else                                          // mode == MODE_INTER4V          } else {                                        // mode == MODE_INTER4V
         {  
116                  int32_t sum, dx, dy;                  int32_t sum, dx, dy;
117    
118                  compensate8x8_halfpel(&dct_codes[0 * 64], cur->y, ref->y, refh->y,                  compensate8x8_halfpel(&dct_codes[0 * 64], cur->y, ref->y, refh->y,
# Line 150  Line 136 
136                  dy = (sum ? SIGN(sum) *                  dy = (sum ? SIGN(sum) *
137                            (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);                            (roundtab[ABS(sum) % 16] + (ABS(sum) / 16) * 2) : 0);
138    
139                  /* --- uv-image-based compensation -- -                  /* uv-block-based compensation */
                 compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, ref->u, refh->u,  
                                                           refv->u, refhv->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, ref->v, refh->v,  
                                                           refv->v, refhv->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 */  
   
                 /* --- uv-block-based compensation ---  
                 WARNING: these ditry the refv->u and refv->v images   */  
   
                 interpolate8x8_switch(refv->u, ref->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, rounding);  
140                  transfer_8to16sub(&dct_codes[4 * 64],                  transfer_8to16sub(&dct_codes[4 * 64],
141                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,
142                                                    refv->u + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(refv->u, ref->u, 8 * i, 8 * j,
143                                                                                                            dx, dy, edged_width / 2, rounding),
144                                                    edged_width / 2);                                                    edged_width / 2);
145    
                 interpolate8x8_switch(refv->v, ref->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, rounding);  
146                  transfer_8to16sub(&dct_codes[5 * 64],                  transfer_8to16sub(&dct_codes[5 * 64],
147                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,
148                                                    refv->v + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(refv->u, ref->v, 8 * i, 8 * j,
149                                                                                                            dx, dy, edged_width / 2, rounding),
150    
151                                                    edged_width / 2);                                                    edged_width / 2);
                 /* */  
152          }          }
153  }  }
154    
# Line 212  Line 185 
185                  dx = mb->mvs[0].x;                  dx = mb->mvs[0].x;
186                  dy = mb->mvs[0].y;                  dy = mb->mvs[0].y;
187    
188                  transfer_8to16sub_c(&dct_codes[0 * 64],                  transfer_8to16sub(&dct_codes[0 * 64],
189                                                          cur->y + (j * 16) * edged_width + (i * 16),                                                          cur->y + (j * 16) * edged_width + (i * 16),
190                                                          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,
191                                                                          i * 16, j * 16, 1, dx, dy, edged_width),                                                                          i * 16, j * 16, 1, dx, dy, edged_width),
# Line 224  Line 197 
197                                                                    i * 16 + 8, j * 16, 1, dx, dy, edged_width),                                                                    i * 16 + 8, j * 16, 1, dx, dy, edged_width),
198                                                    edged_width);                                                    edged_width);
199    
200                  transfer_8to16sub_c(&dct_codes[2 * 64],                  transfer_8to16sub(&dct_codes[2 * 64],
201                                                          cur->y + (j * 16 + 8) * edged_width + (i * 16),                                                          cur->y + (j * 16 + 8) * edged_width + (i * 16),
202                                                          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,
203                                                                          i * 16, j * 16 + 8, 1, dx, dy,                                                                          i * 16, j * 16 + 8, 1, dx, dy, edged_width),
204                                                                          edged_width), edged_width);                                                          edged_width);
205    
206                  transfer_8to16sub(&dct_codes[3 * 64],                  transfer_8to16sub(&dct_codes[3 * 64],
207                                                    cur->y + (j * 16 + 8) * edged_width + (i * 16 + 8),                                                    cur->y + (j * 16 + 8) * edged_width + (i * 16 + 8),
208                                                    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,
209                                                                    i * 16 + 8, j * 16 + 8, 1, dx, dy,                                                                    i * 16 + 8, j * 16 + 8, 1, dx, dy, edged_width),
210                                                                    edged_width), edged_width);                                                          edged_width);
211    
212    
213                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;                  dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2;
214                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;                  dy = (dy & 3) ? (dy >> 1) | 1 : dy / 2;
215    
216                  /* --- uv-image-based compensation ---                  /* uv-block-based compensation */
                 compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, f_ref->u, f_refh->u,  
                                                           f_refv->u, f_refhv->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, f_ref->v, f_refh->v,  
                                                           f_refv->v, f_refhv->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2);  
                 */  
   
                 /* --- u,v-block-based interpolation & compensation --- */  
                 interpolate8x8_switch(f_refv->u, f_ref->u, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, 0);  
217                  transfer_8to16sub(&dct_codes[4 * 64],                  transfer_8to16sub(&dct_codes[4 * 64],
218                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,
219                                                    f_refv->u + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(f_refv->u, f_ref->u, 8 * i, 8 * j,
220                                                                                                            dx, dy, edged_width / 2, 0),
221    
222                                                    edged_width / 2);                                                    edged_width / 2);
223    
                 interpolate8x8_switch(f_refv->v, f_ref->v, 8 * i, 8 * j, dx, dy,  
                                                           edged_width / 2, 0);  
224                  transfer_8to16sub(&dct_codes[5 * 64],                  transfer_8to16sub(&dct_codes[5 * 64],
225                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,
226                                                    f_refv->v + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(f_refv->u, f_ref->v, 8 * i, 8 * j,
227                                                                                                            dx, dy, edged_width / 2, 0),
228    
229                                                    edged_width / 2);                                                    edged_width / 2);
                 /* */  
230    
231                  break;                  break;
232    
# Line 271  Line 234 
234                  b_dx = mb->b_mvs[0].x;                  b_dx = mb->b_mvs[0].x;
235                  b_dy = mb->b_mvs[0].y;                  b_dy = mb->b_mvs[0].y;
236    
237                  transfer_8to16sub_c(&dct_codes[0 * 64],                  transfer_8to16sub(&dct_codes[0 * 64],
238                                                          cur->y + (j * 16) * edged_width + (i * 16),                                                          cur->y + (j * 16) * edged_width + (i * 16),
239                                                          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,
240                                                                          i * 16, j * 16, 1, b_dx, b_dy,                                                                          i * 16, j * 16, 1, b_dx, b_dy,
# Line 283  Line 246 
246                                                                    i * 16 + 8, j * 16, 1, b_dx, b_dy,                                                                    i * 16 + 8, j * 16, 1, b_dx, b_dy,
247                                                                    edged_width), edged_width);                                                                    edged_width), edged_width);
248    
249                  transfer_8to16sub_c(&dct_codes[2 * 64],                  transfer_8to16sub(&dct_codes[2 * 64],
250                                                          cur->y + (j * 16 + 8) * edged_width + (i * 16),                                                          cur->y + (j * 16 + 8) * edged_width + (i * 16),
251                                                          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,
252                                                                          i * 16, j * 16 + 8, 1, b_dx, b_dy,                                                                          i * 16, j * 16 + 8, 1, b_dx, b_dy,
# Line 298  Line 261 
261                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;
262                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;
263    
264                  /* --- uv-image-based compensation ---                  /* uv-block-based compensation */
                 compensate8x8_halfpel(&dct_codes[4 * 64], cur->u, b_ref->u, b_refh->u,  
                                                           b_refv->u, b_refhv->u, 8 * i, 8 * j, b_dx, b_dy,  
                                                           edged_width / 2);  
                 compensate8x8_halfpel(&dct_codes[5 * 64], cur->v, b_ref->v, b_refh->v,  
                                                           b_refv->v, b_refhv->v, 8 * i, 8 * j, b_dx, b_dy,  
                                                           edged_width / 2);  
                 */  
   
                 /* --- u,v-block-based interpolation & compensation --- */  
                 interpolate8x8_switch(b_refv->u, b_ref->u, 8 * i, 8 * j, b_dx, b_dy,  
                                                           edged_width / 2, 0);  
265                  transfer_8to16sub(&dct_codes[4 * 64],                  transfer_8to16sub(&dct_codes[4 * 64],
266                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,                                                    cur->u + 8 * j * edged_width / 2 + 8 * i,
267                                                    b_refv->u + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j,
268                                                                                                            b_dx, b_dy, edged_width / 2, 0),
269    
270                                                    edged_width / 2);                                                    edged_width / 2);
271    
                 interpolate8x8_switch(b_refv->v, b_ref->v, 8 * i, 8 * j, b_dx, b_dy,  
                                                           edged_width / 2, 0);  
272                  transfer_8to16sub(&dct_codes[5 * 64],                  transfer_8to16sub(&dct_codes[5 * 64],
273                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,                                                    cur->v + 8 * j * edged_width / 2 + 8 * i,
274                                                    b_refv->v + 8 * j * edged_width / 2 + 8 * i,                                                          interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j,
275                                                                                                            b_dx, b_dy, edged_width / 2, 0),
276    
277                                                    edged_width / 2);                                                    edged_width / 2);
                 /* */  
278    
279                  break;                  break;
280    
281    
282          case MODE_INTERPOLATE:          /* _could_ use DIRECT, but would be overkill (no 4MV there) */          case MODE_INTERPOLATE:          /* _could_ use DIRECT, but would be overkill (no 4MV there) */
283            case MODE_DIRECT_NO4V:
284    
285                  dx = mb->mvs[0].x;                  dx = mb->mvs[0].x;
286                  dy = mb->mvs[0].y;                  dy = mb->mvs[0].y;
# Line 334  Line 288 
288                  b_dx = mb->b_mvs[0].x;                  b_dx = mb->b_mvs[0].x;
289                  b_dy = mb->b_mvs[0].y;                  b_dy = mb->b_mvs[0].y;
290    
291                  for (k=0;k<4;k++)                  for (k = 0; k < 4; k++) {
292                  {                          transfer_8to16sub2(&dct_codes[k * 64],
                         transfer_8to16sub2_c(&dct_codes[k * 64],  
293                                                           cur->y + (i * 16+(k&1)*8) + (j * 16+((k>>1)*8)) * edged_width,                                                           cur->y + (i * 16+(k&1)*8) + (j * 16+((k>>1)*8)) * edged_width,
294                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,                                                           get_ref(f_ref->y, f_refh->y, f_refv->y,
295                                                                           f_refhv->y, 2*i + (k&1), 2*j + (k>>1), 8, dx, dy,                                                                           f_refhv->y, 2*i + (k&1), 2*j + (k>>1), 8, dx, dy,
# Line 353  Line 306 
306                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;                  b_dx = (b_dx & 3) ? (b_dx >> 1) | 1 : b_dx / 2;
307                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;                  b_dy = (b_dy & 3) ? (b_dy >> 1) | 1 : b_dy / 2;
308    
309                  /* --- uv-image-based compensation ---                  transfer_8to16sub2(&dct_codes[4 * 64],
   
                 transfer_8to16sub2_c(&dct_codes[4 * 64],  
310                                                           cur->u + (y * 8) * edged_width / 2 + (x * 8),                                                           cur->u + (y * 8) * edged_width / 2 + (x * 8),
311                                                           get_ref(f_ref->u, f_refh->u, f_refv->u,                                                          interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j,
312                                                                           f_refhv->u, i, j, 8, dx, dy,                                                                                                          b_dx, b_dy, edged_width / 2, 0),
313                                                                           edged_width / 2),                                                          interpolate8x8_switch2(f_refv->u + 8, f_ref->u, 8 * i, 8 * j,
314                                                           get_ref(b_ref->u, b_refh->u, b_refv->u,                                                                                                          dx, dy, edged_width / 2, 0),
                                                                          b_refhv->u, i, j, 8, b_dx, b_dy,  
                                                                          edged_width / 2),  
315                                                           edged_width / 2);                                                           edged_width / 2);
316    
317                  transfer_8to16sub2_c(&dct_codes[5 * 64],                  transfer_8to16sub2(&dct_codes[5 * 64],
318                                                           cur->v + (y * 8) * edged_width / 2 + (x * 8),                                                           cur->v + (y * 8) * edged_width / 2 + (x * 8),
319                                                           get_ref(f_ref->v, f_refh->v, f_refv->v,                                                          interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j,
320                                                                           f_refhv->v, 8 * i, 8 * j, 1, dx, dy,                                                                                                          b_dx, b_dy, edged_width / 2, 0),
321                                                                           edged_width / 2),                                                          interpolate8x8_switch2(f_refv->u + 8, f_ref->v, 8 * i, 8 * j,
322                                                           get_ref(b_ref->v, b_refh->v, b_refv->v,                                                                                                          dx, dy, edged_width / 2, 0),
                                                                          b_refhv->v, 8 * i, 8 * j, 1, b_dx, b_dy,  
                                                                          edged_width / 2),  
323                                                           edged_width / 2);                                                           edged_width / 2);
                  */  
324    
                 /* --- u,v-block-based interpolation & compensation ---  */  
                 interpolate8x8_switch(f_refv->u, f_ref->u, 8 * i, 8 * j,   dx,   dy, edged_width / 2, 0);  
                 interpolate8x8_switch(b_refv->u, b_ref->u, 8 * i, 8 * j, b_dx, b_dy, edged_width / 2, 0);  
                 transfer_8to16sub2_c(&dct_codes[4 * 64],  
                                                            cur->u + 8 * y * edged_width / 2 + 8 * x,  
                                                         f_refv->u + 8 * j * edged_width / 2 + 8 * i,  
                                                         b_refv->u + 8 * j * edged_width / 2 + 8 * i,  
                                                         edged_width / 2);  
   
                 interpolate8x8_switch(f_refv->v, f_ref->v, 8 * i, 8 * j,   dx,   dy, edged_width / 2, 0);  
                 interpolate8x8_switch(b_refv->v, b_ref->v, 8 * i, 8 * j, b_dx, b_dy, edged_width / 2, 0);  
                 transfer_8to16sub2_c(&dct_codes[5 * 64],  
                                                            cur->v + 8 * y * edged_width / 2 + 8 * x,  
                                                         f_refv->v + 8 * j * edged_width / 2 + 8 * i,  
                                                         b_refv->v + 8 * j * edged_width / 2 + 8 * i,  
                                                         edged_width / 2);  
                  /* */  
325                  break;                  break;
326    
327          case MODE_DIRECT:          case MODE_DIRECT:
# Line 407  Line 336 
336    
337  //              fprintf(stderr,"Direct Vector %d -- %d:%d    %d:%d\n",k,dx,dy,b_dx,b_dy);  //              fprintf(stderr,"Direct Vector %d -- %d:%d    %d:%d\n",k,dx,dy,b_dx,b_dy);
338    
339                          transfer_8to16sub2_c(&dct_codes[k * 64],                          transfer_8to16sub2(&dct_codes[k * 64],
340                                                           cur->y + (i*16 + (k&1)*8) + (j*16 + (k>>1)*8 ) * edged_width,                                                           cur->y + (i*16 + (k&1)*8) + (j*16 + (k>>1)*8 ) * edged_width,
341                                                           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,
342                                                                           2*i + (k&1), 2*j + (k>>1), 8, dx, dy,                                                                           2*i + (k&1), 2*j + (k>>1), 8, dx, dy,
# Line 436  Line 365 
365                  if (quarterpel)                  if (quarterpel)
366                          sum /= 2;                          sum /= 2;
367  */  */
368                    transfer_8to16sub2(&dct_codes[4 * 64],
                 /* --- uv-image-based compensation ---  
                 transfer_8to16sub2_c(&dct_codes[4 * 64],  
369                                                           cur->u + (y * 8) * edged_width / 2 + (x * 8),                                                           cur->u + (y * 8) * edged_width / 2 + (x * 8),
370                                                           get_ref(f_ref->u, f_refh->u, f_refv->u,                                                          interpolate8x8_switch2(f_refv->u, b_ref->u, 8 * i, 8 * j,
371                                                                           f_refhv->u, i, j, 8, dx, dy,                                                                                                          b_dx, b_dy, edged_width / 2, 0),
372                                                                           edged_width / 2),                                                          interpolate8x8_switch2(f_refv->u + 8, f_ref->u, 8 * i, 8 * j, dx, dy,
373                                                           get_ref(b_ref->u, b_refh->u, b_refv->u,                                                            edged_width / 2, 0),
                                                                          b_refhv->u, i, j, 8, b_dx, b_dy,  
                                                                          edged_width / 2),  
374                                                           edged_width / 2);                                                           edged_width / 2);
375    
376                  transfer_8to16sub2_c(&dct_codes[5 * 64],                  transfer_8to16sub2(&dct_codes[5 * 64],
377                                                           cur->v + (y * 8) * edged_width / 2 + (x * 8),                                                           cur->v + (y * 8) * edged_width / 2 + (x * 8),
378                                                           get_ref(f_ref->v, f_refh->v, f_refv->v,                                                          interpolate8x8_switch2(f_refv->u, b_ref->v, 8 * i, 8 * j,
379                                                                           f_refhv->v, i, j, 8, dx, dy,                                                                                                          b_dx, b_dy, edged_width / 2, 0),
380                                                                           edged_width / 2),                                                          interpolate8x8_switch2(f_refv->u + 8, f_ref->v, 8 * i, 8 * j,
381                                                           get_ref(b_ref->v, b_refh->v, b_refv->v,                                                                                                          dx, dy, edged_width / 2, 0),
                                                                          b_refhv->v, i, j, 8, b_dx, b_dy,  
                                                                          edged_width / 2),  
382                                                           edged_width / 2);                                                           edged_width / 2);
                 */  
383    
384    
                 /* --- uv-block-based compensation */  
                 interpolate8x8_switch(f_refv->u, f_ref->u, 8 * i, 8 * j,   dx,   dy, edged_width / 2, 0);  
                 interpolate8x8_switch(b_refv->u, b_ref->u, 8 * i, 8 * j, b_dx, b_dy, edged_width / 2, 0);  
                 transfer_8to16sub2_c(&dct_codes[4 * 64],  
                                                            cur->u + 8 * y * edged_width / 2 + 8 * x,  
                                                         f_refv->u + 8 * j * edged_width / 2 + 8 * i,  
                                                         b_refv->u + 8 * j * edged_width / 2 + 8 * i,  
                                                         edged_width / 2);  
   
                 interpolate8x8_switch(f_refv->v, f_ref->v, 8 * i, 8 * j,   dx,   dy, edged_width / 2, 0);  
                 interpolate8x8_switch(b_refv->v, b_ref->v, 8 * i, 8 * j, b_dx, b_dy, edged_width / 2, 0);  
                 transfer_8to16sub2_c(&dct_codes[5 * 64],  
                                                            cur->v + 8 * y * edged_width / 2 + 8 * x,  
                                                         f_refv->v + 8 * j * edged_width / 2 + 8 * i,  
                                                         b_refv->v + 8 * j * edged_width / 2 + 8 * i,  
                                                         edged_width / 2);  
                 /* */  
385                  break;                  break;
386          }          }
387  }  }

Legend:
Removed from v.449  
changed lines
  Added in v.530

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