[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 831, Wed Feb 12 11:46:18 2003 UTC revision 832, Wed Feb 12 11:48:21 2003 UTC
# Line 173  Line 173 
173          }          }
174  }  }
175    
176    
177    static __inline void
178    compensate16x16_interpolate_ro(int16_t * const dct_codes,
179                                                                    const uint8_t * const cur,
180                                                                    const uint8_t * const ref,
181                                                                    const uint8_t * const refh,
182                                                                    const uint8_t * const refv,
183                                                                    const uint8_t * const refhv,
184                                                                    uint8_t * const tmp,
185                                                                    const uint32_t x, const uint32_t y,
186                                                                    const int32_t dx, const int32_t dy,
187                                                                    const int32_t stride,
188                                                                    const int quarterpel)
189    {
190            const uint8_t * ptr;
191    
192            if(quarterpel) {
193                    if ((dx&3) | (dy&3)) {
194                            interpolate16x16_quarterpel(tmp - y * stride - x,
195                                                                                    (uint8_t *) ref, tmp + 32,
196                                                                                    tmp + 64, tmp + 96, x, y, dx, dy, stride, 0);
197                            ptr = tmp;
198                    } else ptr =  ref + (y + dy/4)*stride + x + dx/4; // fullpixel position
199    
200            } else ptr = get_ref(ref, refh, refv, refhv, x, y, 1, dx, dy, stride);
201    
202            transfer_8to16subro(dct_codes, cur + y * stride + x,
203                                                      ptr, stride);
204            transfer_8to16subro(dct_codes+64, cur + y * stride + x + 8,
205                                                      ptr + 8, stride);
206            transfer_8to16subro(dct_codes+128, cur + y * stride + x + 8*stride,
207                                                      ptr + 8*stride, stride);
208            transfer_8to16subro(dct_codes+192, cur + y * stride + x + 8*stride+8,
209                                                      ptr + 8*stride + 8, stride);
210    
211    }
212    
213    
214  /* XXX: slow, inelegant... */  /* XXX: slow, inelegant... */
215  static void  static void
216  interpolate18x18_switch(uint8_t * const cur,  interpolate18x18_switch(uint8_t * const cur,
# Line 263  Line 301 
301          if ( (!reduced_resolution) && (mb->mode == MODE_NOT_CODED) ) {  /* quick copy for early SKIP */          if ( (!reduced_resolution) && (mb->mode == MODE_NOT_CODED) ) {  /* quick copy for early SKIP */
302  /* early SKIP is only activated in P-VOPs, not in S-VOPs, so mcsel can never be 1 */  /* early SKIP is only activated in P-VOPs, not in S-VOPs, so mcsel can never be 1 */
303    
 /*              if (mb->mcsel) {  
                         transfer16x16_copy(cur->y + 16 * (i + j * edged_width),  
                                                    refGMC->y + 16 * (i + j * edged_width),  
                                                    edged_width);  
                         transfer8x8_copy(cur->u + 8 * (i + j * edged_width/2),  
                                                         refGMC->u + 8 * (i + j * edged_width/2),  
                                                         edged_width / 2);  
                         transfer8x8_copy(cur->v + 8 * (i + j * edged_width/2),  
                                                         refGMC->v + 8 * (i + j * edged_width/2),  
                                                         edged_width / 2);  
                 } else  
 */  
                 {  
304                          transfer16x16_copy(cur->y + 16 * (i + j * edged_width),                          transfer16x16_copy(cur->y + 16 * (i + j * edged_width),
305                                                     ref->y + 16 * (i + j * edged_width),                                                     ref->y + 16 * (i + j * edged_width),
306                                                     edged_width);                                                     edged_width);
# Line 286  Line 311 
311                          transfer8x8_copy(cur->v + 8 * (i + j * edged_width/2),                          transfer8x8_copy(cur->v + 8 * (i + j * edged_width/2),
312                                                          ref->v + 8 * (i + j * edged_width/2),                                                          ref->v + 8 * (i + j * edged_width/2),
313                                                          edged_width / 2);                                                          edged_width / 2);
                 }  
314                  return;                  return;
315          }          }
316    
317          if ((mb->mode == MODE_NOT_CODED || mb->mode == MODE_INTER          if ((mb->mode == MODE_NOT_CODED || mb->mode == MODE_INTER
318                                  || mb->mode == MODE_INTER_Q) /*&& !quarterpel*/) {                                  || mb->mode == MODE_INTER_Q)) {
319    
320          /* reduced resolution + GMC:  not possible */          /* reduced resolution + GMC:  not possible */
321    
# Line 400  Line 424 
424                                                          f_refv->y, f_refhv->y, tmp, 16 * i, 16 * j, dx,                                                          f_refv->y, f_refhv->y, tmp, 16 * i, 16 * j, dx,
425                                                          dy, edged_width, quarterpel, 0, 0);                                                          dy, edged_width, quarterpel, 0, 0);
426    
427                  dx /= 1 + quarterpel;                  if (quarterpel) { dx /= 2; dy /= 2; }
428                  dy /= 1 + quarterpel;  
429                  CompensateChroma(       (dx >> 1) + roundtab_79[dx & 0x3],                  CompensateChroma(       (dx >> 1) + roundtab_79[dx & 0x3],
430                                                          (dy >> 1) + roundtab_79[dy & 0x3],                                                          (dy >> 1) + roundtab_79[dy & 0x3],
431                                                          i, j, cur, f_ref, tmp,                                                          i, j, cur, f_ref, tmp,
# Line 412  Line 436 
436          case MODE_BACKWARD:          case MODE_BACKWARD:
437                  b_dx = bmvs->x; b_dy = bmvs->y;                  b_dx = bmvs->x; b_dy = bmvs->y;
438    
439                  compensate16x16_interpolate(&dct_codes[0 * 64], cur->y, b_ref->y, b_refh->y,                  compensate16x16_interpolate_ro(&dct_codes[0 * 64], cur->y, b_ref->y, b_refh->y,
440                                                          b_refv->y, b_refhv->y, tmp, 16 * i, 16 * j, b_dx,                                                          b_refv->y, b_refhv->y, tmp, 16 * i, 16 * j, b_dx,
441                                                          b_dy, edged_width, quarterpel, 0, 0);                                                                                  b_dy, edged_width, quarterpel);
442    
443                    if (quarterpel) { b_dx /= 2; b_dy /= 2; }
444    
                 b_dx /= 1 + quarterpel;  
                 b_dy /= 1 + quarterpel;  
445                  CompensateChroma(       (b_dx >> 1) + roundtab_79[b_dx & 0x3],                  CompensateChroma(       (b_dx >> 1) + roundtab_79[b_dx & 0x3],
446                                                          (b_dy >> 1) + roundtab_79[b_dy & 0x3],                                                          (b_dy >> 1) + roundtab_79[b_dy & 0x3],
447                                                          i, j, cur, b_ref, tmp,                                                          i, j, cur, b_ref, tmp,

Legend:
Removed from v.831  
changed lines
  Added in v.832

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