[Rejected] - Patch for reworked non-linear stretch and super-stretch

Discussion in 'Archive' started by splatterpop, November 28, 2009.

  1. splatterpop
    • Premium Supporter

    splatterpop MP Donator

    Joined:
    December 17, 2007
    Messages:
    177
    Likes Received:
    51
    Occupation:
    IT professional
    Location:
    planet ASPARAGUS
    Ratings:
    +56 / 1
    Home Country:
    Germany Germany
    Hi all,

    I would like to submit a patch for the non-linear stretch mode.

    Reworked calculation of nls partitioning:
    + is now done dynamically
    + increased number of partitions for better quality
    + NLS can be controlled through various parameters in setup (new section)

    Reworked super-stretch mode:
    for 16:9 or similar screens:
    + 4:3 videos are stretched using nls
    + videos with 16:9 or wider acpect ratios are stretched/cropped to fill the screen best as possible
    ++ 16:9 +/- 10% - stretch video to screen
    ++ wider than 16:9 - do some cropping left and right, to avoid black bars
    ++ very much wider than 16:9 - do some cropping while allowing black bars

    I hope this works as expected.



    Greetings,
    splatterpop
     

    Attached Files:

    • Like Like x 6
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. iosub

    iosub Portal Pro

    Joined:
    April 26, 2006
    Messages:
    573
    Likes Received:
    30
    Occupation:
    Computer Bussines
    Location:
    San Sebastian
    Ratings:
    +30 / 0
    HI..

    Nice patch, I have added and it's working great, I have both better NLS and also I don't have to use the pluging "Intelligent Frame Correction" because NLS does both features.

    Hope it is added sometime

    Thanks!
     
  4. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    I find that if you non linear stretch/crop 4:3 broadcast into a 16:9 screen you usually distort the picture too much, and you loose too much in the crop. I would prefer a more gentle stretch/crop of 4:3 images, so there are still some small blackbars on each side.

    I would like an option to have a non linear stretch where the user can specify maximun % of stretching and maximun % of croping.
    It would automatically dynamically stretch/crop in both directions, it would stretch first, then if the aspect ratio is still not equal to the screen ratio it would then crop.

    This is kinda similar to what you have written above, but it would be more customisable.
    + If you had a video slightly wider than 16:9 you should do a mild horizontal non linear stretch before considering any croping (ie loss of picture)
    + If you had a video wider than 16:9 you should mild non linear horizontal stretch, mild vertical crop, and have no black bars.
    + If you had a video a lot wider than 16:9 you should mild horizontal non linear stretch, mild vertical crop, and have some small black bars.

    Is this possible?
    Any opinions on this idea?
     
  5. splatterpop
    • Premium Supporter

    splatterpop MP Donator

    Joined:
    December 17, 2007
    Messages:
    177
    Likes Received:
    51
    Occupation:
    IT professional
    Location:
    planet ASPARAGUS
    Ratings:
    +56 / 1
    Home Country:
    Germany Germany
    I agree that the image distortion produced by NLS can be irritating at times.

    I understand you suggest to follow a different strategy, that is to favor less image distorion as opposed to minimizing the black bars (which is my personal preference). i have to think about this, but i believe it can be done.

    + make the target percentage / target acpect ratio of the nls algorithm variable (it is now 16:9 / 4:3 = 4:3 constant)

    + make the thresholds of f = source aspect ratio / screen aspect ratio variable and make strategies assignable.

    Available strategies:
    + fit to width (allow black bars)
    + fit to height (allow black bars)
    + stretch to fit the screen
    + crop top/bottom + fit to width (no black bars)
    + crop sides + fit to height (no black bars)
    + crop sides 50% + fit to width, allow black bars top + bottom

    One could assign different strategies to different ranges of f. Currently they are

    f < 0.9 --> fit width, top + bottom crop
    f = 0.9 ... 1.1 --> stretch
    f= 1.1 ... 1.3 --> fit height, crop sides
    f > 1.3 --> crop sides 50% + allow black bars

    I think it could be done by assigning different sets of strategies to the ranges. The UI should stay simple and easy to understand at all times.
     
  6. rtv
    • Team MediaPortal

    rtv Retired Team Member

    Joined:
    April 7, 2005
    Messages:
    3,622
    Likes Received:
    301
    Occupation:
    CTO at ES2000
    Location:
    Osnabruck
    Ratings:
    +301 / 0
    Home Country:
    Germany Germany
    Show System Specs
    Which is the current "Normal" setting

    Which is the current "Stretch" setting

    Which is the current "Zoom" setting


    The 14:9 ratio was (just like NLS) added as compromise. Both differ mainly in the fact that many people want correct aspect ratio. So add this to your strategies as well and you can get rid of both "old" settings.
     
  7. splatterpop
    • Premium Supporter

    splatterpop MP Donator

    Joined:
    December 17, 2007
    Messages:
    177
    Likes Received:
    51
    Occupation:
    IT professional
    Location:
    planet ASPARAGUS
    Ratings:
    +56 / 1
    Home Country:
    Germany Germany
    Right. I was thinking out loud.
     
  8. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    the current non linear stretch isn't dynamic/automatic though, if I watch 16:9 media, i have to change back to normal mode.
     
  9. mediortal

    mediortal Portal Member

    Joined:
    July 28, 2009
    Messages:
    46
    Likes Received:
    1
    Ratings:
    +1 / 0
    Is there any way to allow one to just increase/decrease the width/height manually?

    I have some videos that look wrong, no matter which pre-defined setting I choose in MP, but in MPCHC it allows me to adjust up/down separately, and I can make it look acceptable in both PQ and black bar removal.

    Can this be done?
     
  10. splatterpop
    • Premium Supporter

    splatterpop MP Donator

    Joined:
    December 17, 2007
    Messages:
    177
    Likes Received:
    51
    Occupation:
    IT professional
    Location:
    planet ASPARAGUS
    Ratings:
    +56 / 1
    Home Country:
    Germany Germany
    Right. My intention was to have the screen filled best as possible at all times, following aspect ratio and cropping changes, without having to switch to another mode. Thats exactly what this patch does.
     
    • Like Like x 1
  11. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    That's great.

    Have you thought about user defineable maximun % of stretch and maximun % of crop?

    The idea being to try and utilise the whole screen as possible without too much distortion (stretch) and pixel loss (crop).

    The logic is as follows.
    1. If aspect ratio (AR) = screen ratio (SR) then fit video to screen
    2. If AR =/= SR, then stretch up to a maximun %
    3. If stretched AR still =/= SR, then crop up to a maximun %
    4. Fit video (post stretch/crop) width/height to screen (ie. black bars if needed)

    NB: Obviously if AR < SR then you will be doing a horizontal stretch / vertical crop and vice versa
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!