Thursday, March 23, 2006

So what do you do when 640x480@500kbps PSNR is less then 33?

...like PonPom-Final (32.734/32.232) or PonyRide (31.351/31.102)....?

The first thing to do is screw it and go to 500kbps at 480x352 resolution, just because it is easy. But that might not be enough either: LiliPonPom 480x352@500kbps was 34.015/33.729 PSNR and 42.96 SSIM and visual still had some blockiness.

Next thing is to use DeFreq AVISynth plugin to remove some frequencies. The result become a bit blury and FFT takes a bit of time (second pass is 3.81fps vs 5.75fps on D600 or DeFreq is adds about 40% overhead pushing overall FPS close to 1.5 fps vs. above 2). The table bellow shows that using Defreq(cutx=50.0, cuty=50.0, show=0) boosted 400kbps PSNR higher then 500kbps with no filtering, but filtering more Defreq(cutx=400.0, cuty=400.0, show=0) actually made things worse. But at the end 400kbps still was not enough, and the only acceptable picture was at 500kbps with DeFreq 50

480x360/PomPom-50034.015/33.729???/5.75fps
480x360/PomPom-400-DF5035.817/35.503 4.89/3.68fps
480x360/PomPom-400-DF40033.288/33.3034.96/3.98fps
480x360/PomPom-500-DF5036.884/36.5855.16/3.81fps
The same thing happened with Svekla clip. Adding DF 50,50 boosted PSNR to 40.126/40.020 vs. 38.250/38.147, but going all the way to DF 200,200 lowered PSNR back to 38.572/38.466 (Speeds were comporable too 3.6 vs 5.2 fps on 2nd pass). But at the end it didn't help Svekla clip and there are still visible blockiness despite high PSNR.

Using ASP doesn't help either. It makes it even worse LiliPonPom 31.68 PSNR, 42.96SSIM went to 30.31 PSNR, 36.11SSIM with DX6 and to 30.73 PSNR and 39.54SSIM with XVID. So once and for all XVID is better, but both suck.

Anyhow, there gotta be a better way of filtering complex video, otherwise we are back into 600-750kbps range.

Mainconcept MPEG-2

Mainconcept MPEG-2 encoder is about 1/1.5=2/3 or 67% faster then TMPGEnc. The following table shows encoding times on D600 of 8 minute PonPom movie
MethodTimePSNR Y
TMPGEnc 2pass 6Mpbs1:28:1333.4125
Mainconcept 2pass 6Mpbs0:59:1815.0318
x264 2pass1:12:1832.232
As could be noticed from the table PSNR of Mainconcept encoded MPEG-2 is significantly lower and noticably Mainconcept encoded MPEG-2 has sharper interlaced (mouse tooth) artifacts. Overall, Mainconcept suck and not worth the time.

What is surprising is that MPEG-2 encoding is so slow... Even Mainconcept does it in 1/7 = 0.13 real time or at 4 FPS while TMPGEnc at about 3 FPS....

x264 does 2 pass encode at 1/5.25+1/3.58 ~ 1/2 or at about 2 FPS with all the processing (deinterlace, resize, change framerate to 20 FPS), but since there is less frames it is actually faster then encoding to MPEG-2 with TMPGEnc

Followers