Quantcast Avisynth: Anime Filters? - Page 2 - digitalFAQ.com Forums [Archives]
  #21  
01-26-2005, 07:40 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
What about if I want to encode an MPEG for PC and NOT for TV
If the encoder clips the levels, the result is not acceptable on a PC monitor.
#1 - I did not say it is not an option. Tmpgenc and CCE let you the choice but the default is to encode in TV scale.
#2 - even if this was not an option, using limiter in a clip is still a nonsense, moreover if you want to encode for PC monitor.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
01-26-2005, 07:46 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by incredible
So the best would be to fix the luma within the script to exact 16-235 (even on very well known mastered sources as you see above ) and finally doing a conversation at the very end of the script to the encoders native colorspace where in the encoder an untouched luma encoding (non!-CCIR601) will be done, To me that results in an encoding in a FULL luma/chroma detail encoding where still 16-235 CCIR601 Luma TV Specs are guaranteed.
For sure not !
Since when having numbers in entry that are 16-235 gives you number in output that are 16-235 also ???
If you do not tell to the encoder to round (or clip, or scale - it depends on the tool) its internal maths to 16-235 then whatever you give to it, it generates numbers between 0-255 !
Reply With Quote
  #23  
01-26-2005, 08:19 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
#2 - even if this was not an option, using limiter in a clip is still a nonsense, moreover if you want to encode for PC monitor.
Not if you're encoding for a "Streaming" target over the net, where the destination is a PC monitor

-kwag
Reply With Quote
  #24  
01-27-2005, 03:17 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by incredible
AFAIK but still I not proofed that .... CCE only affects the Luma range IF the input is RGB, means at YUV inputs no affection will be done (even if set to 16-235) .... but as said I "heared" about that. So that has to be proofed also
At least that's what the manual says so I would expect it to be that way. The range is used for converting from RGB to YUY2 in which the encoder works internally.
Reply With Quote
  #25  
01-27-2005, 03:23 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
Originally Posted by Dialhot
For sure not !
Since when having numbers in entry that are 16-235 gives you number in output that are 16-235 also ???
The luma range would be padded in its super values. But the movie treatment informations would be within 16-235.
What you see is what you get and thats why my re-encodings (especially captures .. but the logic is the same) where never clipped, too dark, too bright or even in their details cropped.
Quote:
If you do not tell to the encoder to round (or clip, or scale - it depends on the tool) its internal maths to 16-235 then whatever you give to it, it generates numbers between 0-255 !
Basic YCbCr komponent output regulary means "do encode what you get and dont touch it" thats th logic, but some people say so or so according to TmpgEncs internal routines and that has to be proofed.
IF the non-CCIR setting in tmoegenc results in a blowed up luma range from whatever to 0-255 RGB than this also could happen via the decoder of the system as tmpgenc requests rgb24 thats why I said, to convert in the script to the native colorspace of the encoder.
also its a thing of the mpeg stream provided coefficents of color luma as "it could be" that a real 16-235 luma ONLY data would be encoded, means less luma/chroma data, means smaller encoding sizes?

We should do a real test, means a clear table where all steps are mentioned and the final image output compared to the orig or even optimal state.



http://www.digvid.info/tmpgenc/settings_quantize.php
Quote:
Output YUV Data as basic YCbCr not CCIR601

This affects the range of values accepted for luminance and chrominance signals. YCrCb is raw samples, taking the range 0-255. In TV systems CCIR601 is normally used, which restricts the allowed range to 16-235 for luminance and 16-240 for chrominance signals. If you are mastering for TV (e.g. VCD, SVCD, DVD) then do not tick this option.
To me that means not "forcing a convers. of the ACTIVE Luma to a 0-255 range" but taking whats happning within the whole 0-255, means to me "untouched".

But anyhow, if you go out in the script using perfect 16-235 CCIR Video Data, then no matter if let YCrCb raw untouched or CCIR "cropped"!, the result would be a full ACTIVE detail range of 16-235 within CCIR(16-235) or raw YCrCb(0-255).

Also IF you do correct the luma range its better to use Levels() in avisynth instead of a simple Coloryuv() incl. pc-tv scale as it gots an internal FIXED math for scaling!
A simple Levels(x,x,x,x,x) usage DOES crop the luma input first to CCIR 16-235 specs so watch out, thats why I ALWAYS use the parameter "coring=false" in levels, which uses the FULL luma input for correction via its values in the commandline, otherwise luma first will be cropped and then be corrected.

