digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Increasing compression through preprocessing (http://www.digitalfaq.com/archives/avisynth/2150-avisynth-increasing-compression.html)

SansGrip 01-14-2003 11:10 PM

Increasing compression through preprocessing
 
I've been playing with various smoothing filters and have come up with a nice combination for adding some serious numbers to the CQ level of a given movie.

Of all the combinations I've tried so far, what gives me the best compression increase is:

Code:

FaeryDust()
Convolution3D(preset="movieLQ")

I got my 2-disc version of Death To Smoochy up from about 73 to 85 with these two filters 8O.

The script's output is quite smooth when viewed from WMP, and likely wouldn't be suitable for MPEG-4 encoding (or even high-bitrate MPEG-1), but for low-bitrate MPEG-1 it seems that the encoding process masks the lack of details fairly effectively. If you find this too much smoothing, try preset="movieHQ" for Convolution3D instead.

These two filters are very slow, though :?.

Anyway, that's what I've been playing with this evening. Make sure you get v4 of Dust since it fixes one of the bugs I mentioned earlier...

Test and post :).

SansGrip 01-14-2003 11:21 PM

Forgot to mention, I also used

Code:

Tweak(cont=0.8, sat=0.8)
to pull down the contrast and saturation a little. It is a very bright and highly coloured movie, and I think that was messing with the encoder somewhat.

Oh, and I also put a

Code:

Letterbox(8, 8)
before the GripFit to enlarge the top and bottom borders a little.

kwag 01-14-2003 11:21 PM

Hehe, this just never ends :mrgreen:
I can see it clearly in the (not too distant) future: The KVCD 300 minute
(U)ltraLBR :mrgreen: :mnkypile:
-kwag

SansGrip 01-14-2003 11:23 PM

Quote:

Originally Posted by kwag
Hehe, this just never ends :mrgreen:

May it ever be so :D.

Quote:

I can see it clearly in the (not too distant) future: The KVCD 300 minute
(U)ltraLBR :mrgreen: :mnkypile:
Hey, I've got Death To Smoochy (2-disc, 192kbps audio) up from 73 to 96 and counting. I'm still a meg or so from the target :mrgreen:.

SansGrip 01-14-2003 11:45 PM

Maxed out at CQ 100 -- about 300kB below target size. I'm now going to watch the sample on the TV... Back in a bit ;).

kwag 01-14-2003 11:52 PM

.................................................. .................................................. ............................................. :roll: .................................................. ........................ :roll: .................................................. ........... :roll: .................................................. ....... :roll: WAITING :!:

SansGrip 01-14-2003 11:53 PM

Quote:

Originally Posted by kwag
.................................................. .................................................. ............................................. :roll: .................................................. ........................ :roll: .................................................. ........... :roll: .................................................. ....... :roll: WAITING :!:

:mrgreen:

Looks very nice -- perhaps a little softer than usual, but not a lot. I'm thinking of trying the DVD trick (i.e. heavy smoothing followed by an edge-enhancement) next...

Of course the real test is an HDTV. Want a sample? :D

kwag 01-15-2003 12:00 AM

Quote:

Originally Posted by SansGrip
Looks very nice -- perhaps a little softer than usual, but not a lot. I'm thinking of trying the DVD trick (i.e. heavy smoothing followed by an edge-enhancement) next...

What happens if you remove the C3D line :idea:. I just did a sample and it looks really great in the PC, but I did notice some very slight "screening" effect on the film.
Quote:


Of course the real test is an HDTV. Want a sample? :D
You bet :mrgreen:

-kwag

SansGrip 01-15-2003 12:04 AM

Quote:

Originally Posted by kwag
What happens if you remove the C3D line :idea:.

Still get nice compression benefits from Tweak and FaeryDust, but not as much as with C3D movieLQ. CQ would maybe drop from 100 to 95 or so (that's just a wild guess).

Quote:

but I did notice some very slight "screening" effect on the film.
You mean when you watch it on the TV? Try using preset="movieHQ". Bear in mind that Death To Smoochy is very difficult source material, and is quite noisy.

Quote:

You bet :mrgreen:
Uploading now. I'll edit when it's finished :).

Edit: Here it is, 6.5mB.

kwag 01-15-2003 12:11 AM

Quote:

Originally Posted by SansGrip
You mean when you watch it on the TV? Try using preset="movieHQ". Bear in mind that Death To Smoochy is very difficult source material, and is quite noisy.

