Results 1 to 8 of 8

Thread: Lossy LOG vs. Lossy LIN

  1. #1
    Legend lordtangent's Avatar
    Join Date
    Jun 2007
    Location
    Albuquerque, NM
    Posts
    1,122

    Default Lossy LOG vs. Lossy LIN

    This might seam a bit OT until you realize how this phenomena effects "Cinemode" in the same way the Log encoding effects the results of my lossy compression test. Read on...

    After reading an article on how LOG encoding helps spare the shadow detail when doing lossy compression, I had to test the notion myself. The idea is really compelling to me. (it seems to almost defy logic... until you think about what is going on under the hood.. I mean, in your brain... the relationship of the perceptual stuff to reality )

    Anyway, I devised a test similar to the one outlined in the article. I used Jpeg2000 as my "lossy" format because it's the closest thing to Cineform I have access to. (JPEG2000 is wavelet based) The JPEG200 plug-in I used was perfect because it allowed me to use 10 bits per component in RGB, (Not YCC) similar to Cineform RAW. (Also allowing me to not lose any precision from the original lossless Cineon file I started with)

    Starting with a log image (in this case the Kodak dlad "Marcy" image) All color space conversions done in floating-point color space so "rounding error" doesn't compromise the results.

    1. encode the log image to to lossy format (low enough quality so we can see artifacts)

    2. Make a linear version of the same image. (I was careful to make a true linear version by adjusting the LOG to LIN parameters to output an un-gamma corrected linear version) Encode that into a lossy file of the same quality. (same file size)

    3. reload both images from lossy files and color time them to look "good" (Log to Lin the log image and color time the linear image to look the same)

    4. Compare the quality of the resulting images.

    The results were really interesting. I'm sending you guys a link to the (losslessy encoded) color graded output frames. They are only 8 bit but since they are post color correction so it's not as big a deal. You can see the differences pretty clearly. If you look closely you'll notice it seems as if the image that was compressed in linear space looks like it used way too many of its "bits" on highlight detail while not preserving any for the mid tones and shadows. The LOG encoded file seems to have used its bits more uniformly (perceptually at least) and has a more uniform distribution of quality.

    Keep in mind I intentionally encoded these files to have a low enough quality setting to show some compression artifacts. (I needed to see enough artifacts to judge if one color space was better than the other at surviving lossy compression) To get the quality low enough, the JPEG2000 files ended up being an astonishing 400KB. We are talking about 10 bit per component 2k res files! With a little more bandwidth (about 1.5-2MB per frame), the artifacts on the LOG version go away completely. I mean, all the way down the film grain. There is no visible loss at all. Even when you diff the frames together in Photoshop. When you compare that to the original 12.1MB file size... I mean, wow, JPEG2000 is pretty amazing! Cineform must be pretty great if it's even close.

    Results:
    http://hv20.info/yopu/lossy_log.png
    http://hv20.info/yopu/lossy_lin.png

    Pixel Harvest is doing 3¢ per frame 2k film scans in LOG encoded Cineform avi format. (Basically, AVI movie files ready to edit in Premiere or After Effects)
    http://www.pixelharvest.com/

    Maybe shooting on film isn't as far out of reach as I always though...

    OK, so how does this relate to the HV20 and Cinemode? Well, Cinemode is a LOG or LOG-like curve. (Not the same as the Cineon LOG I was doing my testing with, but similar) Hence, it should help the image survive HDV compression a little better than regular TV gamma. (Which has the same effect only not as strong)

  2. #2
    Junior Member
    Join Date
    Oct 2007
    Posts
    2

    Default thanks

    Thank you, this is very informative.
    I wonder : How do you know that the CINE mode is in log-scale. Where did you get the information ?
    Also, is the choice of log/lin scale a standard choice (with flag) in the mpeg2 stream format ?
    Thanks
    sam

  3. #3
    Legend tcindie's Avatar
    Join Date
    Sep 2007
    Location
    Twin Cities, MN
    Posts
    1,019

    Default

    Quote Originally Posted by lordtangent View Post
    Pixel Harvest is doing 3¢ per frame 2k film scans in LOG encoded Cineform avi format. (Basically, AVI movie files ready to edit in Premiere or After Effects)
    http://www.pixelharvest.com/

    Maybe shooting on film isn't as far out of reach as I always though...
    Depends on your resources. If you're shooting 16mm you will get 40 frames per foot at 24fps, with 35mm you'll get 16frames per foot at 24fps.

    100 feet of 16mm will yield (not counting what you loose from loading and unloading) about 2 1/2 minutes of footage.

    Even before you figure in processing and film stock costs, and whatever extra costs are involved in transfer above and beyond that $.03/frame, you're still looking are somewhere in the neighborhood of $500 for about 30minutes of processed and transferred footage. $500 for half the footage you can fit on one dv tape. You'd be much better off at that rate to use a 35mm adapter, lug around a computer with a big raid array, and capture 4:2:2 24p with a blackmagic card. It'll still cost a lot less in the end, it's more immediate, and the quality will be just as good.

  4. #4
    Legend lordtangent's Avatar
    Join Date
    Jun 2007
    Location
    Albuquerque, NM
    Posts
    1,122

    Default

    Quote Originally Posted by samuel View Post
    Thank you, this is very informative.
    I wonder : How do you know that the CINE mode is in log-scale. Where did you get the information ?
    Also, is the choice of log/lin scale a standard choice (with flag) in the mpeg2 stream format ?
    Thanks
    sam

    It's just a hunch based on how it looks. It could just be a different video gamma, or combinaiton of other different "video" type adjustments. I need to shoot some charts and plot them out to know for sure.

    One thing IS for sure,what we see in the HV20 IS NOT the same type of full-range LOG used in cineon, which is what I used for my tests. (It's not even possible to expose the dynamic range required on the HV20) At best what the HV20 produces is a log curve normalized to hit peak white. (Very similar to "gamma", only biased more to brighen the blacks basically) Or, it could just be some sort of unique coded LUT that doesn't have anything at all to do with math.

  5. #5
    Previously geeking out over 2/3" Scarlet. Scarlet-X...not so much.
    Join Date
    Jun 2007
    Location
    Helsinki, Finland
    Posts
    3,860

    Default

    Quote Originally Posted by lordtangent View Post
    Or, it could just be some sort of unique coded LUT that doesn't have anything at all to do with math.
    It's probably just a custom gamma curve - to me, it kinda looks about halfway between log and lin visually.

  6. #6
    Junior Member
    Join Date
    Oct 2007
    Posts
    23

    Default

    So, HV20/Cine mode/Hdmi recording via output bypassing the tape/black magic intensity/jpeg2000 or Cineform ?

    Nick

  7. #7
    Legend lordtangent's Avatar
    Join Date
    Jun 2007
    Location
    Albuquerque, NM
    Posts
    1,122

    Default

    Quote Originally Posted by Nfect View Post
    So, HV20/Cine mode/Hdmi recording via output bypassing the tape/black magic intensity/jpeg2000 or Cineform ?

    Nick
    Yeah. Something like that. I'll be testing the idea with my borthers Intensity card some time in the next couple of weeks.

  8. #8
    Legend lordtangent's Avatar
    Join Date
    Jun 2007
    Location
    Albuquerque, NM
    Posts
    1,122

    Default

    Quote Originally Posted by lordtangent View Post
    The idea is really compelling to me. (it seems to almost defy logic... until you think about what is going on under the hood.. I mean, in your brain... the relationship of the perceptual stuff to reality )
    I wanted to freshen this thread and make another post based on a little insight I had recently regarding the issue of visual perception and how it relates to LOG.

    It's tricky for me to put into words since I've only just now really "grokked" this concept and integrated it into my work. I'm doing something professionally that really motivated me to understand this. That is, applying film grain to CG elements to make them match a film background plate.

    Graining up CG is something I've done in the past. But (not surprisingly given the light of my new insight) it always seemed like I never got quite the correct results. The grain I've done in the past always seemed to look more like video "noise" and lacked a "Je ne sais quois" aspect of film I could never crack. And not having access to a lot of LOG film scans (I was always working from either telecined and already color corrected film or video) I never had the correct stuff at my finger tips to experiment correctly.

    This thread is about a visual phenomenon that LOG encoding has on LOSSY compressed images. Basically, something demonstrates the exact same visual phenomena that "film grain" naturally does! You would think I would have had insight into this after doing the LOSSY LOG tests and working with film and video for so many years. But that just wasn't the case. It's a very subtle detail and the ideas needed some incubation time. Now that I've figured it out, I'll save you the work of breaking YOUR head over it.

    What am I talking about? The elusing "Film Look" and the perceptual effect that the natural LOG encoding of film has on certain artifacts in film originated image. LOG encoding serves to normalize the visual impact over the range of darks to lights. The concepts and technical details are all in the article by David Newman that originally inspired me to do my LOSSY LOG test in the first place. It's just that I never managed generalize the concept in my mind until this week... when applying that film grain to CG objects over a film plate.

    So, what is the point of my sharing? Well, if you desire to add truly film-like grain to your movies the tip is this:

    Running your compositing system in Float mode apply this process to your images:

    1. Use a LINLOG node or function to convert the images from LIN to LOG (just use the defaults)

    2. Apply your grain or noise

    3. Use a LINLOG node/function to convert the images from LOG to LIN. Again, use the defaults.

    The resulting image will come out identical to how it went in, only now it will have noise perceptually weighted in a way that is pretty much identical to film. This trick will also have the effect of noising up your highlights in a way that takes a lot of the "video curse" out of them. It even serves, in an interesting way to add apparent "detail" to those really bright areas (by apparent, I mean, "apparent to the eye")

    Caveats: If your image has a lot of clipping ANY big white clipped areas will not really gain much from this. To get the most out of this trick, it's best to "shoot for the brights" and then grade the image up to the blown-out look. This is a place where you could use the second LOG 2 LIN node to grade the image into a blown-out yet "soft clipped", look. (i.e., more of a "film look" Most LOG to LIN tools have a "soft clip" feature.) The grain will help cover the banding that will most likely occur from pushing the image like that. Since you are working in Floating point mode (which this trick needs) You can also simply grade the image with out concern for the Superwhites. When you do the initial LIN to LOG the superwhites will be preserved as LOG format supports Superwhite values. It's my personal preference to do "softclipping" as LATE as possible in my image chain, so the footage is as close to linear as possible for the bulk of the work.

    If the shadows already have video noise in them, you can create a luma matte from the footage to EXCLUDE the grain from shadows. Always use the image at the END of your processing chain (AFTER the last LOG2LIN) to judge the results. It's difficult to tell what the ultimate result will be by looking at the "LOG" image.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •