Gmane
From: Steven M. Schultz <sms <at> 2BSD.COM>
Subject: y4mdenoise - some numbers
Newsgroups: gmane.comp.video.mjpeg.user
Date: 2004-05-10 05:31:16 GMT (4 years, 29 weeks, 4 days, 22 hours and 19 minutes ago)
Howdy -

	I'd been experimenting with the new denoiser for a while now but with
	what apparently was very clean material and so did not gain an
	appreciation for the quality improvement that S. Boswell's new
	(y4mdenoise) program can provide.   Then I remembered the data from 
	the last two VHS tapes was still on a disk that had not been reused.

	I had mentioned a little while ago that I would post the results of
	the tests - so here they are.

	Common to all - ~46 minutes (81441 frames)
   		INFO: [mplex] No. Pictures    :    81441

	and the commands used:

-----------snip-------------
#!/bin/sh

N=bmw001

smil2yuv -i 2 -a $N.wav -i 2 $N.smil | \
     y4mshift -n 0 -b 8,0,704,474 | \
     y4mdenoise -t 4 | \
     y4mscaler -v 0 -O size=704x480 -O sar=src -O chromass=420_MPEG2 | \
     bfr -b 20m -T 70 | \
     mpeg2enc -b 8000 -K kvcd -q 4 -2 1 -D 10 -M 2 -E -10 -c -f 8 -o $N.m2v

if [ ! -e $N.mp2 ]; then
        toolame -o -b 192 $N.wav $N.mp2
fi

mplex -f 8 -o $N.mpg $N.m2v $N.mp2
-----------snip-------------

	As a "baseline" with no denoising at all (the y4mdenoise line above
	was deleted) the stats from mplex are:

   INFO: [mplex] No. I Frames    :     5494 avg. size 52978 bytes
   INFO: [mplex] No. P Frames    :    75947 avg. size 19797 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  5283200 bits/sec
   INFO: [mplex] Peak bit-rate    :  9014000  bits/sec

	With y4mdenoise -t 4:

   INFO: [mplex] No. I Frames    :     5494 avg. size 48424 bytes
   INFO: [mplex] No. P Frames    :    75947 avg. size 14523 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  4030400 bits/sec
   INFO: [mplex] Peak bit-rate    :  9067200  bits/sec

	Adding spatial filtering first (and 0.75 is fairly generous/high
	for VHS source material) with y4mspatialfilter -L 4,0.75,3,0.75 
	first followed by  y4mdenoise -t 4.  The command sequence becomes:

---------snip---------
#!/bin/sh

N=bmw001

smil2yuv -i 2 -a $N.wav -i 2 $N.smil | \
     y4mshift -n 0 -b 8,0,704,474 | \
     y4mspatialfilter -L 5,0.75,4,0.75 -C 3,0.5,3,0.5 | \
     y4mdenoise -t 4 | \
     y4mscaler -v 0 -O size=704x480 -O sar=src -O chromass=420_MPEG2 | \
     bfr -b 20m -T 70 | \
     mpeg2enc -b 8000 -K kvcd -q 4 -2 1 -D 10 -M 2 -E -10 -c -f 8 -o $N.m2v

if [ ! -e $N.mp2 ]; then
        toolame -o -b 192 $N.wav $N.mp2
fi

mplex -f 8 -o $N.mpg $N.m2v $N.mp2
---------snip-----------

   INFO: [mplex] No. I Frames    :     5493 avg. size 45951 bytes
   INFO: [mplex] No. P Frames    :    75948 avg. size 11633 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  3344000 bits/sec
   INFO: [mplex] Peak bit-rate    :  9136800  bits/sec

	The I frames dropped slightly in size (< 10%) but removing the 
	HF components outside the range of VHS allowed the P frames to shrink
	almost 20%.

	What about using y4mspatialfilter AFTER y4mdenoise?   Turns out that
	is not as effective (the y4mspatialfilter and y4mdenoise lines in the
	script simply exchanged positions):

   INFO: [mplex] No. Groups      :     5494
   INFO: [mplex] No. I Frames    :     5494 avg. size 46463 bytes
   INFO: [mplex] No. P Frames    :    75947 avg. size 12311 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  3504000 bits/sec
   INFO: [mplex] Peak bit-rate    :  9101200  bits/sec
46205.210u 3889.920s 9:59:39.01 139.2%  0+0k 10+59io 0pf+0w

	Yeah - that is the downside of y4mdenoise at the moment, it's a bit
	slow with the full frame data - 10hrs for a ~46 minute video (on a 
	2GHz G5).  An Altivec (for G4/G5 cpus) assist in key places or
	MMX for IA32 cpus would help out a lot I suspect.   

	The denoising speed is linear with respect to the frame size, so
	the "CVD" (1/2 DVD) size of 352x480 is twice as fast as fullframe, 
	and VCD denoising is 4x faster than full frame (good looking VCDs!).

	With 1/2 (CVD) data y4mdenoise's speed increases to where it's not
	too much slower than yuvdenoise without Altivec (yuvdenoise is MMX
	assisted only - so on a G5 yuvdenoise is slow for me too ;)). 

	With 1/4 (VCD) material the speed of y4mdenoise is such that other
	parts of the encoding chain begin to take more time.

	Bitrate numbers of course don't tell the whole story - they're a useful
	metric of course.  How does the output look when it's played back?
	In a word:  "excellent".   Much of the typical VHS 'sand/grain' noise 
	is gone _and_ the image looks more 'solid' but without being softened 
	or blurred.

	No more VHS tapes in the house to convert so it was a good thing I 
	saved the data for testing ;)   And since I record the MPEG-TS data
	off the air I'm not doing much denoising of analog TV these days.

	By way of comparison (at least for the average bitrate) to yuvdenoise
	three additional encoding runs were made with "yuvdenoise -l 1",
	"-l 2" and "-l 3" respectively.   This was done on a G5 cpu so the
	MMX enhancements were not available.

		-l 1
		----
   INFO: [mplex] No. I Frames    :     5490 avg. size 45521 bytes
   INFO: [mplex] No. P Frames    :    75951 avg. size  8145 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  2556800 bits/sec
   INFO: [mplex] Peak bit-rate    :  9160400  bits/sec
15907.870u 3572.090s 3:57:47.10 136.5%  0+0k 22+78io 0pf+0w

		-l 2
		----
   INFO: [mplex] No. I Frames    :     5489 avg. size 45175 bytes
   INFO: [mplex] No. P Frames    :    75952 avg. size  8211 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  2566000 bits/sec
   INFO: [mplex] Peak bit-rate    :  9396000  bits/sec
15597.220u 3186.790s 3:34:38.20 145.8%  0+0k 7+137io 0pf+0w

		-l 3
		----
   INFO: [mplex] No. I Frames    :     5491 avg. size 45308 bytes
   INFO: [mplex] No. P Frames    :    75950 avg. size  8521 bytes
   INFO: [mplex] No. B Frames    :        0 avg. size     0 bytes
   INFO: [mplex] Average bit-rate :  2637200 bits/sec
   INFO: [mplex] Peak bit-rate    :  9460800  bits/sec
15730.460u 3187.570s 3:45:04.83 140.0%  0+0k 9+106io 0pf+0w

	Interesting that as the length  of the filter increases from 1 to 3
	that the average bitrate increases gradually.

	And that's the report - hope it wasn't too boring ;)

	Cheers,
	Steven Schultz

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3