[Rejected] Patch for reworked non-linear stretch and super-stretch (1 Viewer)

splatterpop

MP Donator
  • Premium Supporter
  • December 17, 2007
    177
    54
    planet ASPARAGUS
    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
     

    Attachments

    • 091128_nls.patch
      30.6 KB

    iosub

    Portal Pro
    April 26, 2006
    573
    30
    San Sebastian
    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!
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    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?
     

    splatterpop

    MP Donator
  • Premium Supporter
  • December 17, 2007
    177
    54
    planet ASPARAGUS
    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.
     

    rtv

    Retired Team Member
  • Premium Supporter
  • April 7, 2005
    3,622
    301
    Osnabruck
    Home Country
    Germany Germany
    Available strategies:
    + fit to width (allow black bars)
    + fit to height (allow black bars)
    Which is the current "Normal" setting

    + stretch to fit the screen
    Which is the current "Stretch" setting

    + crop top/bottom + fit to width (no black bars)
    + crop sides + fit to height (no black bars)
    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.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    the current non linear stretch isn't dynamic/automatic though, if I watch 16:9 media, i have to change back to normal mode.
     

    mediortal

    Portal Member
    July 28, 2009
    46
    1
    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?
     

    splatterpop

    MP Donator
  • Premium Supporter
  • December 17, 2007
    177
    54
    planet ASPARAGUS
    Home Country
    Germany Germany
    the current non linear stretch isn't dynamic/automatic though, if I watch 16:9 media, i have to change back to normal mode.

    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.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    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
     

    Users who are viewing this thread

    Top Bottom