AVS Forum banner

1 - 20 of 178 Posts

·
Registered
Joined
·
23,130 Posts
Discussion Starter #1
This thread is an adjunct to the AVS contrast thread, and also to the recent discussion of Cine4Home's DI article. The inspiration of this thread is that contrast is one of the "highest profile" image attributes out there, and with the help of the AVS Contrast Project, we are gaining a greater understanding of how differing projectors and projector technologies perform in this area.


However despite having that great new info, we have a rather significant problem, in that we don't really a good way to relate that information into the "real world".


So the idea of this thread is to shed light on the question:


"What are the characteristics of the 'typical' movie?"


To expand on that, what this thread is trying to do is collect data from a number of real movies and collect things like the distribution of APL, Peak Level, Min Level, and perhaps any other interesting/useful information.


So how are we going to go about doing this, well, over the course of a couple different threads, we've come up with a method that seems to work pretty well, it requires only two free tools:


DGIndex

AVISynth


The first step is to open up all the movie's VOB files in DGIndex, and then save the project (no need to save the audio).


The second step is to run the following AVISynth Script on the movie:
Code:
Code:
mpeg2source("dgindexprojectfile.d2v")
filename = "output filename"
ConvertToRGB()
Levels(16,0.4545,235,0,255,coring=false)
ConvertToYV12()
Crop(0,54,720,360)
Selectevery(24,0)
AssumeFps(240)
colon = " : "
WriteFile(filename, "current_frame", "colon", "YPlaneMin", "colon", "YPlaneMax", "colon", "AverageLuma" )
WriteFileStart(filename, """ "AverageLuma for Raiders8" """)
WriteFileStart(filename, """ "Frame : MinLuma : MaxLuma : AverageLuma" """ )
WriteFileEnd(filename, """ "End" """)
ConvertToYUY2()
A couple comments, mpeg2source should point the the project file you saved from DGIndex.

filename should point to the filename/path of the output file you want.

Crop should be adjusted to remove any black bars so they don't "contaminate" the results (could probably use autocrop).

SelectEvery is used to sample only once per second.

AssumeFPS is there to simply speed processing.


As posted, it's preferable to normalize the results into % by the following forumula:


normvalue = ( actualvalue - 16 ) / 219


I posited in the DI thread that the Levels command could be used to apply display gamma to the above script to convert from %stim to APL.


So, with that, I'll open this up for discussion, and for posting of results of the Script.

Results


Indiana Jones and the Raiders of the Lost Ark

Overall Average Luminance: 9.63%


ADL - proportion of frames below that ADL (and above the previous)

0.10% - 0.64%

0.20% - 0.74%

0.50% - 4.38%

1.00% - 6.31%

2.00% - 13.6%

5.00% - 23.4%

10.0% - 16.1%

20.0% - 7.55%

30.0% - 11.8%

40.0% - 5.01%

50.0% - 0.72%

100% - 0.52%

See attached image for graph.
 

·
Premium Member
Joined
·
4,710 Posts
Thanks for starting this thread. I think there are two issues that need to be addressed. The first is determining the correct methodology for calculating APL and the second is how best to try and perform a rough comparison of an actual film image to a checkerboard type test pattern based on the amount of luminance alone.


To me this second issue is really the rub. I think at best only the roughest of ranges might apply because precision more than that requires taking into account the other factors of contrast such as the geometry of the images and histogram distribution. It might be better then to just try and break it down to three ranges: low, middle and high APL and try to find a rough determination on what range of checkerboard patterns might apply (based on percent area) to these three ranges.


The discussion of relating APL to film images has come up in several other threads. Including this one:
http://www.avsforum.com/avs-vb/showthread.php?t=765552


It was from this thread that Eric Garci introduced the intrascene calculator:
http://home1.gte.net/res18h39/intrascene.htm


As was mentioned in the earlier threads. Checkerboard patterns are unique in that the average luminance is the same even after gamma coding has been applied. For an ANSI pattern for example it's 50% before and after gamma coding. At 50% I also speculate that its much too bright of a pattern to try and compare with what is happening in intra-image contrast with real scene information.


