digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Removing DCTs in the source (http://www.digitalfaq.com/archives/encode/4880-removing-dcts-source.html)

vmesquita 08-04-2003 05:35 PM

Removing DCTs in the source
 
Hello everyone,

I am trying to get rid or at least reduce the DCT blocks in my DivX sources. I am doing KDVD conversions. Looks like the only big problem of a good DivX source (2 CDs). I have thought of two ways to solve this:

1-Filter the DCTs and add blockbuster noise. I have tried this approach with the following script:
BlindPP()
MergeChroma(blur(1.58))
MergeLuma(blur(0.05))
Convolution3D(preset="movieLQ")
BlockBuster(method="noise", variance=1, seed=1 )
GripCrop(720, 480, overscan=1, source_anamorphic=false,dest_anamorphic=false)
GripSize(resizer="BicubicResize")
undot()
GripBorders()

I found this script somewhere in this forum. The DCTs got a little less noticiable, but not enough to me.

2-To the second approach I thought is why DCT blocks are placed? Seems to me that this happens because the encoder thinks that the area of the DCT block is dark, so we won't see it anyway. And this is true in the computer monitor, but TV has a lot more brightness and contrast and... The DCTs get very noticeable. This is so true, that when in the morning I open the window and watch my movies, the DCTs block seem to be gone... But at night, specially if the lights are off and just the TV is on, the become visible everywhere. It also depends on the TV, my father's old sanyo 29' non-flat TV shows a LOT less DCTs than my own Sony Wega 29'. So if we could make the dark areas darker, but keeping the bright ones bright, maybe this could be solved, without killing compressibility. But how can I do this, I have no idea... But I really want to try this out, anyone knows how? Or has a better idea to solve this?
I know the information from the area is gone forever, but maybe it could be masked someway... :)

[]'s
Vmesquita

girv 08-05-2003 08:04 AM

@vmesquita you might like to try this snippet to process divx/xvid sources. Add AVISource and resize lines as required.

Code:

...

Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823)
ATC(1,2,4,0.5,false)
TemporalSoften(2,7,7,3,2)
ASharp(1,3)
Blockbuster(method="noise",detail_min=1,detail_max=10,variance=0.5,seed=5823)

// resize here

...


vmesquita 08-05-2003 09:06 AM

Thanks, girv!

I'll try that and post the results.

[]'s
Vmesquita

girv 08-05-2003 09:17 AM

Depending on your sources, you might get better results with
the following tweaks:

Change ATC to ATC(2,3,4,0.5,false)
...or...
Change ATC to ATC(2,3,5,0.5,false)
...and/or...
Change ASharp to ASharp(2,3)

Also I've found that using Kwag's motion adaptive stuff with
divx sources causes excessive softening of the picture, to my
eyes at least. I avoid it myself but give it a try if you like.

vmesquita 08-05-2003 05:46 PM

I just tested with my worst case scenario (Panic Room, a DivX 3.11 1-CD rip) and it did improve the DCTs. Some were masked by noise, and some became static and stopped dancing, which I consider the most annoyng effet. The movie also got a lot more sharper (seems that DivX encoding tend to soft things).

Seems to me that if I did a good quality 2 CD rip, probably it would get near perfect! I'll test again as soom as possible using a 2 CD rip and post the results. I have to mention that this filter combination is also very fast. Using just BlindPP() CCE gives me the speed of 1.13 realtime, using the script it only drops to 0.92 realtime!

I don't use MA since it takes a loooong time with DivX stuff...

[]'s
Vmesquita

boeddha 08-06-2003 06:10 AM

Hello vmesquita,

Can you post the full script you used for that worst case scenario. What resizer did you use and which parameters for atc?

Thanx in advance

vmesquita 08-06-2003 10:48 AM

I used this variation of Girv script:

Blockbuster(method="noise",detail_min=1,detail_max =8,variance=0.3,seed=5823)
ATC(2,3,5,0.5,false)
TemporalSoften(2,7,7,3,2)
ASharp(2,3)
Blockbuster(method="noise",detail_min=1,detail_max =10,variance=0.5,seed=5823)

Of course this won't do miracles but helped a lot!

[]'s
Vmesquita

J-Wo 08-06-2003 10:44 PM

Wow this sounds great I can't wait to give it a try! So is this all the filtering you guys do? You don't incorporate the MA script in there at all? Will this work at 528x480, because I read that blockbuster is ineffective at that resolution or higher in CQ mode. And finally are you using bicubic resizing? Thanks!

girv 08-07-2003 05:11 AM

Quote:

Originally Posted by J-Wo
So is this all the filtering you guys do? You don't incorporate the MA script in there at all?

Yeah, thats all the filters I use for divx sources - IMHO the MA script makes these types of sources too soft.

Quote:

Originally Posted by J-Wo
Will this work at 528x480, because I read that blockbuster is ineffective at that resolution or higher in CQ mode.

I've read that BB noise is filtered out / ignored by TMPGEnc at higher resolutions so you could probably get rid of the second BB line, but the first BB works with the following ATC filter to blend out the "dancing blocks" artefacts you almost always get with divx sources so you should leave that one in. I'm not sure if the second BB line is helpful or not, try it and see.

Quote:

Originally Posted by J-Wo
And finally are you using bicubic resizing?

Yes, I normally use BicubicResize and place it after the filters above for better quality.

J-Wo 08-07-2003 09:33 AM

Wow Girv your script really does work wonders on my divx files! The sharpness is great and the DCT blocks are significantly reduced. I did a test by removing the second BB line and comparing the two video files in virtualdub but the one with both lines was clearly better at reducing the DCT blocks, even at 528x480! Are there any suggested tweaks to the BB lines to try and filter out more of the blocks? Thanks again!