The only pro argument for just cropping the luma is that the luma histogram itself between 16 and 235 wont be affected at all, but what happens if already the source is NOT CCIR conform encoded? I got many DVDs which are in such a state. In case of a high contrast capable Beamer output its nice and supports the beamers Contrast Specs. but for TV it would be a mess or the luma could be cropped before by the SAP like my cyberhome does thats why some SAPs cant really support the THX optimizer in its Brightness/contrast Patterns in a correct way.
Reply With Quote
  #26  
01-27-2005, 02:27 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
I have been reading a lot of posts and a special one which deals with exactly that problem of Cspace conversions and especially Tmpgenc/CCE.

The resumeé is:

Conversions between all YUV format like YV12 and YUY2 wont touch the luma range. BUT if a conversion is done between YUV and RGB in avsiynth the luma will be "stretched" to 0-255 or othewiese "cutted" to 16-235. Thats the case IF NO additional coefficient parameters are set in the ConverttoXXX() command! http://www.avisynth.org/Convert

The first risk is WHAT vfw codec is used when loading a video source into avisynth via Avisource(). Here already some codecs do stretch or expand or cut, so every codec model gots his own way of handling.

mpeg2dec3 by MarcFD doesnt touch the luma range, so a perfect 16-235 DVD in avisynth is kept by the mpeg2source command. Also a 0-255 DVD is kept at 0-255.

Lets see what happens:

A simple d2v file in a 16-235 Luma rangeout of a DVD will be imported into avisynth, no conversion etc., so YV12 is still the result out of the script:

mpeg2source("16-235.d2v")

Result:
TmpgEnc with CCIR option enabled = Cant be specified as all lays on the decoder in the system which handles the YV12 to RGB24 conversion, means mega Tricky as its individual codec specific if the luma range is kept or scaled!
TmpgEnc NO CCIR option enabled = Same as above!


mpeg2source("16-235.d2v")
ConverttoRGB24()

This causes a 16-235 to 0-255 expanding due a default YUVtoRGB Cspace conversion in avisynth when using NO coefficient parameters in the converttoXXX() command.

Result:
TmpgEnc with CCIR option enabled = Correct output! as the luma range of 0-255 will be "copressed"!! (not cropped!) to 16-235.
TmpgEnc No CCIR option enabled = 0-255 input is kept as NO luma modification is done! Whaterver comes in, it will be encoded untouched, means 16-235 stays 16-235, 0-255 stays 0-255!

Conclusion on TmpgEnc:
If you use Converttorgb24() and the CCIR option in TmpgEnc the luma will be expanded and compressed within the whole video-job. To me thats not they 100% way, better staying totally at 16-235 by converting to RGB24 using the convertto parameter to KEEP the luma 16-235! Afterwards NO CCIR option checked and you get a NON Luma touched encoding of your source.

But what happens if going with a YV12 (16-235) Cspace into TmpgEnc?? As said thats tricky AS if the decoder (YV12 to RGB24) used by the system KEEPS the 16-235 range when decoding TO rgb24 you will get a too bright encoding IF then CCIR is checked as CCIR option in TmpgEnc DOES compress the luma no matter which luma range comes in.

Now, CCE:
Very easy ALL YUV inputs will be untouched! No matter if "16-235" option in CCE settings is set or not, as that option ONLY affects RGB feeded to the CCE.

SO imho limiter() at the end makes no sense as anyway we use converttorgb24() which stretches the luma back to 0-255. Also in case if NO converttorgb24() is included as by that 2 possibilities are given:
1. The system decoder keeps the 16-255 (out of limiter()) and a CCIR based encoding in TmpgEnc will brighten too much the encoding.
2. The system decoder expands the 16-255 (out of limiter()) to 0-255 and a CCIR based encoding in TmpgEnc will result correctly.

But now there will be the question "Hmmmm If my original already IS 0-255 the converttorgb24() by this will expand my already 0-255 OUT of the range?? As the command just uses an internal FIX math??? So luma cropping via limiter() BEFORE converting to rgb for me is a MUST!"
Logically seen thats like a luma cropping where afterwards in TmpgEnc the "scaling" to CCIR also here will result like if it would have been cropped to 16-235 So that would be THE SAME result as if you would use limiter() ... means also here in the script no limiter is needed.
Reply With Quote
  #27  
01-27-2005, 05:56 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Hmmmmm .... I did new tests, maybe TmpgEnc has changed his internal luma handling in rgb 0-255 AND rgb 16-235 input when checking/unchecking CCIR or Avisynth has changed hmmmm......

Status now .... No CCIR checked to me now seems a forced stretching to 0-255 and CCIR seems ALSO to force a stretch to 16-235 (this stretch factor is also given IF an rgb already gots correct 16-235 as input = fatal!)
Reply With Quote
  #28  
01-28-2005, 10:20 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Scaling isn't the option to use every time. I just did a small test on my latest capture file which reportedly has values over 235.





The scaled image looks washed out when compared to the original and the limiter one. You might not notice it on this page, but save the three images and view them sequentially.
Reply With Quote
  #29  
01-28-2005, 06:41 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Boulder thats exactly the point:
Quote:
which reportedly has values over 235
Means a not clear 0-255 or 16-235 Range ... a washed out picture results out of a "simple fixed" math of ColorYUV incl. PCtoTV params.

First you should check what range is provided by your PVR's driver, it should be 16-235 YUV (YV12), but your statement "above 235" already is serious to me.

ALSO I did find out today that the used Coefficients in YUV-RGB-YUV Conversions are a very importand thing, thats why Colormatrix does exist. Also in The ConverttoXXX() Commands you can set 601 and 709 Coefficients.

"Washed out Colours" ... does it mean to you less contrast on the whole Picture? As the TV compensates that to a TV-full-Contrast range.
On your last Picture I can clearly see more Luma Details on the Mans right Arm. Look at the reflexion of the Mirror on the Doorwindow! And even that will be more dark (in relation) on TV as 16 is Black and 235 is white.
Please do keep in mind that Im talking about TV purposed Encodings

ALL captures should be set to keep the clear 16-235 Range, my 7134Cards Driver Settings got Sliders to affect the outgoing of Contrast and Brightness, on my 1734 for example if Contrast and Brightness are set to default the range is Shitty as its between 0-255 and 16-255, means no conversion afterwards would result ok if you want to keep all luma details.

So I wouldnt use ColorYUV incl. PCtoTV params., better is this:

mpeg2source(....)
Levels(0,1.0,255,0,255, false)
Histogram("Levels")

Now scroll through your capture and watch the histogram right above. Im shure you will have to tune a bit the range so it fits the correct 16-235.

So use the levels options to match the range (dont forget to set ",false" as a coring would "crop" all below 16 and above 235 before acting, ... like Limiter().

As said above limiter() isnt needed as a converttorgb24() will make all values below 16 and above 235 exceeding the rgb range, means cropped where in TmpgEncs CCIR option 16-235 again will be the encoded result.
Reply With Quote
  #30  
01-29-2005, 09:47 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
What I mean by washed out is that the scaled image looks like there's a slight grey haze over the whole image.

I do a ColorYUV(off_y=5,gain_y=-16) on my captures, the values were determined like in the Doom9 capture guide. Basically that scales stuff to 16-235 but that doesn't turn the image into washed out look.

I just checked and the PVR outputs 0-255 values, at least according to ColorYUV(analyze=true).
Reply With Quote
  #31  
01-30-2005, 11:59 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
Originally Posted by Boulder
I just checked and the PVR outputs 0-255 values, at least according to ColorYUV(analyze=true).
Do a ......

Mpeg2source("pvrCapture.d2v")
Histogramm("Levels")

comparison with ....

Mpeg2source("pvrCapture.d2v")
ColorYUV(analyze=true)
Histogramm("Levels")

... and I saw that already Coloryuv in a simple analyze mode (not modifying mode) already does affect the source Range.
Reply With Quote
  #32  
01-30-2005, 12:16 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, IMHO the difference comes from the fact that ColorYUV outputs the text over the existing video which then alters the histogram.
Reply With Quote
  #33  
01-30-2005, 12:28 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
In some cases of mine there was a significant affection of the superblack level, means a spike at 0 or between 0 and 5. Without Coloryuv in analyze mode there isnt such a spike.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Anime Script in Avisynth? hoyahoya Avisynth Scripting 1 09-13-2004 09:49 AM
Avisynth: GOP 12 for anime? why not 30? Hydeus Avisynth Scripting 14 03-26-2004 05:09 PM
Avisynth: Anime filter? canon Avisynth Scripting 1 12-16-2003 02:51 PM
KVCD: Two nice filters Good for other than anime? Gaudi Video Encoding and Conversion 0 12-28-2002 12:13 PM
SansGrip Filters: Filters/settings for animation/anime akrein62 Avisynth Scripting 2 11-24-2002 01:39 AM

Thread Tools



 
All times are GMT -5. The time now is 02:10 PM  —  vBulletin © Jelsoft Enterprises Ltd