[XviD-devel] pre processing

Radek Czyz xvid-devel@xvid.org
Wed, 4 Dec 2002 02:58:19 +1030


Hello everyone,

Michael Militzer wrote:

> Hm, I'm not sure if this is the perfect decision criteria. You seem to be
> very happy to achieve halfpel filesize with dynamic qpel - well, from my
> experience the difference between halfpel and qpel is not simply that qpel
> gives a "crisper" image and has bigger filesize (well, this is what people
> reported over at doom9 and it confused me a lot). In my tests, qpel resulted
> in _smaller_ files than halfpel in nearly all cases. I have one clip where
> qpel gives an advantage of nearly 30% (!!) over halfpel in terms of filesize
> while PSNR is increased as well by about 0.2 dB.

All I can tell now is that my tests confirm what people at doom9 are
saing. A bit bigger (or higher quant at fixed filesize), much
crispier, a bit more noisy. Much better.
I only tested with dvd-like resolutions, maybe you tested with cif or
qcif? As every pixel is much more important in low resolutions, I see
a way that qpel decreses filesize then.
I might be very wrong.

> Maybe qpel just performs very bad on your test clip, but I don't believe
> that qpel is only good for "crisp" scenes and bad on smooth ones.

What I meant was that the bigger filesize might be prevented on smooth
scenes without any noticable quality degradation.
My tests confirmed it (but I didn't compute PSNR..). In my test
clips, qpel is mostly used (I wanted it that way) and codec changes it
to halfpel only in some rare blurry scenes (that's quite rarely,
really). And the filesize difference is 3%, without any degradation -
I can see no difference in those rare blury parts, even if I
know where to look (ffdshow's OSD shows frame type, with qpel info
too).

> decision
> based on high/low motion is something which might be better suited (qpel
> seems to be more successful on slow-motion than high-motion) but I'm not
> sure if this is true in general...

I'm not sure about anything here ;)) But I added a motion check to the
decision and it's much better again. My current idea is that halfpel
should only be used if I don't detect any edges (really low threshold,
ie even a small edge triggers qpel) or when the scene is high motion.
That would make almost all scenes in qpel, and in the rest, we can
really save some bits without anyone noticing.

Pete wrote

> motion search distance comes into play. since qpel halves the max search
> distance, high action scenes will suffer.

Actually, I decrease fcode by one when moving from qpel to halfpel,
and increase it by one when moving to qpel - so I don't change search
range beyond normal fcode treatment.

> ok, assuming we all agree to mpeg-4 conformance and permit only one
> vol per ippp(etc..) sequence,

I humbly agree if I really need to... but that actually ruins the
whole thing. There are many scenes with both fast and slow movement.
Putting an I-VOP just to separete the scene will, of course, do much
more harm that good.
Forgetting the P-frame-based qpel/hpel decision will be a pain to me,
because I really like my current results :( .


Thanks for the comments,
Radek