girv 08-07-2003 10:27 AM

Quote:

Originally Posted by J-Wo
I did a test by removing the second BB line and comparing the two video files in virtualdub but the one with both lines was clearly better at reducing the DCT blocks, even at 528x480!

Try actually encoding the test files in TMPGEnc; I think the issue is that at high resolutions the BB noise is removed by TMPGEnc but it will still show up if you look at the files in VDub.

Quote:

Originally Posted by J-Wo
Are there any suggested tweaks to the BB lines to try and filter out more of the blocks?

If there are, let me know ;)

PM me a couple of screenshots or huffy avi's so I can see the type of problems you're left with. Maybe we'll come up with something!

J-Wo 08-07-2003 12:46 PM

Actually I am encoding in tmpgenc first, then viewing the sample m1v in virtualdub. Comparing screenshots at 2x view mode helps to show any DCT blocks left behind. I seem to remember old 2.0x scripts where DCT blocks were completely eliminated, replaced by grainy "noise" which looked more natural than dancing blocks. Hopefully we can get others in on this little project since it doesn't look like Kwag and the gang are supporting avi's for now! :D

vmesquita 08-07-2003 02:22 PM

I am really interested in this! But what scripts are you talking about? We can always use 2.0x plugins in 2.5 using LoadPluginEx.dll (not very fast anyway, but works).

[]'s
Vmesquita

girv 08-08-2003 05:16 AM

Quote:

Originally Posted by J-Wo
Actually I am encoding in tmpgenc first, then viewing the sample m1v in virtualdub.

Ah right, sorry!

Quote:

Originally Posted by J-Wo
Comparing screenshots at 2x view mode helps to show any DCT blocks left behind.

You could try adding a constrast+brightness increasing filter as well...

Quote:

Originally Posted by J-Wo
I seem to remember old 2.0x scripts where DCT blocks were completely eliminated, replaced by grainy "noise" which looked more natural than dancing blocks.

Try increasing the variance and/or detail_max parameters on the second BB line.

Quote:

Originally Posted by J-Wo
Hopefully we can get others in on this little project since it doesn't look like Kwag and the gang are supporting avi's for now! :D

I dont think Kwag ever "supported" AVI's, he's just kind enough to not chuck us out of the forums ahen we are talking about it ;)

J-Wo 08-08-2003 12:55 PM

oh btw girv, what are you setting your min/max bitrate in tmpgenc? I was wondering if I should go back to 300/2500 since this script is not MA.

Dialhot 08-08-2003 04:10 PM

You can do that. I'm currently making a conversion of a 42 min video that I plan to put with 3 of its brother on one CD (that means, 200 Mo only for each, or if you prefer 160 Min on on CD) using VCD res (352*288) and 64/2000 as min/max setting : the CQ is not determinated yet but will be near 77 !

I modified a little the original script btw, and that is the one I use :
Code:

Undot()
Blockbuster(method="noise",detail_min=1,detail_max=8,variance=0.3,seed=5823)
ATC(2,3,5,0.5,false)
TemporalSoften(2,7,7,3,2)
Blockbuster(method="noise",detail_min=1,detail_max=10,variance=0.5,seed=5823)
GripCrop(352, 288+0+0, overscan=1, source_anamorphic=false, dest_anamorphic=false)
GripSize(resizer="LanczosResize")
DCTFilter(1,1,1,1,1,1,0.5,0)
GripBorders()

I added "Undot()" at the beguining because the script didn't have any Spatial filter and we always need one Spatial and one Temporal. And I remove asharp because resizing with Lanczos is sharpen enought.

J-Wo 08-08-2003 06:40 PM

Cool so would you use this new script for higher res like 528x480? Also do you not find that lancoz resize creates strange artifacts or mosquito noise? Thanks

vmesquita 08-08-2003 06:42 PM

@DialHot
Great! I'll test your modified script agains my worst case scenario (Divx 3.11 1-CD rip of panic room) to see the results!

@J-Wo
I am testing with 720x480, so I guess you can! I don't have artifacts with lanczos unless I am doing a big horizontal resize (like 640x480 to 352x480)

[]'s
Vmesquita

Dialhot 08-09-2003 05:28 AM

Quote:

Originally Posted by J-Wo
Cool so would you use this new script for higher res like 528x480? Also do you not find that lancoz resize creates strange artifacts or mosquito noise? Thanks

In fact I didnt exactly 17 test before finding the script I gave in my previous post. And all test were made without any resizing for time gain, so the sample was 704*400. You can use it at 528*40 without any problem. The econd BB line is perhaps useless for DCT removing but I didn't test without it.

For lanczos : no I don't find this. I always prefer using Lanczos alone rather than asharp+bilinear. I have a sample I use for all my test and Lanczos is the only one than preserve the "2-day beard" of one of the character. All others litteraly shave him :-)

jorel 08-09-2003 06:21 AM

when i did monsters sa in december with lanczos i got "moving ants".
then was needed to encode again with bicubic,unfilter and
temporalsmoother...i didn't knew asharp in december.
i stop to use lanczos.
i have the 2 encodeds kvcds with and without lanczos and
the second(without lanczos) is really best...
in the legends and edges i got less "moving ants"..seems "staircases".

this was encoded as 320x240 mpeg1...
this could be the reason of this strange artefacts?
if i choose more resize like 480x480 give less problems?
:?


All times are GMT -5. The time now is 08:59 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.