[MPlayer-users] lavc psnr mixup

Loren Merritt lorenm at u.washington.edu
Wed Sep 8 00:48:01 CEST 2004


The PSNR values in the psnr_*.log generated by mencoder/lavc seem to be
matched up to the wrong frame numbers. This occurs consistently on all
input videos and all lavcopts, including different vcodec's.
The offset is (3 + vmax_b_frames), and happens in display order, even
though stats are output in encoded order.
The other stats (qp, size, frame type) are matched to the correct
frame number.
The PSNRs that get bumped off the end due to this offset are not used
when calculating the PSNR summary printed by mencoder, but the "inf"s
inserted at the beginning are also not counted in that summary.

I had a quick look in the source, but couldn't find anywhere (either
in ve_lavc.c or in libavcodec/) that the psnr computations referred to
any frame other than the current.

Version:
MEncoder dev-CVS-040906-23:51-3.3.1 (C) 2000-2004 MPlayer Team

Example:
I constructed a video of 8 identical high complexity frames followed by 8 identical low complexity frames.

$> mencoder in.avi -ovc lavc -lavcopts vqscale=2:psnr:keyint=1
$> cat psnr_150806.log
     0, 2.00,  65322, inf, inf, inf, inf I
     1, 2.00,  65322, inf, inf, inf, inf I
     2, 2.00,  65322, inf, inf, inf, inf I
     3, 2.00,  65322, 46.60, 47.72, 49.43, 47.14 I
     4, 2.00,  65322, 46.60, 47.72, 49.43, 47.14 I
     5, 2.00,  65322, 46.60, 47.72, 49.43, 47.14 I
     6, 2.00,  65322, 46.60, 47.72, 49.43, 47.14 I
     7, 2.00,  65322, 46.60, 47.72, 49.43, 47.14 I
     8, 2.00,  21860, 46.60, 47.72, 49.43, 47.14 I
     9, 2.00,  21860, 46.60, 47.72, 49.43, 47.14 I
    10, 2.00,  21860, 46.60, 47.72, 49.43, 47.14 I
    11, 2.00,  21860, 50.19, 50.58, 50.25, 50.26 I
    12, 2.00,  21860, 50.19, 50.58, 50.25, 50.26 I
    13, 2.00,  21860, 50.19, 50.58, 50.25, 50.26 I
    14, 2.00,  21860, 50.19, 50.58, 50.25, 50.26 I
    15, 2.00,  21860, 50.19, 50.58, 50.25, 50.26 I

$> mencoder in.avi -ovc lavc -lavcopts vqscale=2:psnr
$> cat psnr_150809.log
     0, 2.00,  65322, inf, inf, inf, inf I
     1, 2.00,    282, inf, inf, inf, inf P
     2, 2.00,    213, inf, inf, inf, inf P
     3, 2.00,    201, 46.60, 47.72, 49.43, 47.14 P
     4, 2.00,    208, 46.60, 47.72, 49.43, 47.15 P
     5, 2.00,    197, 46.61, 47.71, 49.43, 47.15 P
     6, 2.00,    206, 46.61, 47.72, 49.43, 47.15 P
     7, 2.00,    197, 46.61, 47.71, 49.43, 47.15 P
     8, 2.00,  21860, 46.61, 47.71, 49.43, 47.15 I
     9, 2.00,    287, 46.61, 47.71, 49.43, 47.15 P
    10, 2.00,    194, 46.61, 47.71, 49.43, 47.15 P
    11, 2.00,    176, 50.19, 50.58, 50.25, 50.26 P
    12, 2.00,    173, 50.21, 50.59, 50.26, 50.28 P
    13, 2.00,    173, 50.21, 50.60, 50.26, 50.28 P
    14, 2.00,    173, 50.21, 50.60, 50.26, 50.28 P
    15, 2.00,    173, 50.21, 50.60, 50.26, 50.28 P

$> mencoder in.avi -ovc lavc -lavcopts vqscale=2:psnr:vmax_b_frames=1
$> cat psnr_150815.log
     0, 0.00,      0, inf, inf, inf, inf ?
     0, 2.00,  65323, inf, inf, inf, inf I
     1, 2.00,    282, inf, inf, inf, inf P
     2, 2.00,     45, inf, inf, inf, inf B
     3, 2.00,    213, 46.61, 47.71, 49.43, 47.15 P
     4, 2.00,     14, inf, inf, inf, inf B
     5, 2.00,    201, 46.61, 47.72, 49.43, 47.15 P
     6, 2.00,     16, 46.60, 47.72, 49.43, 47.14 B
     7, 2.00,  21861, 46.61, 47.72, 49.43, 47.15 I
     8, 2.00,   1335, 46.60, 47.72, 49.43, 47.15 B
     9, 2.00,    287, 46.61, 47.71, 49.43, 47.15 P
    10, 2.00,     66, 46.61, 47.71, 49.43, 47.15 B
    11, 2.00,    194, 50.22, 50.59, 50.27, 50.28 P
    12, 2.00,     16, 46.61, 47.72, 49.43, 47.15 B
    13, 2.00,    176, 50.21, 50.60, 50.26, 50.28 P
    14, 2.00,     10, 50.19, 50.58, 50.25, 50.26 B


--Loren Merritt




More information about the MPlayer-users mailing list