[XviD-devel] motion compensation->inter4v->BFRAMES->chroma bug?

Christoph Lampert xvid-devel@xvid.org
Wed, 21 Aug 2002 16:34:28 +0200 (CEST)


On Wed, 21 Aug 2002, Radoslaw 'sysKin' Czyz wrote:
> However, I'm still not very sure if the bug is really there:
> If I force all macroblocks to be inter - no bug.
> If I force all macroblocks to be inter4v - no bug. (!)
> If I mix them in any way (even random) - ugly bugs show up. They are
> in chroma only. They dissappear if I force block-based uv compensation.
> 
> I definitely have no idea what this compensation is all about (why
> changing for B frames ??), so I'd need someone who knows it to take a
> look and check if there is no stupid mistake.

For P-frames, we use image based interpolation for lumi and block
based for chroma, because:

without HALFPEL, interpolation is not needed at all for lumi, so then the
whole image interpolation step can be skipped. for chroma, halfpel vector
is even possible with HALFPEL (because they are divided by 2), so
interpolation always has to be done in MC. Since this is only once per
chroma block, we do it block based. 

with HALFPEL, lumi interpolation is done before ME already, so it would be
wasteful to interpolate blocks again in MC, instead we use exisiting
image. 

Now with B-frames, things are different, because due to direct mode,
halfpel position are always possible. Due to this, we first thought, 
HALFPEL _must_ be active if #BFRAMES is defined, and completely relied on
image based interpolation. 
However, that was a bug, because non-HALFPEL is very well possible with
max_bframes=0 or max_bframes=-1, so I forced the behaviour somehow back: 
Chroma is blockinterpolated, if BFRAMES is active, too. 

However, I didn't change it for INTER4V mode, because INTER4V is not
active without HALFPEL (yes, I know, it's possible. But it's not
useful..) 

Maybe that was stupid. Anyway, there is nothing to say against _always_
using block based MC interpolation for chroma. If this could be optimized
for speed somehow later, fine, then let's do it later.

Christoph 


-- 
Christoph H. Lampert chl@math,uni-bonn,de | Diese Signature wurde maschi-     
Beringstr. 6, Raum 14 Tel. (0228) 73-2948 | nell erstellt und bedarf
Sprechstunden: keine, aber meistens da    | keiner Unterschrift. AZ 27B-6