Log in

View Full Version : Processor Upgrade Causes Avisynth (2.5.8, MT, 32-bit) Artifacts


CarlEdman
2nd May 2011, 21:06
I have been the following script (or variations thereof) for years with good success:
SetMTMode(2,0)
DGDecode_mpeg2source("Monsters Inc. (2001) Ad T01.d2v", info=3, idct=3, cpu=6)
ColorMatrix(d2v="Monsters Inc. (2001) Ad T01.d2v", interlaced=true)
TomsMoComp(1,5,1)
autocrop(threshold=30,wMultOf=4, hMultOf=2,samples=51, mode=0)
Interleaved2Planar()
super = MSuper(planar=true)
bv1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
fv1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
bv2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
fv2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
bv3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
fv3 = MAnalyse(super, isb = false, delta = 3, overlap=4)
MDegrain3(super,bv1,fv1,bv2,fv2,bv3,fv3,thSAD=400,planar=true)
Planar2Interleaved()
Distributor()
A few days ago I upgraded from an Intel Q9300 (4-cores/4-threads) system to a Core i7-970 system (6-cores/12-threads). I continued using avisynth 2.5.8 MT, Windows 7 x64, and the latest x264 64-bit version.
But with same avisynth/script on the new system, all dozen or so test files generate the same strange artifacts: Color flickering points, not unlike old broadcast TV static, in most but not all frames.
Suspecting that the issue may related to the up-to-twelve threads, I experimented with limiting the threads with SetMTMode.
SetMTMode(2,1) to SetMTMode(2,4) eliminated the flickering artifacts (though with a very slight ~0.1% increase in file size--a worthwhile tradeoff for the speed increase).
Starting at SetMTMode(2,5) (and SetMTMode(2,0) which should default to 12, right?) the artifacts reappeared (and unsurprisingly the x264 output size went up by about 40%--clearly all that static required more bits).
Has anybody experienced anything like this or can offer any advice? Would avisynth 2.6 help? 64-bit avisynth 2.5.8 or 2.6? What versions do you recommend--most binaries I can find seem a year or so old--surely there has been progress since then?
Thanks for any pointers or advice!:thanks:

Didée
2nd May 2011, 21:11
No good idea to run mpeg2source multithreaded. Try like so:

SetMTMode(5,0)
DGDecode_mpeg2source("Monsters Inc. (2001) Ad T01.d2v", info=3, idct=3, cpu=6)
ColorMatrix(d2v="Monsters Inc. (2001) Ad T01.d2v", interlaced=true)
TomsMoComp(1,5,1)
autocrop(threshold=30,wMultOf=4, hMultOf=2,samples=51, mode=0)
Interleaved2Planar()
SetMTmode(2)
super = MSuper(planar=true)
bv1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
fv1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
bv2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
fv2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
bv3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
fv3 = MAnalyse(super, isb = false, delta = 3, overlap=4)
MDegrain3(super,bv1,fv1,bv2,fv2,bv3,fv3,thSAD=400,planar=true)
Planar2Interleaved()
Distributor()

BTW, what's the point with MDegrain-processing in YUY2, when the source is YV12 to begin with?

Also, TomsMoComp is more or less outdated. Dotty artifact alert.

CarlEdman
2nd May 2011, 21:57
Thanks, Didée. Once again you nailed it.

Slightly surprising that DGDecode is thread-save at up to 4 threads, but ceases to be at 5. But it is of course entirely possible, and given the experiment, it seems likely. With only the MDegrain-ing done at MTMode 2, the i970-70 is happy and fully loaded and there are no artifacts.

Re TomsMoComp: I actually asked you about that a week or two ago and you gave very helpful advice on a superior alternative. Implementing that is on my ToDo list, but in the meantime I've been reasonably happy with TomsMoComp for content which is usually pretty low-quality anyway. Movies and other content were quality is most critical are happily almost all 24 fps anyway and my scripts telecide, rather than de-interlace them, automatically.

Re YUV2 v. YV12: I thought MDegrain was faster in planar representation. See MVTools2 Doc (http://avisynth.org.ru/mvtools/mvtools2.html) ("How to use planar option for faster processing of YUY2"). Did I misread that?

Didée
2nd May 2011, 23:42
It's only faster when the source already is in YUY2, since processing in interleaved format is inherently slower than processing a planar format. However, YV12 already is a planar format to start with. Therefore, with a YV12 source you only have drawbacks: first an unnecessary conversion, then 50% more color data needs to be processed (with the 50% are only interpolated values), and finally the unnecessary conversion needs to be back-converted.

All in all, that's not very profitable. ;)

CarlEdman
3rd May 2011, 00:21
Then, my poor CPU has wasted many a cycle over the years. I will correct my scripts immediately. Thanks again, Didée!