Just watching on the monitor.
I did use preset="movieHQ" on "Count of Monte Cristo" movie which is very dark with smoke or dust ( haven't seen the movie yet, just the sample 8) )

-kwag

SansGrip 01-15-2003 12:13 AM

Quote:

Originally Posted by kwag
(haven't seen the movie yet, just the sample 8))

It's not great ;) -- nowhere near as much swashbuckling as there should be :D.

kwag 01-15-2003 12:14 AM

Check the file name :wink:

SansGrip 01-15-2003 12:17 AM

Quote:

Originally Posted by kwag
Check the file name :wink:

It's late ;). Fixed.

kwag 01-15-2003 12:25 AM

There should be a "Hall of fame" sample gallery, because that definitively looks like a DVD :mrgreen:
I'm going to re-encode "Count of Monte Cristo" again, which I had done at 352x480. I think that it can go on 528x480 with these filters :mrgreen:
Just AMAZING :D

-kwag

kwag 01-15-2003 12:27 AM

What was your .avs script for that SansGrip :?:

SansGrip 01-15-2003 12:29 AM

Quote:

Originally Posted by kwag
There should be a "Hall of fame" sample gallery, because that definitively looks like a DVD :mrgreen:

Ah, remember that's for two discs. If I could get it looking like that for one disc I'd be very happy ;). I'm playing with one-disc settings now. I'll post a sample, but probably not until the morning. I'm almost asleep :).

SansGrip 01-15-2003 12:39 AM

Ok, so I lied. Here's the same 30 seconds from the one-disc version (112kbps audio). It's nowhere near as good as the two-disc (particularly anything very saturated in colour) but it's a heck of a lot better than without the extra compression from the preprocessing.

It's starting to look like I might get it on one disc at 528x480 after all :).

kwag 01-15-2003 12:47 AM

There's no Blockbuster or Fluxsmoot there right :?:

kwag 01-15-2003 12:49 AM

Quote:

Originally Posted by SansGrip
It's starting to look like I might get it on one disc at 528x480 after all :).

That looks perfectly good for one CD :D

-kwag

SansGrip 01-15-2003 12:50 AM

Quote:

Originally Posted by kwag
There's no Blockbuster or Fluxsmoot there right :?:

Code:

Mpeg2Source("..\dts.d2v")
Telecide()
Decimate()
Letterbox(8, 8)
GripFit(528, 480, overscan=1)
Tweak(cont=0.8, sat=0.8)
FaeryDust()
Convolution3D(preset="movieLQ")
Sampler()
LegalClip()


SansGrip 01-15-2003 12:51 AM

Quote:

Originally Posted by kwag
That looks perfectly good for one CD :D

It's pretty good, but it's no Signs -- I'll keep tinkering with it :).

kwag 01-15-2003 01:01 AM

Well it seems I'll be re-encoding "Monte Cristo" with a CQ > 70 at 528x480 :mrgreen:
I just ran a sample at 70 and was ~1MB lower then predicted. And I also had 1 blocks overscan, and not 2 as I usually do for 528x480. So I figure the CQ is going to be ~74-75, and that's a hell of good quality for 528x480 :D

-kwag

SansGrip 01-15-2003 01:07 AM

Quote:

Originally Posted by kwag
the CQ is going to be ~74-75, and that's a hell of good quality for 528x480 :D

It sure is. What's the movie length/AR? What script?

kwag 01-15-2003 01:11 AM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
the CQ is going to be ~74-75, and that's a hell of good quality for 528x480 :D

It sure is. What's the movie length/AR? What script?

131 minutes, 32 seconds. Here's the script I'm using:

Code:

LoadPlugin("C:\encoding\MPEG2DEC.dll")
LoadPlugin("C:\encoding\fluxsmooth.dll")
LoadPlugin("C:\encoding\GripFit_preview.dll")
LoadPlugin("C:\encoding\blockbuster.dll")
LoadPlugin("C:\encoding\legalclip.dll")
LoadPlugin("C:\encoding\sampler.dll")
LoadPlugin("C:\encoding\vobsub.dll")
LoadPlugin("C:\encoding\convolution3d.dll")
LoadPlugin("C:\encoding\dustv3.dll")

Mpeg2Source("K:\COUNT_OF_MONTE_CRISTO\VIDEO_TS\count.d2v")
LegalClip()
vobsub("K:\COUNT_OF_MONTE_CRISTO\VIDEO_TS\VTS_01_0")
GripFit( width=528, height=480, overscan=2 )
FaeryDust()
Convolution3D(preset="movieLQ")
GripBorders()
LegalClip()

Sampler(length=24)
## MPEG size = ((Total frames/MovieTimeInMinutes)/24) * MPEG sample file size ##

Looks like final CQ is going to be 71.5, as 72 was just barely over.

Edit: Aspect wide screen 16:9

-kwag

SansGrip 01-15-2003 01:16 AM

Quote:

Originally Posted by kwag
131 minutes, 32 seconds. [...] Aspect wide screen 16:9

That's a very high CQ for a >2hr 16:9 movie... Mind you, it should be fairly compressible because it's quite dark and mostly low-action. Gonna post a sample? :)