To see how gamma can affect the average luminance calculation we can take an image of a specific scene such as the starfield image in Eric's calculator. The average luma before gamma coding is 4.29% but after gamma coding it's only about 0.12%. So let's see where that particular scene would fall with the measured projector data below:




From this data we can see that 0.1% places it at the extreme end of the chart at close to the on/off limit of the projector. This seems to fit well with the general perception that on/off plays a huge role in dark scene performance and it would seem to suggest a rough match.


In fact if we take any of the images in the intrascene calculator with the exception of the nurse scene they all tend to be very dark and tend to fall in the region of projector performance that suggests the importance of on/off contrast.


The nurse scene is an interesting example. Most people would characterize it as a bright scene. It contains an average luma of 50% similar to the ANSI pattern but after gamma coding it only has an average luma of 21%. If we compare it to the projector data above it suggests that this region would favor ANSI performance. What's interesting is that even though this is a bright scene it still contains only about 1/2 of the luminance of the ANSI pattern and at this place along the curve the benefits of high ANSI is reduced. In other words a projector that has say a 3x advantage in ANSI contrast might only have a 2x or less advantage in intra-image contrast at this point along the curve. This might partially explain why people seem to have a hard time seeing differences in images based on ANSI CR alone. It's possible that the ANSI CR metric may be implying larger intra-image contrast benefits that don't exist with typical scenes, even scenes that most people consider to be bright.


EDIT: I should also point out that the AVS Contrast thread that is referenced in this thread can be found here:
http://www.avsforum.com/avs-vb/showthread.php?t=852467
 

·
Registered
Joined
·
23,130 Posts
Discussion Starter #3

Quote:
Originally Posted by Mark Petersen /forum/post/14241793


Thanks for starting this thread. I think there are two issues that need to be addressed. The first is determining the correct methodology for calculating APL and the second is how best to try and perform a rough comparison of an actual film image to a checkerboard type test pattern based on the amount of luminance alone.

That's basically the goal of the thread, though more for the first issue than the second.

Quote:
To me this second issue is really the rub. I think at best only the roughest of ranges might apply because precision more than that requires taking into account the other factors of contrast such as the geometry of the images and histogram distribution. It might be better then to just try and break it down to three ranges: low, middle and high APL and try to find a rough determination on what range of checkerboard patterns might apply (based on percent area) to these three ranges.

Oh, absolutely, but so far we can't even do that. I think the goal is not to be able to say "this scene would have a contrast of x based on the test pattern" since as you say, that can't be done due to geometry and other issues. I think what would be optimal to come from this thread is to gain a good understanding of what "average" is in terms of APL, where most movies fall in the spectrum between On/Off and ANSI type luminance, and maybe come up with some good examples of images/movies that would showcase each "type" of contrast.

Quote:
The discussion of relating APL to film images has come up in several other threads. Including this one:
http://www.avsforum.com/avs-vb/showthread.php?t=765552


It was from this thread that Eric Garci introduced the intrascene calculator:
http://home1.gte.net/res18h39/intrascene.htm

Yup, I actually concieved this thread when that one was going on but was too lazy to start it.

Quote:
As was mentioned in the earlier threads. Checkerboard patterns are unique in that the average luminance is the same even after gamma coding has been applied. For an ANSI pattern for example it's 50% before and after gamma coding. At 50% I also speculate that its much too bright of a pattern to try and compare with what is happening in intra-image contrast with real scene information.

