View Single Post
Old 22nd February 2008, 16:35   #12  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
I'm already working on it for some time, the general idea is about the same, variance based.
Will be in the next HCenc release.

Just had a look at the implementation in Xvid, well, I'm a C n00b but when I do something like this in Fortran it will overflow on high luminance values:

Code:
  for (k = 0; k < 16; k++)
      for (l = 0; l < 16; l++)
         {
             int val = ptr[k*data->current.stride[0] + l];
             sum += val;
             sum_of_squares += val * val;
         }

  /* Variance = SSD - SAD^2 / (numpixels) */
  int variance = sum_of_squares - sum * sum / 256;
__________________
HCenc at: http://hank315.nl
hank315 is offline   Reply With Quote