View Full Version : Applying CCE Filters
quantum
15th May 2004, 14:27
I was backing up Babylon 5 Season 1 (with DVD Rebuilder of course) and found my average bitrate was around 2300 even after stripping off everything I could. This is pretty low and caused some compression artifacts, so I decided to activate the built in CCE filters to soften the image a bit and reduce the artifacts. I compared the results before and after the filter and I think it made an obvious improvement. Here's how it can be done:
- Do the prepare phase
- Open rebuilder.ecl in a text editor
- Do search and replace for the following - choose the appropriate preset
======= NATURAL PICTURE PRESET (typical movie)
use_filter=1
h_filter_idx=8
filter_val=4
h_filter=1
quality_prec=16
======= ANIMATION PRESET (high contrast scanned animation /cartoon)
use_filter=1
h_filter_idx=8
filter_val=4
h_filter=1
quality_prec=24
dither=1
dither_max=12
======= COMPUTER GRAPHICS PRESET (smooth images such as CGI)
use_filter=1
h_filter_idx=8
filter_val=12
h_filter=1
quality_prec=3
dither=1
dither_max=12
You can of course adjust these values to whatever.
- Continue with encode and prepare in DVD Rebuilder
One last thing, any progress on Closed Captions jd? ;)
wmansir
15th May 2004, 22:49
Why don't you just use DVD-RB to encode after you edit the .ecl file? DVD-RB uses those jobs.
DDogg
16th May 2004, 00:29
The internal CCE filters have never shown themselves to be much use. You pay a lot in visual quality with their use, IMO.
If you want to use filters there is another way the works well thanks to RB. Create an AVS script with undot().Deen() (or whatever you would like to use) and save as myfilters.avs
Use RB's insline.bat (http://forum.doom9.org/showthread.php?s=&threadid=75610) to insert an import line in all your scripts. Takes only a couple of seconds.
Usage from a command line, exactly as typed, is: Insline "path:\directory\" "Import("path:\myfilters.avs")" 3
where 3 is the line number you want the line inserted and path is the correct drive and directory. Do not count blank lines or ones starting with # when designating the line number. All avs scripts in the specified directory will have the line - Import("PATH:\myfilters.avs") inserted at the specified line number. You would normally insert this line directly after the mpeg2source line.
Copy and paste the following into notepad and save as 'InsLine.bat'
rem Insline batch file by RB
@echo off
setlocal enabledelayedexpansion
Rem ===================================================================
Rem Batch for inserting a line into every AVS file in a specific
Rem directory
Rem
Rem Usage: insline [directory] [text] [line number]
Rem
Rem Make sure to use quotes around directory and text.
Rem
Rem Example: insline "d:\rebuild\d2vavs" "undot().deen()" 2
Rem
Rem Recursively scans directory d:\rebuild\d2vavs for .AVS
Rem files and inserts undot().deen() at line number 2 into
Rem every .AVS. -1 for line number appends at end of file.
Rem ===================================================================
if "%~1" == "" goto :EOF
if "%~2" == "" goto :EOF
if "%~3" == "" goto :EOF
if not exist "%~1" goto :EOF
set text=%~2
for /R "%~1" %%F in (*.avs) do (
set line=0
if "%~3" == "-1" (
echo !text!>>"%%F"
) else (
if exist "%%~dpnF.$$$" del "%%~dpnF.$$$"
for /F "usebackq delims=" %%I in ("%%F") do for /F "tokens=1 delims= " %%J in ("%%I") do (
set char=%%J
set char=!char:~0,1!
if not "!char!" == "#" (
set /A "line += 1"
if "!line!" == "%~3" echo !text!>>"%%~dpnF.$$$"
)
echo %%I>>"%%~dpnF.$$$"
)
del "%%F"
ren "%%~dpnF.$$$" "%%~nxF"
)
)
RB did an awesome job doing this bat file for us. Hat's off to him.
One of the really nice things about this method is after you have inserted the import line, you only have to edit myfilters.avs to have an effect on every avs file.
Also, notice the line "for /R "%~1" %%F in (*.avs) do (" in the batchfile. You can easily edit and add a partial wildcard so that you might - import("myInterlacedFilters.avs") into those avs's dealing with interlaced like trailers, and another - import("myprogressivefilters.avs") for the progressive avs's.
Note: remember to copy your d2vavs directory to a backup before trying this until you get used to it.
quantum
16th May 2004, 00:33
Originally posted by wmansir
Why don't you just use DVD-RB to encode after you edit the .ecl file? DVD-RB uses those jobs. There's a very good reason why I didn't do it that way: because it didn't occur to me :confused:
Obviously using Rebuilder is easier. I've editted the first post to reflect it.
quantum
16th May 2004, 16:50
I'm now doing disk 2 and following the same (corrected) procedure. Thanks to wmansir for pointing out the fact I was wasting time doing extra steps for no reason. :)
quantum
17th May 2004, 05:37
Added values for all presets in the first post.
Sir Didymus
17th May 2004, 08:47
Originally posted by DDogg
The internal CCE filters have never shown themselves to be much use. You pay a lot in visual quality with their use, IMO.
... skip ...
Wow...
Fantastic...
Thanks a lot for the precious information, and for the reference to the excellent post of RB.
I think it will be absolutely useful for using in the best manner all of the power of Avisynth.
You have to know that in one of the test I did I manually changed the (more than 50) avs files for adding the undot().Deen() filter...
I feel now much more relaxed for the perspective of doing the same in my next backups...
DDogg
17th May 2004, 21:17
You have to know that in one of the test I did I manually changed the (more than 50) avs files for adding the undot().Deen() filter... lol, yeah me too. That's when I decided I was not going to do it again :)
SAPSTAR
19th May 2004, 15:13
Originally posted by quantum
I was backing up Babylon 5 Season 1 (with DVD Rebuilder of course) and found my average bitrate was around 2300 even after stripping off everything I could. This is pretty low and caused some compression artifacts, so I decided to activate the built in CCE filters to soften the image a bit and reduce the artifacts. I compared the results before and after the filter and I think it made an obvious improvement. Here's how it can be done:
- Do the prepare phase
- Open rebuilder.ecl in a text editor
- Do search and replace for the following - choose the appropriate preset
======= NATURAL PICTURE PRESET (typical movie)
use_filter=1
h_filter_idx=8
filter_val=4
h_filter=1
quality_prec=16
======= ANIMATION PRESET (high contrast scanned animation /cartoon)
use_filter=1
h_filter_idx=8
filter_val=4
h_filter=1
quality_prec=24
dither=1
dither_max=12
======= COMPUTER GRAPHICS PRESET (smooth images such as CGI)
use_filter=1
h_filter_idx=8
filter_val=12
h_filter=1
quality_prec=3
dither=1
dither_max=12
You can of course adjust these values to whatever.
- Continue with encode and prepare in DVD Rebuilder
One last thing, any progress on Closed Captions jd? ;)
You can add Undot().Deen() + change the Q-Matrix, The AVAMAT is doing a really good job, you just have to open the rebuilder.ecl and then replace the qmat_inx=0 by :
qmat_inx=-1
qmat_name=AVAMAT6
qmat=
08 16 19 22 26 27 29 34
16 16 22 24 27 29 34 35
19 22 26 27 29 34 35 38
22 22 26 27 29 34 35 40
22 26 27 29 32 35 40 48
26 27 29 32 35 40 48 50
26 27 29 35 40 48 50 60
27 29 35 40 48 50 60 62
16 20 24 28 32 36 40 44
20 24 28 32 36 40 44 48
24 28 32 36 40 44 48 52
28 32 36 40 44 48 52 56
32 36 40 44 48 52 56 58
36 40 44 48 52 56 58 60
40 44 48 52 56 58 60 62
44 48 52 56 58 60 62 62
(You can choose different matrices for each cell, some are well adapted for low bitrates or animation...)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.