My guide to elminating juddering/stuttering play back (plus an upscale guide!) (1 Viewer)

FireAza

Portal Pro
June 30, 2011
50
10
37
Hey Scythe42, just a quick question for you. You previously recommended that for the SD profile, blur should be performed before resizing. I'm just wondering what the theory is on that. To me, it seems odd that you would want to make the original video blurry before blurring it further when you resize it. If you were blurring it AFTER, that makes sense to me, since this would help to "soften up" the picture that results from the resize, making it less blocky.
 

Scythe42

Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    In fact what feels natural to you is illogical...

    Looks like you are misunderstanding "blocky" with aliasing. Resizing never makes the picture more blocky...

    Scaling introduces three types of artficats:
    • blurriness
    • aliasing
    • ringing
    And these are the ones you want to limit.

    With blurring before resizing you reduce the original artifacts in the SD source and also limit the aliasing the resizing operation introduces. And to reduce the blurriness a resizing operation introduces (resizing itself is a kind of noise reducer) you want to sharpen the result a bit. This approach also reduces the ringing.

    Sharpening (in itself a noise introducer) should also be performed on 1080p scene rips as well to reduce the compression artifacts, but only a tiny amount. For original blurays there isn't much you can do, so leave them untouched. For xvid, don't blur but deblock (very agressive blurring...) to make them at least a bit watchable.

    Blurring after resizing just makes the picture even more blurry and does nothing to the picture quality. In fact you even lose more details and put way more stress on your GPU/CPU for a worse result. The same detail loss happens if you blur the original image too much.

    Try it for yourself in Photoshop for example or read any book ever published on digital image post-processing...

    PS: Usually for SD sources scaled up to 1080p it would be better to scale the picture up to 2x1080, do the sharpening and then scale it down to 1x1080p. This will be even nicer for SD sources.
     
    Last edited:

    FireAza

    Portal Pro
    June 30, 2011
    50
    10
    37
    Technology makes my head spin sometimes ;) You clearly know what you're talking about, so I'll take your word for it :)

    Your PS is an interesting point, guides I'd read said to scale the image past 1920x1080, which is what I originally had in my SD profile, but you suggested to scale to 1920x1080 instead. So, uh, should I be blurring then upscaling to 1920x1080 like I am now, or would resizing 2x1080, sharpening and resizing again be better? Wait, does ffdshow even have the ability to add a second resize?
     
    Last edited:

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    You can do upscale, sharp, downscale with avisynth inside ffdshow. If you use avisynth then turn off resizing and sharpening in ffdshow!

    Here are some avisynth scripts for 2.60. Don't use the 2.58, as it does process chunks and not the full picture and can introduce artifacts at the end of the chunk in some cases. If you have stability problems, use 2.58 anyway. Up to you. 2.60 is known to have issues with m2ts files.

    Notes:
    • Make sure you have LimitedSharpenFaster and/or LSFMod scripts installed for Avisynth (check the Doom9 posts for more).
    • To switch from LimitedSharpenFaster to LSFMod, just add # before the first and remove the # before the later (LSFMod is better, but requires more power).
    • Uncheck "Add ffdshow video source" in Avisynth
    • Only check "YV12" under "Input Color Space" in Aviynth
    • Check "Buffer Back/Ahead" and put "0" and "10" into the fields
    • Replace the "4" in "SetMTMode(3,4)" with the number of threads the CPU can handle (0 = auto)
    • Replace "SetMTMode(2)" with "MTMode(3)" after "ffdshow_source()" if you have stability issues
    • Replace "SetMemoryMax(512)" with "SetMemoryMax(1024)" and use "0" and "15" for "Buffer Back/Ahead" if you see glitches with LSFMod.
    • The ss_x and ss_y in LimitedSharpernFaster and LFSMod is the scaling of the current picture that should be done inside the sharpening. I used 2.0 for SD sources and 1.0 for HD sources.
    • You might want to try 1.5 for HD sources sharpening, though. (and this is where the 1.5 original comes from, you used for you initial scripts. They were intended for Avisynth Sharpening and NOT for scaling, as the Avisynth scripts do upscale, sharpen, downscale). Adjust the scripts as needed! Read the Avisynth Wiki! Not providing any support here if you modify these scripts.
    • Note Avisynth require a more powerful CPU than native ffdshow but provides better results!
    1080p
    Code:
    SetMemoryMax(512)
    SetMTMode(3,4)
    ffdshow_source()
    SetMTMode(2)
    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=20)
    #LSFMod(defaults="slow",ss_x=1.0,ss_y=1.0,strength=40)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last

    720p
    Code:
    SetMemoryMax(512)
    SetMTMode(3,4)
    ffdshow_source()
    SetMTMode(2)
    dispWidth = 1920
    dispHeight = 1080
    mWidth = float(last.width)
    mHeight = float(last.height)
    ratio = (mWidth/mHeight)
    newHeight= round((dispWidth/ratio)/2)*2
    newHeight > dispHeight ? Eval("""
    newHeight=dispHeight
    newWidth=round((newHeight*ratio)/2)*2
    """) : Eval("""
    newWidth=dispWidth
    """)
    spline64resize(newWidth,newHeight)
    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=45)
    #LSFMod(defaults="slow",ss_x=1.0,ss_y=1.0,strength=80)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last

    DVD, XVid, h246
    Code:
    SetMemoryMax(512)
    SetMTMode(3,4)
    ffdshow_source()
    SetMTMode(2)
    dispWidth = 1920
    dispHeight = 1080
    mWidth = float(last.width)
    mHeight = float(last.height)
    ratio = (mWidth/mHeight)
    newHeight= round((dispWidth/ratio)/2)*2
    newHeight > dispHeight ? Eval("""
    newHeight=dispHeight
    newWidth=round((newHeight*ratio)/2)*2
    """) : Eval("""
    newWidth=dispWidth
    """)
    spline64resize(newWidth,newHeight)
    LimitedSharpenFaster(ss_x=2.0,ss_y=2.0,strength=45)
    #LSFMod(defaults="slow",ss_x=2.0,ss_y=2.0,strength=80)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last
     
    Last edited:

    FireAza

    Portal Pro
    June 30, 2011
    50
    10
    37
    Hi there, sorry for the late response, I'm only just now getting around to trying it out :D

    I've installed what I thought was AviSynth 2.6.0 (got it from HERE, but the installer installed it to a directory called "AviSynth 2.5"! Did I get the right version and they forgot to update the version number in the installer or something?

    Where you say "To switch from LimitedSharpenFaster to LSFMod, just add # before the first and remove the # before the later" you mean add a # in front of "LimitedSharpenFaster(ss_x=2.0,ss_y=2.0,strength=45)" and remove the # in front of "LSFMod(defaults="slow",ss_x=2.0,ss_y=2.0,strength=80)" right?

    Okay, I'm getting an error when I play a video that says "Script error: there is no function named 'SetMTMode' (ffdshow_filter_avisynth_script, line 2)". Now, I'm assuming that's because I haven't installed the "require filters" listed on the LSFmod wiki pages. So, starting with MaskTools... Uh, what exactly am I suppose to be installing? I've got a zip file with a whole bunch of stuff in it, including some dlls. I thought all AVISynth scripts had a .avs extension?
     
    Last edited:

    kirk1

    Portal Member
    March 10, 2008
    39
    7
    Adelaide
    Home Country
    Australia Australia
    Thank you all so much for this thread!!!

    I had some major issues with dropped frames on HD channels and when returning to live TV from watching a movie on all channels. The picture was jittering bad and I had played around with all the refresh rate settings.

    Now all that appears fixed. I can still see the odd dropped frame on a slow pan but not even a tenth of how it was.

    One thing though using the 'shift + 1' option it shows a lot of dropped frames. I can notice when I bring up the tool the screen noticeably drops frames, the same happens when bringing up the mini guide. I can live with this, but I wouldn't mind being able to use the diagnostic tool to get an accurate idea of dropped frames.

    Again thanks for all the hard work and the education!!!
     

    FireAza

    Portal Pro
    June 30, 2011
    50
    10
    37
    Quick question: are the dropped frames you're getting only on live TV or also when you're using My TV Series or Moving Pictures or something? I don't use live TV, so all my tweaks are geared towards getting local media to play ball.
     

    kirk1

    Portal Member
    March 10, 2008
    39
    7
    Adelaide
    Home Country
    Australia Australia
    Just checked on Moving Pictures and it doesn't get many dropped frames at all, watched for a few minutes and the drop frames count didn't move. It must have dropped a few when the file opened as it stayed at 10 the whole time.

    My issue appears to be strictly Live TV, but I can say the tweaks have made a lot of difference to the picture clarity and overall 'smoothness'. As I said though it is hard for me to tell how many dropped frames I am getting from within media portal as any overlay (including the diagnostic tool) creates visible dropped frames.

    For now I am happy this is the best I have ever had my live tv or downloaded media look.

    If you know of any 3rd party software or if there is a log that will display dropped frames let me know I'd be more than happy to further investigate if your interested.

    Edit:

    Further investigation on the Live TV dropped frames, it's not the overlay it is anything in MediaPortal that is left open. For example if I go from Moving Pictures to Live TV using the Live TV button on my remote I will get dropped frames. If I go to live TV via the MediaPortal menu (closing Moving Pictures) I don't get visable dropped frames. A bit off topic but seeing I mentioned it earlier ;)
     
    Last edited:

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    @FireAza: I'll create a small attachment for you with all the AVISynth stuff when I have time plus the the matching ffdshow profiles for you to play with... Might need a few days as I don't have them live and need to dig through my backups...
     

    kirk1

    Portal Member
    March 10, 2008
    39
    7
    Adelaide
    Home Country
    Australia Australia
    I spoke too soon ...... the ffdshow profiles were a little resource hungry to run SD profile so I had to disable the filters only leaving the blur filtering, I felt that gave the best results.

    TV still is dropping frames, but the picture looks better than it did before the tweaks. There is also some tearing on the very top of the screen. not very noticable but enough to annoy me. I fixed this by using the TV's 16:9 overscan to cut out the tearing.

    Previously I was using MC7 and on reflection I was probably having some dropped frame issues on Live TV too. Maybe it is reception or hardware issues?
     

    Users who are viewing this thread

    Top Bottom