Log in

View Full Version : @ dev's: a vid sample that crashes XviD reliably


Didée
6th September 2006, 09:17
The file is hosted here:
http://rapidshare.de/files/32120026/CrashingXviD.rar.html
(26MB, Huffyuv (ffdshow/YV12), 200 frames)

It's a preprocessed sample of a DVB-S capture. The sample is error-free, and other encoders than XviD encode it fine. There's not any error message when XviD crashes. Window's hourglass will come up for half a second, then the host application silently vanishes.

From the source's side, it seems related to the "special effect" that is used here: motion in every 4th frame only, with 3 almost-dups inbetween.
(My problem is that this effect is used quite frequently in the series' episodes, so there are many many places where XviD is likely to crash... :( )

On the encoder side, the error seems related to VHQ-search for Bframes ++ (guesswork->) block skip detection. Here's what I figured so far:

Needed settings to crash XviD are: use Qpel and use Bframes and VHQ for Bframes. (No crashing if these settings are not met.) With these settings, the behavior is:

- with "turbo" on, XviD will *always* crash.
- with "turbo" off, VHQ1 will crash, VHQ4 will get through without error.

When adding more and more noise (addgrain(1), addgrain(2), etc.), it is possible to get lower VHQ levels to encode without error. That's why I think it's somehow related to skip detection.
Interesting: VHQ=0 + VHQ for Bframes (funny combination) still will crash.

The error seems not related to optimizations. When deactivating all optimizations, XviD still crashes. (edit: Seems to be in MMX optimizations.)
The source vertically is only MOD8, but tests with MOD16 showed the same behaviour.
I've tested XviD vfw only. Two builds, an 1.2.0dev build from Dec 2005, and celtic's latest MTK build, behaved exactly the same.

squid_80
6th September 2006, 10:36
Using your settings, it crashes in interpolate8x8_avg2_mmx. By turning off optimizations or resizing to mod 16 I can't get it to crash.

Didée
6th September 2006, 12:09
Confirmation on MMX optimizations. (Could be I was fooled, because vfw somehow won't remember that setting. )
No crash when MMX is turned off.

MOD of vertical resolution is another story:
- MOD16 (x*560) will crash.
- MOD32 (x*544) will not crash.

squid_80
6th September 2006, 14:03
How did you adjust the height? I've tried crops, resizing and addborders and they all seem to avoid the crash. An exception is cropping the top border by a multiple of 16.

(encraw commandline for checking quickly: xvid_encraw -i crashingxvid.avi -bvhq -turbo -vhqmode 1 -qpel -start 64)

sysKin
7th September 2006, 03:39
Crash confirmed. I'm very busy these days ;_; but I'll see what I can do.

It must be some silly bug, because non-mod16 pictures are padded to nearest mod16 very early in encoding process. And then, non-mod-16-ness no longer changes anything.

Didée
7th September 2006, 13:05
For the record, I tested a little on 2 different machines:

With a stone-old P3 machine :
- crash: source MOD8 or MOD16
- works: source MOD32
- works: disabling optimizations

With an AthlonXP(1800+) :
- crash: source MOD8/MOD16
- crash: source MOD32
- crash: disabling optimizations

... I'm clueless. On the Athlon, using VHQ=4 seems the only way to prevent XviD from crashing on this sample, when qpel + Bframe-VHQ is used.