[XviD-devel] Naive/newbie questions

Greg Handi notarealaccount at yahoo.com
Tue Jun 6 17:58:05 CEST 2006


1) In the file interpolate8x8.c why do several methods say "if
(rounding)" but then do a +1 in the "else" instead? (e.g. below)

  if (rounding) {
    for (j = 0; j < 8*stride; j+=stride) {
      dst[j + 0] = (uint8_t)((src[j + 0] + src[j + 1] )>>1);
      dst[j + 1] = (uint8_t)((src[j + 1] + src[j + 2] )>>1);
      dst[j + 2] = (uint8_t)((src[j + 2] + src[j + 3] )>>1);
      dst[j + 3] = (uint8_t)((src[j + 3] + src[j + 4] )>>1);
      dst[j + 4] = (uint8_t)((src[j + 4] + src[j + 5] )>>1);
      dst[j + 5] = (uint8_t)((src[j + 5] + src[j + 6] )>>1);
      dst[j + 6] = (uint8_t)((src[j + 6] + src[j + 7] )>>1);
      dst[j + 7] = (uint8_t)((src[j + 7] + src[j + 8] )>>1);
    }
  } else {
    for (j = 0; j < 8*stride; j+=stride) {
      dst[j + 0] = (uint8_t)((src[j + 0] + src[j + 1] + 1)>>1);
      dst[j + 1] = (uint8_t)((src[j + 1] + src[j + 2] + 1)>>1);
      dst[j + 2] = (uint8_t)((src[j + 2] + src[j + 3] + 1)>>1);
      dst[j + 3] = (uint8_t)((src[j + 3] + src[j + 4] + 1)>>1);
      dst[j + 4] = (uint8_t)((src[j + 4] + src[j + 5] + 1)>>1);
      dst[j + 5] = (uint8_t)((src[j + 5] + src[j + 6] + 1)>>1);
      dst[j + 6] = (uint8_t)((src[j + 6] + src[j + 7] + 1)>>1);
      dst[j + 7] = (uint8_t)((src[j + 7] + src[j + 8] + 1)>>1);
    }
  }


2) also per the interpolation routines, is there a way to get the "src"
parameter to always be a four byte aligned memory address?  (I realize
this may not be possible/practicle given how it is derived but I
thought I should ask)  If it could be four byte aligned then I could
make use of some very fast specialized DSP instructions I would like to
port to that require 4 byte alignment to work.

Thank-you.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the XviD-devel mailing list