kwag 01-15-2003 01:19 AM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
131 minutes, 32 seconds. [...] Aspect wide screen 16:9

That's a very high CQ for a >2hr 16:9 movie... Mind you, it should be fairly compressible because it's quite dark and mostly low-action. Gonna post a sample? :)

You bet :D. 5 minutes to end the sample ( FaeryDust is really slow :cry: )
Then I'll cut a sample and post it here. Don't go to sleep yet :mrgreen:

-kwag

SansGrip 01-15-2003 01:25 AM

Quote:

Originally Posted by kwag
FaeryDust is really slow :cry:

Very. However, Steady is already working on a new version (mostly rewritten, from what I can gather) that uses a different algorithm for motion estimation. Should be much faster.

Quote:

Don't go to sleep yet :mrgreen:
I'm going to have to watch that sample tomorrow, because I'm dead in my chair here. Have a good one -- see you in the morning ;).

kwag 01-15-2003 01:31 AM

So it will be CQ=71 :D
Here you go: http://www.kvcd.net/count-sample-528x480-cq71.mpg
That's for one CD. :wink:

-kwag

GFR 01-15-2003 05:22 AM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
(haven't seen the movie yet, just the sample 8))

It's not great ;) -- nowhere near as much swashbuckling as there should be :D.

Agreed - not great.

But, DO read the book! It's awesome!

SansGrip 01-15-2003 08:44 AM

Quote:

Originally Posted by kwag
That's for one CD. :wink:

Very nice... Man, I'd forgotten how dark that movie is :).

SansGrip 01-15-2003 01:09 PM

If you do a StackVertical compare of a sample done with, say, Flux against a sample done with FaeryDust and C3D movieLQ you'll notice quite a significant loss of detail in the latter. That's where all the compression comes from ;).

I'm thinking that movieLQ is a good choice if you really want to get something on one disc and don't have an HDTV, but otherwise movieHQ might be more suitable.

In fact what I'm really thinking is that we need a filter to do an edge detection then smooth non-edge areas and sharpen the edges simultaneously. That would be nice. But what to call it? :mrgreen:

SansGrip 01-15-2003 01:13 PM

Look in particular at Gibson's face and jacket:

http://www.digitalfaq.com/archives/error.gif

The top was done with Flux and TemporalSoften. The bottom with FaeryDust and C3D movieLQ.

kwag 01-15-2003 01:17 PM

What about Flux + FaeryDust
Or TemporalSmoother + C3D
Or FaeryDust + TemporalSmoother :wink: (:mrgreen:)

-kwag

SansGrip 01-15-2003 01:44 PM

Quote:

Originally Posted by kwag
What about Flux + FaeryDust

Well, they're both denoisers, so you don't really need to use them together. Faery should catch all the noise that Flux does, and all the noise it doesn't, too ;).

Quote:

Or TemporalSmoother + C3D
And these are both smoothers rather than denoisers. I think we want:

Flux or FaeryDust

and a smoother, be it TemporalSoften, TemporalSmoother, C3D, or my as-yet-unnamed smoother/sharpener combo filter :).

Daagar 01-15-2003 05:39 PM

SansNoise.

kwag 01-16-2003 01:49 PM

Sansgrip,

Do you know if the source code for faerydust is available :?:
I can't find it :?

-kwag

SansGrip 01-16-2003 01:53 PM

Quote:

Originally Posted by kwag
Do you know if the source code for faerydust is available :?: I can't find it :?

Not yet. I've gently hinted that he should release it ;).

Gaudi 01-16-2003 05:59 PM

Where can I get FaeryDust filter?

Thanks

kwag 01-16-2003 06:07 PM

Quote:

Originally Posted by Gaudi
Where can I get FaeryDust filter?

Thanks

http://forum.doom9.org/showthread.ph...ight=faerydust

SansGrip 01-16-2003 11:06 PM

Quote:

Originally Posted by kwag
I can see it clearly in the (not too distant) future: The KVCD 300 minute
(U)ltraLBR :mrgreen: :mnkypile:
-kwag

...and I thought you were joking :mrgreen:.


All times are GMT -5. The time now is 04:30 PM  —  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.