One thing to consider (and I think this is born out by Eric's calculators) is that being so bright, the ANSI pattern effectively bounds performance on the upper end, with almost no content exceeding it. Likewise On/Off bounds it on the other end.


FWIW, I had some success using Levels() in AVISynth to attempt "Gamma coding" the frames before pulling the min/max/average data, so I'll try and post that tonight and we can see how it compares to what we'd expect.
 

·
Registered
Joined
·
7,982 Posts
Would you guys please explain just what you mean by "gamma coding?" In video, gamma is the non-linear relationship between input signal going into the display and the output signal you actually see on the screen.


So, for example, a 2.2 gamma has this relationship of input to output:


Input - Output

10% - 0.63%

20% - 2.90%

30% - 7.07%

40% - 13.3%

50% - 21.8%

60% - 32.5%

70% - 45.6%

80% - 61.2%

90% - 79.3%


When it comes to film material, I am having a hard time understanding what is the input and what is the output. Clearly, what you see on the screen or on a monitor is the output, but wehat was the input. Not signal voltage.


Also what does gamma have to do with determining APL? Hadn't we already decided that the correct methodology was (average luma -16)/219? Where does gamma come into this?
 

·
Registered
Joined
·
23,130 Posts
Discussion Starter #5

Quote:
Originally Posted by TomHuffman /forum/post/14243372


Would you guys please explain just what you mean by "gamma coding?" In video, gamma is the non-linear relationship between input signal going into the display and the output signal you actually see on the screen.


So, for example, a 2.2 gamma has this relationship of input to output:


Input - Output

10% - 0.63%

20% - 2.90%

30% - 7.07%

40% - 13.3%

50% - 21.8%

60% - 32.5%

70% - 45.6%

80% - 61.2%

90% - 79.3%


When it comes to film material, I am having a hard time understanding what is the input and what is the output. Clearly, what you see on the screen or on a monitor is the output, but wehat was the input. Not signal voltage.

The basic issue is that the values stored on the disc do not map linearly to the actual luminance on the screen. The display device applies a gamma to the input before displaying it. So the input would be the values on the disc, and the output would (normally) be what's displayed on the screen.


As Mark pointed out, the contrast test patterns avoid Gamma issues because they use full white/black thus are unaffected by Gamma. Now we want to collect data representative of what's displayed on the screen from "real world" content, but it's completely impractical to do that using a sensor and a display so we need to find an alternative means.


One possiblity is to "simulate" a display, applying a display Gamma to the source data on the disc, and collecting metrics on the result.

Quote:
Also what does gamma have to do with determining APL? Hadn't we already decided that the correct methodology was (average luma -16)/219? Where does gamma come into this?

That's the correct methodology for normalizing the source data, but the problem is the source data is still luma, or % Stim, not APL or what we see (or measure) on the screen.


Poynton has a good explanation of Gamma and how it fits into the system:
http://www.poynton.com/PDFs/GammaFAQ.pdf
Quote:
The intensity of light generated by a physical device is not usually a linear function of the applied signal. A conventional CRT has a powerlaw response to voltage: intensity produced at the face of the display is approximately the applied voltage, raised to the 2.5 power. The numerical value of the exponent of this power function is colloquially known as gamma. This nonlinearity must be compensated in order to achieve correct reproduction of intensity.


In a video system, linear-light intensity is transformed to a nonlinear video signal by gamma correction, which is universally done at the camera.

So what we have (on the disc) is a non-linear representation of what the camera saw, and what is to be displayed. What the AVISynth script above captures is luma, which is a weighted average of nonlinear R'G'B' components, denoted as Y'.


What we need, in order to relate source data to the measurements by Mark and others is luminance (Y), which is the weighted sum of the linear RGB components.


So, to get average luminance (which I believe is what APL describes) we need to undo the gamma correction done by the camera, which can be done with the following equation:



Unfortunately that's quite hard to do with AVISynth, but we can approximate it with the levels filter:
Code:
Code:
ConvertToRGB()
Levels(16, 0.45, 235, 16, 235)
ConvertToYV12()
We need to convert to RGB so levels can apply the gamma correction to each RGB component, then we need to convert back to YV12 so WriteFile's Luma parameters can read the values. This has the (unwanted) side effect of clamping the signal to 16-235, thus obliterating BTB and WTW, but for our purposes I think that's acceptable.
 

·
Registered
Joined
·
1,347 Posts
Ok I'm going to show my ignorance here. But, one of the problems with the ANSI checkerboard is that it uses full white for the checker board. Now, as I understand it using less than full white would be better except the projectors gamma gets in the way. So, why not instead of using gray pixels for the white square make it a mixture of alternating single pixels of full white and black. Since the sensors available average groups of pixels you would in essence be measuring a gray field on average and the projectors gamma would not play a part.
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by stanger89 /forum/post/14242229


FWIW, I had some success using Levels() in AVISynth to attempt "Gamma coding" the frames before pulling the min/max/average data, so I'll try and post that tonight and we can see how it compares to what we'd expect.

It'll be really interesting to see these results.

Quote:
Originally Posted by TomHuffman /forum/post/0


Would you guys please explain just what you mean by "gamma coding?"

It just means the output after gamma is applied to the input. Since it's non-linear the avg. calculation has to be done with every point in the image after gamma is applied rather than take the average input and then apply gamma.

Quote:
Originally Posted by TomHuffman /forum/post/0


Also what does gamma have to do with determining APL? Hadn't we already decided that the correct methodology was (average luma -16)/219? Where does gamma come into this?

I originally thought that APL was the average image luminance after gamma coding but there is a lot of literature to suggest that it's just average luma before the display gamma is applied. For the purpose of this discussion though I don't think the definition of APL is important so long as we consistently apply the gamma coded forumula in discussions about contrast as I think that's whats really relevant.


For what it's worth Joe Kane Productions defines APL as:

"APL (Average Picture Level)

The video signal level, during the active picture part of each horizontal line, is mathematically averaged over the period of a frame to come up with APL. A 100 IRE Window pattern has a lower APL than a 100 IRE Flat Field pattern. Television program material is said to have a 15% average picture level over a long period of time. The Window patterns used for setting gray scale in all three titles have a 16% APL so that they will closely represent normal program material in their current drain on the high voltage power supply. The width of the Window was enlarged the extra 1% to accommodate the shape of the Philips PM5539 Color Analyzer which was on the market at the time of A Video Standard. That wide aspect ratio shape was passed on to Video Essentials. The computer world uses a much higher number for APL over time, that of 35%. That is reflected in the ANSI Checkerboard Patterns, VE T17 C27. "


I also found some literature where others have done this sort of APL study before. Here is a reference from IEEEXplore:


"Distribution of average picture levels in television programmes

Quinn, S.F.; Newman, P.M.

Electronics Letters

Volume 1, Issue 9, November 1965 Page(s):261 -

Digital Object Identifier 10.1049/el:19650235

Summary:An analysis of measurements made over 14½ hours of television programmes is presented, to show the distribution of average picture levels as a percentage of total time. It has been found that for 90% of the time the average picture level is between 20 and 70% and that the mean value of the distribution is close to 40%."


Here is another definition:

"average picture level (APL): In video systems, the average level of the picture signal during active scanning time integrated over a frame period; defined as a percentage of the range between blanking and reference white level."


And another:

APL - Average Picture Level

By: Bruce Bahlmann



The average signal level with respect to blanking during the active picture time. APL is expressed as a percentage of the difference between the blanking and reference white levels. APL represents the video signal level, during the active picture part of each horizontal line, is mathematically averaged over the period of a frame to come up with APL. A 100 Institute of Radio Engineers (IRE) Window pattern has a lower APL than a 100 IRE Flat Field pattern. Television program material is said to have a 15% average picture level over a long period of time. "
 

·
Registered
Joined
·
7,982 Posts
OK, but if the average luminance values that we capture on the disc is the input, then gamma coded APL output will be smaller (50% input gets you 21.7% output @ 2.2 gamma).


Why then does this white paper show the relationship in the opposite direction? Look at pages 10-12. He shows the gamma coded output APL as LARGER than the linear average luminance input.

http://www.etconsult.com/papers/Blac...tt%20Cowan.pdf


Which is it?
 

·
Registered
Joined
·
7,982 Posts
Mark:


What Kane reports

"Television program material is said to have a 15% average picture level over a long period of time."


and what the Quinn and Newman paper reports

"It has been found that for 90% of the time the average picture level is between 20 and 70% and that the mean value of the distribution is close to 40%."


cannot both be true.


I don't think that we are working with a clearly defined set of terms.


The data I collected showed a fairly consistent average luma in the low-to-mid 20s. How does that relate to these quotes regarding APL? There can't be a gamma difference, because the numbers are too similar.
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by mdputnam /forum/post/14244316


Ok I'm going to show my ignorance here. But, one of the problems with the ANSI checkerboard is that it uses full white for the checker board. Now, as I understand it using less than full white would be better except the projectors gamma gets in the way. So, why not instead of using gray pixels for the white square make it a mixture of alternating single pixels of full white and black. Since the sensors available average groups of pixels you would in essence be measuring a gray field on average and the projectors gamma would not play a part.

This is an interesting methodology and something that I've thought about before. There are a lot of issues that need to be resolved in order to gleen something useful out of this though. The MTF of the display device will play a big role in any alternating on/off pixel patterns. There is also the issue of trying to ramp luminance by using a pattern like that. Does one keep the same pattern and use larger/smaller checkerboards or alter the underlying on/off pattern for example.


Fundamentally though I don't think that there is a problem using full white and full black checkerboxes. The challenge is trying to understand how to interpet the information that they convey to images based on APL alone and I think you'll have the same challenge with other patterns like these alternating on/off ones.
 

·
Registered
Joined
·
23,188 Posts

Quote:
Originally Posted by Mark Petersen /forum/post/14241793


Checkerboard patterns are unique in that the average luminance is the same even after gamma coding has been applied.

That is true for checkerboard patterns where the brightest rectangles are 100 IRE. For a checkerboard that is 50/0 in %stim or IRE the ft-lamberts or luminance (post gamma) would be about 20% of that 100/0 checkerboard.
Quote:
Originally Posted by mdputnam /forum/post/14244316


Ok I'm going to show my ignorance here. But, one of the problems with the ANSI checkerboard is that it uses full white for the checker board. Now, as I understand it using less than full white would be better except the projectors gamma gets in the way. So, why not instead of using gray pixels for the white square make it a mixture of alternating single pixels of full white and black. Since the sensors available average groups of pixels you would in essence be measuring a gray field on average and the projectors gamma would not play a part.

Going along with what Mark said about MTF, if you mean a single pixel checkerboard then I think this would be a problem with LCOS projectors. At least the latest JVC ones. I don't know the specifics, but they have some trouble with single pixel checkerboards. I think it is that the white pixels end up being smaller than they should be, with the average luminance in that section being dimmer than it should be. Using alternating white and black lines in either direction may or may not cause problems as far as trying to hit 50% ft-lamberts or luminance. Calculating based on the current ANSI checkerboard may actually have less problems with some technology.


--Darin
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by TomHuffman /forum/post/14244475


OK, but if the average luminance values that we capture on the disc is the input, then gamma coded APL output will be smaller (50% input gets you 21.7% output @ 2.2 gamma).


Why then does this white paper show the relationship in the opposite direction? Look at pages 10-12. He shows the gamma coded output APL as LARGER than the linear average luminance input.

http://www.etconsult.com/papers/Blac...tt%20Cowan.pdf


Which is it?

That paper has tripped me up before too. Someone suggested that the use of the term gamma coding means camera gamma rather than display gamma. It has the note (see on waveform monitor) which implies that this notion is correct. So I think they are comparing film luminance to post camera gamma coded APL. Since camera gamma has an inverse shape from display gamma it may explain why the relationship seems reversed in the white paper from what we would expect. What we really want to do is compare film luminance to projector luminance after the display gamma has been applied.


I think people use the term APL to mean different things depending on what part of the display pipeline they are talking about. To be clear maybe what we should do is coin our own term and call it display APL.
 

·
Registered
Joined
·
4,644 Posts

Quote:
Originally Posted by Mark Petersen /forum/post/14241793


The average luma before gamma coding is 4.29% but after gamma coding it's only about 0.12%.

CORRECTION: The average luma before gamma coding is 4.29% but after gamma coding the average luminance is only about 0.12%.
Quote:
Originally Posted by Mark Petersen /forum/post/14241793


It contains an average luma of 50% similar to the ANSI pattern but after gamma coding it only has an average luma of 21%.

CORRECTION: It contains an average luma of 50% similar to the ANSI pattern but after gamma coding it only has an average luminance of 21%.


Note that average luma is calculated before the display's gamma is applied, and average luminance is calculated after the display's gamma is applied.
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by darinp2 /forum/post/14244695


That is true for checkerboard patterns where the brightest rectangles are 100 IRE. For a checkerboard that is 50/0 in %stim or IRE the ft-lamberts or luminance (post gamma) would be about 20% of that 100/0 checkerboard.

Yup, 100%stim checkerboards like the ANSI pattern are the ones that I meant although I should have clarified what I meant.
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by Erik Garci /forum/post/14244729


CORRECTION: The average luma before gamma coding is 4.29% but after gamma coding the average luminance is only about 0.12%.


CORRECTION: It contains an average luma of 50% similar to the ANSI pattern but after gamma coding it only has an average luminance of 21%.


Note that average luma is calculated before the display's gamma is applied, and average luminance is calculated after the display's gamma is applied.

Hi Erik, yes I should have said average luminance to be more clear.
 

·
Registered
Joined
·
4,644 Posts

Quote:
Originally Posted by Mark Petersen /forum/post/14244721


To be clear maybe what we should do is coin our own term and call it display APL.

I think the term "display APL" might be an oxymoron. I typically use the terms "average luma" and "average luminance." Since luma and luminance sound similar, the terms "average signal level" and "average display luminance" might be better. Maybe ASL and ADL.
 

·
Registered
Joined
·
23,130 Posts
Discussion Starter #17
Erik,


Thanks for stopping by, would you care to comment on my take on the situation:


1) The ANSI pattern is both 50% luma, and 50% luminance (due to being made from 100%/0% boxes), the same is true of Mark's static test patterns, ie their %luma = %luminance.

