Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Denoising Filters - Compression And Speed Test, Objective test of denoising filters.
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
smokeslikeapoet
Posted: Jun 16 2004, 12:38 AM


Unregistered









The use of denoising filters has two purposes. Denoisning filters can help clean up and smooth video such as vhs and tv captures that contain random noise and grainy appearance. The second use is to enhance the compression capabilities of MPEG and other codecs.

For the first part of this test I will be taking an NTSC DVD clip that is a montage of some 1980's and early 1990's television clips, some of which are extremely poor quality. To make matters worse the video is 30 fps interlaced, with some terrible interlacing artifacts and rainbows.

I deinterlaced all clips with the fielddeinterlace command. I encoded the files with XviD 1.0 at a constant quantizer of 2 without b-frames or advanced features. I then recoreded the processing time and resulting AVI file size. The reason I used a codec is to accentuate the effect on compressibility. I could have used the cinemacraft mpeg2 encoder, but it only works the the YUV2 color space. By using Xvid I eliminated the time taken for color space conversions. I used Microsoft Excel to render the final results.

For the control I used the following script.
CODE

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
mpeg2source("D:\REAGAN\VIDEO_TS\reagan.d2v")
crop(2,0,716,480)
FieldDeinterlace()
LanczosResize(640,480)

For the denoised clips I used the following script.
CODE

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
mpeg2source("D:\video_test\video.d2v")
crop(2,0,716,480)
SeparateFields()
odd=SelectOdd.DenoisingFilter(Parameters)
evn=SelectEven.DenoisingFilter(Parameters)
Interleave(evn,odd)
Weave()
FieldDeinterlace()
LanczosResize(640,480)

"DenoisingFilter(Parameters)" is a variable for the filter plugin and it's parameters. To efficiently denoise interlaced 30fps content the even and odd frames are denoised separately before the deinterlacing step. Next post, the results:
 
  Top
smokeslikeapoet
Posted: Jun 16 2004, 01:10 AM


Unregistered









The results of my test on a few basic denoising filters. The filter settings are the basic ones recommended by GordianKnot. I plan to add others as time allows.

An explaination of the results:
You will find the filter name with the parameters followed by three numerical values. The first value is the percent of bytes saved when compared to the unfiltered result. The second value is the increase in percent of time it takes to encode with the filter. The third value is derived by dividing the percent of disk space saved by the percentage increase of time expended. A value of less than one is inefficient, and a value of greater than one is very efficient.

Example: When Convolution3d("moviehq") is used the resulting AVI file was 88.5 percent of the unfiltered file, there was a 15.4 percent increase in the time it took to process when compared with the original. Since the efficiency ratio is close to 1.0 the filter is only moderately efficient
CODE

Unfiltered 100.0%,0.0%,...
Undot() 97.7%,0.0%,...
Convolution3d("moviehq") 88.5%,15.4%,0.75
Convolution3d("moviehq") 81.5%,15.4%,1.20
Convolution3d("vhsbq") 76.7%,15.4%,1.52
Temporalsoften(2,3,3,mode=2,scenechange=6)  83.9%,138.5%,0.12
Temporalsoften(3,5,5,mode=2,scenechange=10) 75.1%,153.8%,0.16
Temporalsoften(4,8,8,mode=2,scenechange=10) 70.9%,169.2%,0.17
FluxSmooth(5,7) 79.1%,7.7%,2.72
FluxSmooth(7,7) 78.1%,15.4%,1.43
FluxSmooth(10,15) 76.7%,7.7%,3.03
mergechroma(blur(1.3)) 99.6%,438.5%,0.00
PeachSmoother() 83.7%,30.8%,0.53
GrapeSmoother() 91.1%,23.1%,0.39


Conclusion, you sould definately use UnDot() in your scripts the percent increase in time is negligable while it makes your encode 2.3% more compressible. If more intense smoothing, denoising is needed FluxSmooth is very quick while oftering exceptional compressiblity. On the other hand, mergechroma(blur(1.3)) was terribly inefficent taking 438.5% longer to encode than the original and saved only 0.4% of the ending file size. This is totally inexcusable, although I may have discovered a bug.

Note: It is important that this test is very pragmatic and objective. Visual quality is totally overlooked in this test, but I've tried all of the filters listed and I find all of them to produce a superior end result

edit: 06172004 Added PeachSmoother() and GrapeSmoother()
 
  Top
i4004
Posted: Jul 21 2004, 11:39 PM


Advanced Member


Group: Members
Posts: 2432
Member No.: 4935
Joined: 24-June 03



from the filters you used, i would only pick peach as a 'first league' denoiser...(the others can perhaps be used to clean dvd's, but not tv-caps...i have said many times;to try cleaning, get some tv-caps,NOT dvds!)

you have used fielddeinterlace,which is a disaster in itself!

you have used xvid,which is know to be less than ideal codec for analog caps!(xvid will probbaly blur more than any of filters you used here)

usage of separatefields is wrong;using it this way will tend to merge two UNALIGNED fields...so the net effect is more of a fields interline cross-talk than you really wanted....(because you're temporal smoothing vertically unaligned fields...)

see this
http://forum.doom9.org/showthread.php?threadid=71485

and add removedirt for vhs;
http://www.hydrogenaudio.org/forums/index....ndpost&p=188330

that should do....

--------------------
my signature:
user posted image
 
     Top
fccHandler
Posted: Jul 22 2004, 03:06 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (smokeslikeapoet @ Jun 15 2004, 08:38 PM)
SeparateFields()
odd=SelectOdd.DenoisingFilter(Parameters)
evn=SelectEven.DenoisingFilter(Parameters)
Interleave(evn,odd)
Weave()

@i4004: Why do you say this approach is wrong? Look again; the temporal neighbors for the denoiser(s) are fields of the same parity.

--------------------
May the FOURCC be with you...
 
     Top
i4004
Posted: Jul 22 2004, 02:10 PM


Advanced Member


Group: Members
Posts: 2432
Member No.: 4935
Joined: 24-June 03



oups!
yes,you're right, i'm wrong;
discard my comment on unaligned fields...

--------------------
my signature:
user posted image
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
4 replies since Jun 16 2004, 12:38 AM Track this topic | Email this topic | Print this topic

<< Back to Avisynth Filtering, Processing and Scripts Discussion