[Ffmpeg-devel] xvid ratecontrol tests

Corey Hickey bugfood-ml
Fri Mar 17 05:54:24 CET 2006


I tested xvid ratecontrol on The Matrix with my current set of "best"
encoding parameters:

for i in 1:turbo:vb_strategy=2 2 ; do
  time mencoder ~/dumpstream/matrix.vob -nosound -vf \
  crop=718:356:0:60,scale=640:272 -sws 9 -ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=581:psnr:vpass="$i":mbd=2:mv0:trell:cbp:precmp=2:\
cmp=2:subcmp=2:predia=2:dia=2:preme=2:vme=5:v4mv:last_pred=2:\
vmax_b_frames=2:qpel:sc_factor=6:vqcomp=0.6 -ofps 24000/1001 -o test.avi
done

Despite fairly reasonable PSNR values, the xvid ratecontrol videos look
pretty bad. I don't know what is wrong, and I intend to test a reduced
set of options to see if the problem stems from B-frames or something.
Meanwhile, though, here's what I have.

-------------------------- size, PSNR ------------------------
vrc_strategy=0
  (pass 1)
Video stream:  580.821 kbit/s  (72602 B/s)  size: 593726235 bytes
8177.753 secs  196070 frames
PSNR: Y:40.24, Cb:44.40, Cr:44.73, All:41.26
user    124m2.806s
  (pass 2)
Video stream:  580.810 kbit/s  (72601 B/s)  size: 593714565 bytes
8177.753 secs  196070 frames
PSNR: Y:42.17, Cb:45.16, Cr:45.86, All:43.03
user    180m7.280s

-----
vrc_strategy=1  (pass 1 same as above)
  (pass 2)
Video stream:  580.897 kbit/s  (72612 B/s)  size: 593803527 bytes
8177.753 secs  196070 frames
PSNR: Y:40.82, Cb:44.35, Cr:44.74, All:41.75
user    128m8.650s

----
vrc_strategy=1 with vqscale=2 for pass 1
  (pass 1)
Video stream: 1646.741 kbit/s  (205842 B/s)  size: 1683330389 bytes
8177.753 secs  196070 frames
PSNR: Y:44.90, Cb:46.79, Cr:47.98, All:45.57
user    219m24.142s
  (pass 2)
Video stream:  707.281 kbit/s  (88410 B/s)  size: 722996517 bytes
8177.753 secs  196070 frames
PSNR: Y:41.49, Cb:44.92, Cr:45.73, All:42.43
user    123m44.253s


--------------------------- qp histograms ---------------------------
vrc_strategy=0
qp   frames   histogram; each '=' is 1000 frames
 1 :      0
 2 :  20446   ====================
 3 :  43630   ===========================================
 4 :  57627   =========================================================
 5 :  47546   ===============================================
 6 :  16759   ================
 7 :   5595   =====
 8 :   2564   ==
 9 :    926
10 :    365
11 :    256
12 :    234
13 :    103
14 :      5
15 :      3
16 :      3
17 :      1
18 :      0
19 :      2
20 :      0
21 :      1
22 :      1

----
vrc_strategy=1
qp   frames   histogram; each '=' is 1000 frames
 1 :      0
 2 :  34900   ==================================
 3 :  47687   ===============================================
 4 :  45625   =============================================
 5 :  23429   =======================
 6 :  17692   =================
 7 :   7182   =======
 8 :   7300   =======
 9 :   3120   ===
10 :   2952   ==
11 :   1764   =
12 :   1401   =
13 :    805
14 :    668
15 :    313
16 :    344
17 :    167
18 :    184
19 :     77
20 :    111
21 :     81
22 :     94
23 :     30
24 :     37
25 :     11
26 :     16
27 :      8
28 :     17
29 :      6
30 :     28
31 :     18

There's an obvious shift toward lower and higher QPs here, with fewer in
the middle.

----
vrc_strategy=1 with vqscale=2 for pass 1

qp   frames   histogram; each '=' is 1000 frames
 1 :      0
 2 :  32922   ================================
 3 :     42
 4 :     66
 5 :    757
 6 : 115414
===================================================================================================================
 7 :  46866   ==============================================

Something is clearly wrong here.

----
For comparison, here's the histogram for xvid itself:
qp   frames   histogram; each '=' is 1000 frames
 1 :      0
 2 :   2937   ==
 3 :  30165   ==============================
 4 :  63180
===============================================================
 5 :  36024   ====================================
 6 :  30406   ==============================
 7 :  32396   ================================
 8 :    958



-Corey





More information about the ffmpeg-devel mailing list