Re[2]: [XviD-devel] image interpolation question

Radek 'sysKin' Czyz xvid-devel@xvid.org
Thu, 28 Nov 2002 01:39:24 +1030


> Our qpel lowpass filter accesses 6 pixels (-2, +3 around center iirc), if
> you interpolate the whole edged image, 2 pixels (left) and 3 pixels (right)
> are read from outside the allocated buffer (the same is true for top and
> bottom), which makes XVID crash with an access violation. My fix for this
> problem was to double the edge size of our internal image buffer and only
> interpolate (and access) half the edged size. So when I commited this fix,
> encoding behaviour did not change at all (this was intended) and the
> problems with crashes had been fixed (was also intended)...

Sorry, maybe I didn't say it clear.
I meant about the 'stride' value used to move from one block line
(which is 8*edged_width) to another.

You start at half of edge size. Then, you interpolate, in 8x8 blocks,
until you stop at half of the other edge.
Now, to move your pointer to another line of 8x8 blocks, you must:
- move half edge to the real end of the line
- move seven lines down (eighth line is already there)
- move another half edge to your new start

which sums to EDGE_SIZE + 7*edged_width

but you do EDGE_SIZE2 + 7*edged_width

and this is what I don't understand. In the first loop, it's ok.

Please check, I really don't want to create buggy code (did too much
of it already).

Radek