2) What we care about, in attempting to relate real-world images to these test patterns is luminance (vs luma), which I/we have been referring to as APL.

3) Applying a per-pixel, per-frame, inverse-camera gamma correction will successfully approximate luminance.
 

·
Premium Member
Joined
·
4,710 Posts

Quote:
Originally Posted by Erik Garci /forum/post/14244846


I think the term "display APL" might be an oxymoron. I typically use the terms "average luma" and "average luminance." Since luma and luminance sound similar, the terms "average signal level" and "average display luminance" might be better. Maybe ASL and ADL.

"ADL" and "ASL" are perfect
 

·
Registered
Joined
·
7,982 Posts
This may be true.


What I am trying to figure out is what the data on nearly 20,000 frames from 3 films means?


The white paper reports this image




as having an average luminosity of 95.5 and an APL of 37%. This relationship corresponds almost exactly to the relationship between the average luma and the normalized values that I reported for the 3 films I sampled.


Yet, I gather that you believe that there is yet some further calculation required to account for gamma coding. What would that be? Applying a 2.5 gamma to .37 (if that is to be understood as the % stim) results in 8.3. I can't believe that you mean to say that we should interpret the display APL (or whatever you choose to call it) of this relatively bright image as 8.3 APL.


I really don't see where this is going.

