[XviD-devel] dark blocks in b-frames

Radek Czyz radoslaw at syskin.cjb.net
Sat Feb 15 00:25:30 CET 2003


Hi,

>ref1[N] and ref2[N] are both uint8_t. Is it possible that the compiler
>decides to calculate the sum in 8bits unsigned before dividing by 2, thus
>overflowing if the sum is larger than 255? Then of course r would be too
>small, and since r is subtracted from c, the values would end up being too
>large = bright.

I had the same idea, and I changed the code to

  int r = ((int)ref1[j * stride + i] + (int)ref2[j * stride +i] + 1) / 2;

And it didn't help. Please remember that we're talking about the
values being too big by 2..5 ...

About the compiler, I can only say that Intel Compiler gives the same
result.



More information about the XviD-devel mailing list