Log in

View Full Version : LimitedSharpen and Removegrain


cbarroso
28th March 2006, 23:41
Hi,

This is my first post and probably a newbie one.
After hours reading this forum, I am still very confused about the order that those filters should be used. My currently order is Crop, LanczosResize (anaphormic), Removegrain(mode=2), Colormatrix() and LimitedSharpen(). Is that right?

Thanks!!

foxyshadis
29th March 2006, 00:17
Colormatrix()
RemoveGrain()
LanczosResize(w/crop parameters)
LimitedSharpen()

or

ColorMatrix()
Crop()
Removegrain()
Limitedsharpen(w/resize (dest_x,dest_y))

At least, that's how I'd put the chain together. If colormatrix is first it can autodetect, otherwise it has to be given specific arguments.

Chainmax
29th March 2006, 01:04
n00b question: after briefly skimming through the first page of the colormatrix thread, I haven't figured out when is it wise to use it and on what kind of sources (digital or analogue). Can someone answer me that in a nutshell?

foxyshadis
29th March 2006, 02:00
DVB, DVD, and HDTV (generally, mpeg-1 and 2) are usually rec709, practically everything else is rec601 or 470 and don't need conversion. DV I'm unsure of, seems to be a mix of both (maybe pal is 709 and ntsc is 601?).

DVD->DVD conversions don't need it, most MPEG-2->MPEG-4 does however. Since it uses dgdecode hints or a d2v, it's safe to use even when you didn't actually need it.

Chainmax
29th March 2006, 16:52
I see, thanks for the tip.

Audionut
30th March 2006, 06:55
mpeg2source("file-to-be-encoded",info=3)
Colormatrix(hints=true) so it can get the hints from d2v
removegrain() because it doesn't process edges.
crop()
limitedsharpen(dest_x=width, dest_y=height)

no need for lanczosresize as limitedsharpen can resize.

cbarroso
31st March 2006, 00:48
Thank you for the responses!
Audionut, I tried the hints=true and received the following error:
"no hints detected in stream with hints=true!". I'm using DGindex 1.4.6.
Also, where should I put leakkerneldeinterlace() for interlaced material? Before or after the colormatrix()?

Thanks again!

Audionut
31st March 2006, 06:18
I've found the same error on a clip of video. I do not get the error if the d2v file links to the entire source. My guess is the "opening gop is not closed" in the clip is throwing colormatrix off.

However, I'm only guessing, and you would need to either post in the colormatrix (http://forum.doom9.org/showthread.php?t=82217&highlight=colormatrix) or Dgdecode (http://forum.doom9.org/showthread.php?t=107731) threads for clarification.


I do not get an error if i call colormatrix as described below.
d2v

When specifying the d2v file it will take the colorimetry info directly from the d2v itself

Mpeg2source("F:\TestStreams\avs\AguileraGrammies.d2v")
ColorMatrix(d2v="AguileraGrammies.d2v")

This is useful when the colorimetry info doesn't change throughout your video (as is almost always the case), because it is much faster than using hints. If it does, it will output an error. If the d2v- file is located in a different folder as the AviSynth script you have to give the full path of the d2v-file.

For people who are interested, it is this (and consequent) line(s) in the d2v file

800 5 0 8210 0 0 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2

I've made the colorimetry info bold. See Colorimetry for an explanation of the info. The operation of the filter when the d2v parameter is specified is the same as with hints=true. If the input video's colorimetry already matches the destination colorimetry specified in the mode parameter, then the conversion is not applied. If the colorimetry does not match, then the conversion is applied.




This is a list of all possibilities according to the mpeg-2 specs and DGDecode, and behind it how GSpot abbreviates it
1 ITU-R BT.709___________________________________I709
4 FCC (almost the same as ITU-R BT.601)_____________FCC
5 ITU-R BT.470-2 (exactly the same as ITU-R BT.601)
(recommendation BT.601 is an update BT.470-2)_______I470
6 SMPTE 170M (exactly the same as ITU-R BT.601)_____S170
7 SMPTE 240M (almost the same as ITU-R BT.709)_____S240

For ColorMatrix we assume I709 = S240 and I470=FCC=S170, because the error will be very small.


I do not believe that colormatrix would interfere with leakkerneldeinterlace, therefore I would place it after colormatrix.

Boulder
31st March 2006, 06:25
You should use the interlaced=true parameter in ColorMatrix, I think there is such a thing. However, it probably just does SeparateFields().ColorMatrix().Weave() so it might be better to use ColorMatrix after deinterlacing/bobbing.

With hints=true, ColorMatrix should be the next line after MPEG2Source.

foxyshadis
31st March 2006, 08:05
You can always use CopyHints or whatever tritical's function is to clone them around. Then you actually can do it after deinterlace/ivtc (which is the point of the function).

Oh yeah, MergeHints.