[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec mpegvideo.c,1.498,1.499

Corey Hickey bugfood-ml
Fri Jan 27 05:41:50 CET 2006

Michael Niedermayer CVS wrote:
> Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
> In directory mail:/var2/tmp/cvs-serv28677
> Modified Files:
> 	mpegvideo.c 
> Log Message:
> b frame strategy 2

I finally got around to testing this, with the usual source: The Matrix.

I used mencoder CVS from 2006-01-19. My general encoding command is:

for i in 1:turbo 2 ; do
  mencoder ~/dumpstream/matrix.vob -aid 128 -oac copy -vf \
crop=718:356:0:60,scale=640:272 -sws 9 -ovc lavc -lavcopts \
vmax_b_frames=2:qpel:sc_factor=6 -ofps 24000/1001 -o test.avi

Here are some various numeric results.

  pass 1:
PSNR: Y:40.09, Cb:44.35, Cr:44.66, All:41.13
user    44m32.577s
  pass 2:
PSNR: Y:42.10, Cb:45.17, Cr:45.87, All:42.97
user    253m48.068s
frame counts: I: 3418 1%  P: 61938 31%  B: 130710 66%
average qps:  I: 3.009655 P:2.894733 B:5.003618

  pass 1:
PSNR: Y:40.07, Cb:44.25, Cr:44.54, All:41.09
user    41m23.155s
  pass 2:
PSNR: Y:42.04, Cb:44.98, Cr:45.62, All:42.87
user    216m36.802s
frame counts: I: 3370 1%  P: 117916 60%  B: 74780 38%
average qps:  I: 3.418101 P:3.483955 B:5.035330

  pass 1:
PSNR: Y:39.69, Cb:43.88, Cr:44.10, All:40.71
user    301m18.478s
  pass 2:
PSNR: Y:41.80, Cb:44.69, Cr:45.25, All:42.62
user    175m5.316s
frame counts: I: 3461 1%  P: 191454 97%  B: 1151 0%
average qps:  I: 3.871424 P:3.598206 B:7.099101

  pass 1:
PSNR: Y:39.87, Cb:44.02, Cr:44.24, All:40.89
user    114m29.259s
  pass 2:
PSNR: Y:41.83, Cb:44.75, Cr:45.33, All:42.66
user    177m19.750s
frame counts: I: 3464 1%  P: 188111 95%  B: 4491 2%
average qps:  I: 3.844111 P:3.525535 B:7.184146

  pass 1:
PSNR: Y:39.88, Cb:44.03, Cr:44.24, All:40.89
user    64m21.692s
  pass 2:
PSNR: Y:41.83, Cb:44.76, Cr:45.34, All:42.66
user    178m6.951s
frame counts: I: 3463 1%  P: 184997 94%  B: 7606 3%
average qps:  I: 3.817499 P:3.503954 B:6.764923

  pass 1:
PSNR: Y:39.83, Cb:44.02, Cr:44.26, All:40.86
user    47m23.826s
  pass 2:
PSNR: Y:41.82, Cb:44.77, Cr:45.34, All:42.65
user    181m26.558s
frame counts: I: 3435 1%  P: 178333 90%  B: 14298 7%
average qps:  I: 3.813683 P:3.504388 B:6.178067

  pass 1:
PSNR: Y:39.96, Cb:44.16, Cr:44.42, All:40.99
user    43m28.237s
  pass 2:
PSNR: Y:41.92, Cb:44.89, Cr:45.50, All:42.76
user    199m49.870s
frame counts: I: 3390 1%  P: 145493 74%  B: 47183 24%
average qps:  I: 3.579056 P:3.429801 B:5.470042

I can't test brd_scale=5 and higher now, due to the bug I just reported;
however, the results aren't good for lower values of brd_scale. The PSNR
values are fairly representative of the relative qualities of the
different encodes -- all the ones with vb_strategy=2 look much worse in
high-motion scenes than the encode with vb_strategy=0. brd_scale=4 looks
a bit better than brd_scale=0. From the frame counts, it seems that
there just aren't enough B-frames being used to make an improvement....

It's possible that vb_strategy=2 with a high brd_scale is an
improvement, and perhaps using a higher vmax_b_frames will help. I won't
test that until the bug with brd_scale is fixed, though, in case it
could alter my results.


More information about the ffmpeg-cvslog mailing list