PDA

View Full Version : 1-disc anamorphic CVD -- need hardcore filtering help


brett
4th January 2004, 02:15
I know it's a strange format, but I'm making anamorphic 352x480 CVD rips with 48k audio because they work well on my set-top player and because I can also burn them on DVD-R without re-encoding.

So, I think I've got the whole DVD2SVCD thing down. It's taken me a lot of reading. I was doing DVD-R rips with CCE two years ago, though, and before that I was doing DivX with Avisynth. Still, I'm very new to DVD2SVCD, so I may be doing something completely stupid.

I'm using DVD2SVCD 1.2.1 build 3, D2SRoBa 3.1.2, CCE 2.66.01.07, RB's Templates for CCE, FACAR 1.06.6, and the Bach1 matrix.

I think I've got it all figured out, but I'm getting really high Q factors. Since anamorphic encoding is taking up the whole frame, I think I should probably be using heavier filtering -- even heavier than the average 1-disc encode.

The way I set things up is:

Edit AVISYNTH.INI, uncomment pre/post/QMF scripts under [AVISYNTH_FACAR].

Edit CCE templates for:
Video setting:
M=3, N/M=4 (in Progressive template)
Luminance = 16 to 235
Quality settings:
Quantizer characteristics (Flat panel priority): 30
Intra block DC precision: 10

D2SRoBa:
Num CDs: 1
max total bitrate: 2728
Audio: Use Min br, Min br = 128

DVD2SVCD:
Encoder tab: Bias = 11
Matrix tab: Bach1 Matrix
Misc tab: DVD2SVCD level = Advanced
Frameserver tab: Resize to: CVD (352 x 480/576)

I've done four different encodes of Austin Powers (90 min), all anamorphic with 128k audio except the first.


-------
Setup 1
-------

Aspect=standard
Bias=20
Matrix=KVCD-Notch

PreResize:
UnDot()
ASharp(1,4)
FluxSmooth(5,5)

no QMF

PostResize:
TemporalSoften(3,5,5,10,2)

In this encode I also used 160k audio.
Result was a Q Factor of 42.



-------
Setup 2
-------

Aspect=anamorphic
Bias=20
Matrix=KVCD-Notch

PreResize.avs:
UnDot()

no QMF

PostResize.avs:
Deen()
UnDot()

Result was a Q Factor of 57.



-------
Setup 3
-------

Aspect=anamorphic
Bias=11
Matrix=Bach1

PreResize.avs:
UnDot()

QMF (using r6d2 / DDogg's default settings in FACAR)

PostResize.avs:
Deen()
UnDot()

Result was a Q Factor of 64.



-------
Setup 4
-------

Aspect=anamorphic
Bias=11
Matrix=Bach1

PreResize.avs:
none

QMF (using r6d2 / DDogg's default settings in FACAR)

PostResize.avs:
none

Result was a Q Factor of 71.


Note that all of these except #1 were 750 MB images so I could burn them on a CD-RW, so the Q shouldn't be quite as high as it is.

So, is it pointless to use QMF when I'm already doing heavy filtering? And I saw that a higher bias gives you a lower Q, but not necessarily higher quality, so is it good to leave it at 11?

And even with the huge filtering in #3, I'm still getting a lot of speckling in some scenes. Should I ignore that (can't get rid of all the film grain), or run it through UnDot again, or what?

I got most of my ideas from this thread:
Low Bitrate MAF Encodes using CCE and Tylo's 1 pass Plug-in
http://forum.doom9.org/showthread.php?s=&threadid=58886&perpage=20&pagenumber=8

I'm pretty much stuck using this format, but I'd really appreciate any filtering suggestions to smooth it out a little better. I'm just assuming I can do a little better than Q's in the 60's for a 90-min movie.

manolito
4th January 2004, 15:20
Hi Brett,
this is really DDogg's territory, but in the meantime here's my two cents.

For those really impossible encodes the following settings work best for me:

D2S Settings:
Matrix - Bach1
Audio - 128 Stereo
Bias - 11

CCE Settings (via Progressive template) If not mentioned then use default.
All unchecked except "Add sequence end code"
Luminance level 16-235
Quality Tab
All unchecked except zigzag, progressive, 10 bits, QC slider 28


I use a GOP length of 15, but DDogg likes 12 better, so this is up to you.


The QMF script is a lot more effective if you change the motion detection thresholds so more of the movie is considered medium or high motion.

...........................................................
Changed Thresholds for QMF15b1.AVS (by jsquare)

# SETTING MOTION LEVELS THRESHOLDS
threshold_lm = default(threshold_lm,(chroma == true) ? 1.0 : 2.0)
threshold_hm = default(threshold_hm,(chroma == true) ? 5.0 : 8.0)
# SETTING MIN/MAX SCENE CHANGE THRESHOLDS
threshold_sc_lm = default(threshold_sc_lm,(chroma == true) ? 10.0 : 20.0)
threshold_sc_mm = default(threshold_sc_mm,(chroma == true) ? 20.0 : 35.0)
threshold_sc_hm = default(threshold_sc_hm,(chroma == true) ? 35.0 : 50.0)
............................................................

The following script was originally posted by DDogg, I just modified it to work with the latest FACAR. You have to paste the script into AVISYNTH.INI. Before you can use it you have to open it once in DVD2SVCD and enter the correct paths for the "Import" and "LoadPlugin" lines. If you are not sure how to do this, read the second part of the FACAR readme.
Also keep in mind that FACAR will not automatically enter the values for DetectedTop and DetectedHeight into this script, you have to do that manually.

...........................................................
[AVISYNTH_FACAR with Homie FR QMF BlindPP]
0=ResizeTo=^ResizeTo. global ResizeMethod=^ResizeMethod. DebugMode=^DebugMode
1=GammaCorrection=^GammaCorrection. Hue=^Hue. Saturation=^Saturation. Brightness=^Brightness. Contrast=^Contrast
2=DetectedTop=^DetectedTop. DetectedHeight=^DetectedHeight
3=OverscanH=^OverscanH. OverscanV=^OverscanV. BlockOptimization=^BlockOptimization. AsoTV=^AsoTV
4=global Bicubic_b_Value=^b_value. global Bicubic_c_Value=^c_value
5=DestinationWidth=^TargetWidth
6=DestinationHeight=^TargetHeight
7=BlindPP()
8=LoadPlugin(!SimpleResize.dll)
9=Import(!qmf15b1.avs)
10=Undot()
11=STMedianFilter(8, 32, 0, 0 ) #You may be able to rem this out for slower machines
12=# LOW MOTION FILTER FUNCTION
13=# -> STRONG TEMPORAL SMOOTHING (USING FLUXSMOOTH)
14=# -> SOFT SPATIAL SMOOTHING (USING UNFILTER)
15=function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,0) c = UnFilter(c,-10,-10) return c }
16=# MEDIUM MOTION FILTER FUNCTION
17=# -> MEDIUM TEMPORAL SMOOTHING (USING FLUXSMOOTH)
18=# -> MEDIUM SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
19=function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
20=# HIGH MOTION FILTER FUNCTION
21=# -> NO TEMPORAL SMOOTHING
22=# -> STRONG SPATIAL SMOOTHING (USING FLUXSMOOTH AND UNFILTER)
23=function High_Motion_Filter(clip c) { c = FluxSmooth(c,0,14) c = UnFilter(c,-30,-30) return c }
24=# APPLYING ADAPTATIVE SPATIO-TEMPORAL SMOOTHER (USING QMF)
25=QMF()
26=Import(!FACAR.avs)
27=undot()
28=# Deen() #Maybe for certain types of source.
29=Temporalsoften(2,3,3,mode=2,scenechange=6) #Need to check out dif settings
^ResizeTo.=0
^ResizeMethod.=1
^DebugMode=0
^GammaCorrection.=1.0
^Hue.=0
^Saturation.=1.0
^Brightness.=0
^Contrast=1.0
^DetectedTop.=0
^DetectedHeight=576
^OverscanH.=0.04
^OverscanV.=0.04
^BlockOptimization.=0
^AsoTV=1
^b_value.=0
^c_value=0.6
...........................................................

