VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Testing scaling methods

    In ffmpegX, mencoder provides several scaling methods: fast bilinear, bilinear, bicubic, lanczos and bicubic spline. In my opinion, a popular scaling ratio will be 89% (width), which is like DVD to mpeg-4 at 640x272. So, which scaling method is best, how much of a difference does it make, will people notice, what does it mean in practice. These are important questions for people doing the encoding. I hope my little test will provide some insight, so people can make more informed decisions on which to choose. (I realize that this may not test the scaling method itself, but only how it is implemented in mencoder.) If you think my testing or interpretation is flawed, then let me know. Any feedback is welcome.

    The test: Going from VOB (anamorphic widescreen) to mencoder h.264, cropping the bars (Autocrop), so that the final size is 640x272 (2.35:1). Use CABAC, Use b-frames, Constant bitrate off, ME function Exhaustive, the rest as default, and only vary the Scaling method (five options). The automatically adjusted video bitrate came out at 509 kbps. After encoding, I would pick a few frames, which hopefully show the difference in scaling method. To save myself some time, I use MPEG Streamclip to get two clips of around one minute.

    1. Impact on encoding time.
    The five scaling methods each take progressively more time. In my test, I converted the encoding time to a percentage relative to the fastest. Fast bilinear 100%, Bilinear 110%, Bicubic 110%, Lanczos 121%, Bicubic spline 138%. That's upto 23 minutes extra per hour encoding time.

    2. Impact on quality
    The most notable for me was the quality loss that all encodings had. Every one lost a great deal of detail on the pixel level, noise/grain was mostly gone (without using the Denoise filter), skin structure was smoothed out. I suppose this is also related to the bitrate, but setting a very high bitrate would make this test irrelevant for real world situations.
    I compared the same frame from all five scaling methods by overlaying the six frames (the original included) in Photoshop. By hiding specific layers, it's easy to find differences.
    - Fast bilinear scaling seems to cut some corners when it comes to accurate color, as I noticed a slight shift to green. The other scaling methods didn't have this.
    - Bilinear scaling makes the contrast a bit softer, in effect fading some highlights. Small bright spots are slightly less bright than with the other scaling methods.
    - Bicubic scaling seems to have a negative effect on soft shadows, creating an edge, where the other methods would have more soft fading tones.
    - Lanczos scaling does better, but I noticed more grouped pixels of the same color next to each other (blocks, if you will) than with the last method.
    - Bicubic spline showed a result with less artifacts than the other methods.
    Is it a big difference? No, you have to compare them closely to see the difference, zoom in, see them side by side.
    Will people notice? I don't think so. Each frame is only visible for 0.04 seconds. Even the one with color shift is doubtful, it's not much and with all the badly calibrated monitors and no reference material, it's hard to spot. On the other hand, if you view movies on a large plasma, then better stick with the original DVD at full quality.

    3. Impact on file size.
    As the different scaling methods result in a slightly different frame, the bits used to describe that frame are different in value and total number. I only did one pass encoding, but each clip came out in the same order: bilinear smallest (index=100), then fast bilinear, then bicubic, then bicubic spline, and lanczos largest (index=112 testclip 1, index=120 testclip 2). Coincidense? I think not.

    4. So what does it look like?
    Frame 1 is a dark one, but with enough details in the shadows and enough highlights. Frame 2 is a sunny scene with strong contrast. Frame 3 is the same as frame 2, but only brightened to get a closer look at the preservation of dark colors and shapes. The comparison files are in PSD format, so not to introduce JPEG artifacts. You should be able to view them with Preview.

    Frame 1 ; 6 layers of frame 1 (2.4 MB PSD file)
    Scaling comparison on frame 1 (430 KB PSD file)
    Frame 2 ; 6 layers of frame 2 (3.3 MB PSD file)
    Scaling comparison on frame 2 (423 KB PSD file)
    Frame 3
    Scaling comparison on frame 3 (433 KB PSD file)
    Quote Quote  
  2. Member G Rom's Avatar
    Join Date
    Aug 2005
    Location
    Montpellier, France
    Search Comp PM
    Case, would it be possible to upload the PSD samples somewhere else ?

    I have color/contrast shift on my H.264 encodes with mencoder and would like to see what you reported on the scaling methods...
    Quote Quote  
  3. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Originally Posted by G Rom
    Would it be possible to upload the PSD samples somewhere else ?
    Sorry, I don't have the PSD files anymore. I only archived a PDF that I made from this thread in Safari, which just includes the thumbnail pics.
    Quote Quote  
  4. Member G Rom's Avatar
    Join Date
    Aug 2005
    Location
    Montpellier, France
    Search Comp PM
    Thanks Case (-;

    After taking a closer look to that PDF file, it seems that my color/contrast shift isn't introduced by the resample filter.

    My encodes with mencoder are slightly green and more contrasted than squeeze, compressor or quicktime ones.
    I lose many details in dark areas.

    I don't think it could be the Motion Estimation, right ?
    As I'm encoding 50 fps footage, only mencoder can handle this high frame rate.
    Quote Quote  
  5. Member
    Join Date
    Feb 2005
    Location
    Bollywood
    Search Comp PM
    What scaling method does the MPEG2 ffmpeg engine use?
    Quote Quote  



Similar Threads