VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    'Ello all,

    While not strictly a problem, I'm baffled by a certain Huffyuv behaviour I discovered today.

    The situation is as follows:
    • 1:20 minute Black-and-White (passed greyscale filter) clip
    • No sound
    • Original capture at 640x576
    • Cropped to 610x560 to eliminate underscan/headnoise/garbage areas.
    (Further resizing/cropping/borders will be added down the road to preserve aspect ratio, of course. But now I'm talking about the raw material).

    Now.
    Saving this file, at the cropped 610x560 resolution, yields a 1GB (actually 0.99) file.

    Saving this file, using 'resize to 610x576' (Nearest Neighbour - don't shout at me! It isn't resizing anything!) and letterboxing back to 640x576 yields a... 699 MB file.



    Anybody care to explain how does a larger frame consisting of a black border makes the overall filesize 30% smaller?...


    -- Baffled Piggie
    Quote Quote  
  2. Member
    Join Date
    Jan 2001
    Location
    Brisbane, Australia
    Search Comp PM
    well - that's a good issue all right
    I guess that Huffy could compress the black border very efficiently especially since it's a nice clean generated black, but that should only increase the file size a small amount - not decrease any way.
    So the short answer is - nope, no idea

    Try and replicate it and see what you get
    Quote Quote  
  3. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    Originally Posted by D_Knife
    Try and replicate it and see what you get
    I did. Five files. All greyscale, all using the same settings, different lengths.

    610x560 resolution yielded something like 4.5 GB, letterboxed 640x576 was about 3.4 GB.

    More is less.

    -- Still baffled Piggie
    Quote Quote  
  4. Member
    Join Date
    Jun 2001
    Location
    Surface-of-the-Sun (AZ)
    Search Comp PM
    It might have something do do with the compression algorithm that Huffyuv uses. I know mpeg2 requires the size to be a multiple of 16, so maybe Huffyuv is much less efficient for certain resolutions.

    Another thing to try for comparison would be to resize to 640x576 without the black bars and see how the size changes. Also try adding a black box rather than cropping and resizing and letterboxing (will look the same, but could be treated differently)
    Quote Quote  
  5. Renegade gll99's Avatar
    Join Date
    May 2002
    Location
    Canadian Tundra
    Search Comp PM
    Conjecture here not fact:

    1) Is the actual viewing area in the letterbox smaller by a % which is not discernable to you. Very little of the bitrate will be used in the dark letterbox areas. So compare the actual video view.

    2) The resize creates duplicate or linear or bicubic average pixels in the whole frame image which are then carried through the GOP structure increasing the compression. Like applying a smoothing filter which does a similar thing.
    There's not much to do but then I can't do much anyway.
    Quote Quote  
  6. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    Originally Posted by gll99
    1) Is the actual viewing area in the letterbox smaller by a % which is not discernable to you.
    No; if something, then the opposite is true: Apparently, when using only cropping, the top line gets 'cut off' - the left half of the line is intact, the right half 'disappeared'. I noticed this phenomenon in the past, in many files I've seen, and used to attribute it to interlaceing. While this file is interlaced at source, I know I have cropped the top, so actually, using a lossless compression, there shouldn't be such a loss.

    Originally Posted by gll99
    2) The resize creates duplicate or linear or bicubic average pixels in the whole frame image which are then carried through the GOP structure increasing the compression. Like applying a smoothing filter which does a similar thing.
    Again, we're talking about Huffyuv compression. There's no MPG data involved, there's no GOP involved. Huffyuv uses Keyframes al the way through (which are not even equivalent to I frames, as I frames stil use similar-to-JPEG compression, while Huffyuv uses lossless one).

    The actual pixel data in both cases should be the same (still, according to my note regarding 1., it isn't).


    Originally Posted by Thorn
    [...]maybe Huffyuv is much less efficient for certain resolutions. [...] try [...] to resize to 640x576 without the black bars and see how the size changes.
    Ah, you might be on to something.
    • Original file 45 seconds, 418 MB, letterboxed
    • File cropped to 610x560 = 600 MB
    • File re-letterboxed to 640x576 = 418 MB
    • File cropped then resized to 640x576 = 413 MB, and the top line stays intact

    This shows a consistent behaviour regarding certain resolution. I'm still baffled about the why's.

    Originally Posted by Thorn
    Also try adding a black box rather than cropping and resizing and letterboxing.
    Here I have to admit the term "black box" is new to me. How do I implementa b'black box' other than cropping then adding letterbox with the resize filter, without resizing?...

    -- Piggie
    Quote Quote  
  7. first pass is probably being saved as RGB, second pass is probably being converted to YUY2.

    YUY2 is generally smaller.
    Quote Quote  
  8. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    Originally Posted by bani
    first pass is probably being saved as RGB, second pass is probably being converted to YUY2.
    Nope. Sorry. The 'original' has already passed a few frame tweaks, and is already in RGB format.

    Note the steps above:
    Step 1 - Original at 418 MB
    Step 2 - Cropped at 600 MB
    Step 3 - Letterboxed again, 418 MB.

    According to your (correct) logic, Step 1 should have been smaller than Step 3. Which would have been true, had Step 1 been YUV. It isn't.

    Still baffled.

    -- Piggie
    Quote Quote  
  9. 30% is what you would expect from RGB->YUY2

    other than that, no ideas. but its the explanation that makes the most sense.
    Quote Quote  
  10. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    Originally Posted by bani
    30% is what you would expect from RGB->YUY2
    I wholeheartidly agree.
    But there is no RGB->YUV conversion here. All are RGB.

    Originally Posted by bani
    its the explanation that makes the most sense.
    Again, I agree. But it isn't applicable here.

    -- Piggie
    Quote Quote  
  11. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    To add letterboxing without resizing, you'd simply crop your edges, as you've already done. Leave the image material at it's new cropped size, and fill in the blanks with letterboxing. No resize required.

    Example only, as I have no idea what your source size is:

    640x576 ---> edges removed/cropped to 640x560

    Your step: Resize to 640x576?
    This you can leave out. Just add your borders without resizing

    Borders added ( 640x560 ---> 640x576 )

    You get the point. The aspect ratio is maintained.

    On the RGB question, someone correct me, but doesn't Huffy offer the option to convert to YUY2?
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  12. Member
    Join Date
    Jul 2001
    Location
    Israel
    Search Comp PM
    I have the feeling something has been missed in my explanation.

    The 'steps' I described before, are not 'steps' I make all-the-way-through. Each 'step' is a file on its own, and I'm stunend at the results.

    I'm aware of how to letterbox, and have done it the way you [DJRumpy] suggest. I'm surprised why does a letterboxed file - No, rephrase: Why does a 640x576-frame-file - is SMALLER than a file which is cropped - read, a file with a smaller frame, a file with a 610x560-frame.

    Original file @ 640x576 ==> Cropped to 610x560.
    That's the only 'data portion' I want. No resize, no nothing. And that's what I have, I'm not asking 'how to do this'.

    My point is, that if I produce this file, as 610x560, it weights n MB.
    If I produce the same data, letterboxing it to 640x576, using the resize filter only to letterbox, not to resize anything, I get a file which weights about n-30%.

    The only time I actually resized the 610x560 data to 640x576, is to test if Thorn's suggestion works - that the actual resolution impacts the size - and it did. A 640x576 file consistently was ~30% smaller than a cropped file, regardless of the question whether the 640x576 frame was letterboxed or resized.

    Regarding the YUV/RGB issue:
    Yes, Huffyuv works both, and it can convert RGB to YUV.
    However, the RGB->YUV conversion is, as it says, 'not completely lossless'.

    I capture in YUV.
    While processing the video (filters etc.), VDub process it in RGB mode.
    From that point on, I don't convert it back to YUV. From that point on, RGB it is, and RGB it stays.

    The 'Original' file I used, as explained, is already a processed file. It's already in RGB format.

    So, again:

    Original file is RGB format.
    Output file, cropped, is RGB format.
    Output file, cropped and letterboxed, is RGB format.
    Output file, cropped and resized, is RGB format.
    Cropped frame is same size as active frame in letterboxed file.

    No further processing is made. No resizing is made. No lossy compression is involved. No YUV/RGB conversion is involved.

    A 610x560 resolution file weights 30% more than a 640x576 one.

    The question is not 'how', the question is why.

    Please, by all means, do test it yourselves. Capture at 640x576. Turn the image to greyscale. Save. You now have it in pure RGB format. Then work from that file on.

    Load the resulting file.
    Crop. Save
    Letterbox. Save.
    Check file sizes.

    -- Piggie
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!