Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 1st February 2009, 18:14   #1  |  Link
zee944
Registered User
 
Join Date: Apr 2007
Posts: 240
mt_lut problem / How luma is calculated in YV12?

I have a script in which I make the pixels black below luma 40 and over luma 230 with mt_lut:

Code:
LoadPlugin("E:\mt_masktools[2.0a30].dll")

ImageReader("gradient-h.jpg")
ConvertToYV12()
unprocessed=last

mt_lut(last,expr="x 0 >= x 40 <= & 0 x ?",U=2,V=2)  # between luma 0 and 40, make it black
mt_lut(last,expr="x 230 >= 0 x ?",U=2,V=2)  # between luma  230 and 255, make it black
# mt_lut(last,expr="x 40 >= x 90 <= & x 40 - 90 40 - / 90 * x ?",U=2,V=2)
# mt_lut(last,expr="x 180 >= x 230 <= & 180 x 180 - 230 180 - / 180 * - x ?",U=2,V=2)

StackVertical(unprocessed,last)
When I check the result, the cut off point is at luma 29 and 248... instead of the desired 40 and 230. The original image contains only grey shades from [0, 0, 0] to [255, 255, 255]. In the resulting image the darkest pixel is [29, 29, 29], the brightest is [248, 248, 248] in RGB colorspace:



Why? Shouldn't be the cutoff point at [40, 40, 40] and [230, 230, 230]?

How can I fix it?

How luma is converted from RGB to YV12? How an [29, 29, 29] RGB pixel becomes [40, 40, 40] in YV12? Is there a formula for that?

zee944 is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.