Quote:
Originally Posted by Mark Petersen /forum/post/14244721


That paper has tripped me up before too. Someone suggested that the use of the term gamma coding means camera gamma rather than display gamma. It has the note (see on waveform monitor) which implies that this notion is correct. So I think they are comparing film luminance to post camera gamma coded APL. Since camera gamma has an inverse shape from display gamma it may explain why the relationship seems reversed in the white paper from what we would expect. What we really want to do is compare film luminance to projector luminance after the display gamma has been applied.


I think people use the term APL to mean different things depending on what part of the display pipeline they are talking about. To be clear maybe what we should do is coin our own term and call it display APL.
 

·
Registered
Joined
·
4,644 Posts

Quote:
Originally Posted by stanger89 /forum/post/14244948


1) The ANSI pattern is both 50% luma, and 50% luminance (due to being made from 100%/0% boxes), the same is true of Mark's static test patterns, ie their %luma = %luminance.

Technically, for those patterns, the average luminance may be slightly greater than the average luma, depending on the display's on/off CR, but the difference is usually less than 1% so it can be ignored.
Quote:
Originally Posted by stanger89 /forum/post/14244948


2) What we care about, in attempting to relate real-world images to these test patterns is luminance (vs luma), which I/we have been referring to as APL.

In typical usage, the term APL refers to the average level of the signal before the display's gamma is applied. If you use the term APL to refer to something else, then you run the risk of confusion.
Quote:
Originally Posted by stanger89 /forum/post/14244948


3) Applying a per-pixel, per-frame, inverse-camera gamma correction will successfully approximate luminance.

I think it will probably be good enough for most images.
 
1 - 20 of 178 Posts
Top