[XviD-devel] want to give a hand

Dead2 xvid-devel@xvid.org
Wed, 24 Jul 2002 18:24:58 +0200


-snip-
> 2) the routine interpolates between the two images: from ref to ref+47
> pixels, and from ref to ref+47 rows and saves the result to dest area.
> An advanced version could get an extra "rounding" flag, that tells whether
> to round up or down, but for the beginning, this is not needed.
>
> gruel

The correct rounding would be ((A+B)+0.5)/2 if I remember correctly.
That will give the most accurate rounding possible unless you actually
need the option to increase/decrease..

EX:
(133+132)/2 = 132,5 = 132 int
((133+132)/2)+0.5 = 133 int
In this case 133 is the correct number, not 132!

This way of rounding is what I have found the most accurate for bilinear
resizing.. This is to prevent colorbleeding of course.
Should be the same case here.

-=Dead2=-