If you uncomment "Deen()" from this script you will end up with a very high Q reduction at the cost of some sharpness and crispness. The encode will also be slow as hell.

Hope this will help
Cheers
manolito

brett
5th January 2004, 00:01
Thanks for the script. I'm trying it out now. I added the following section to AVISYNTH.INI to get the modified FACAR to autodetect:

...........................................................
[AVISYNTH_FACAR DetectBorders with Homie FR QMF BlindPP]
0=LoadPlugin(!AutoCrop.dll)
1=AutoCrop(mode=1, topAdd=^OffsetTop, bottomAdd=^OffsetBottom, threshold=^Threshold, outFile=!ThisFile.ini, outSection="AVISYNTH_FACAR with Homie FR QMF BlindPP", outKeyTop="^DetectedTop.", outKeyHeight="^DetectedHeight")
2=BilinearResize(^TargetWidth, ^TargetHeight)
3=AddBorders(0, ^BorderTop, 0, ^BorderBottom, $A0A0A0)
!AutoCrop.dll=C:\DVD2SVCD\Avisynth2.5 Plugins\AutoCrop\AutoCrop.dll
^OffsetTop=0
^OffsetBottom=0
^Threshold=20
!ThisFile.ini=C:\DVD2SVCD\AVISYNTH.INI
...........................................................

And then I duplicated both the sections adding "+ Deen" in the name, so any of the scripts can be used normally in DVD2AVI.

brett
5th January 2004, 22:34
I didn't realize that anamorphic wasn't really supported by SVCD/CVD, and half-D1 anamorphic isn't in the DVD spec... I wanted to have something that would look better on widescreen TV's, but I guess there's not much point when it's so hard to compress and not very well supported . It would be very annoying for people who have a standard TV without a widescreen button if their player doesn't recognize the disc as anamorphic.

Anyway, I did use the above script. I made a 16:9 encode of Austin Powers with 128k audio and Deen enabled. It gave a Q of 38. Then I made a 4:3 encode with 192k Surround2 audio without Deen, and it gave a Q of 26.

brett
5th January 2004, 22:37
And the cool thing about it is I can have a perfectly in-spec CVD and drop the MPG right into TMPGEnc DVD Author, although it doesn't let me import the Maestro Chapters File.

manolito
6th January 2004, 00:33
And how do the encodes look? Still viewable without bringing tears to your eyes?

brett
6th January 2004, 13:59
It looks good. I'm extremely happy with anything better than VHS on one CD.

If I was going to complain, the green crawling blocks in some of the dark scenes are pretty nasty, especially after doing DVD-R rips for the past 2 years. I'm doing a re-rip with Deen on to see if that helps.