Hybrid Scanlines

Viewing 15 posts - 46 through 60 (of 98 total)
  • Author
    Posts
  • #19642
    borti4938
    Participant

    I was under the impression that there is something weired with the current implementation; but I wasn’t sure at all.

    So today I quickly wrote a simulation with the hybrid method as currently implemented. Here is the outcome:
    – x-axis: input intesity, y-axis: output intensity (absolute top, relative to input bottom)
    – blue curves: multiplication, red curve: subtraction
    – from left to right: hybrid off, low, med and high

    Scanlines 50%

    Scanlines 88%

    And yes, there is a inconsistance. Exactly where scanline-strength = (hybrid-contrast)*input the scanline completely disappears. This can be seen in the image and does not feel good to me.
    Thus one has to either scanline strength high or hybrid contrast low.

    After modifying the math a bit, I came up with this:

    Scanlines 50%

    Scanlines 88%

    Actually I considered the scanlinestrength in the hybrid calculation. This ends up that a) the darkening does not disappear and b) there is no discontinuity.

    I do have a similar HDL implementation ready but want to test it before push it for others to test.

    #19645
    paulb_nl
    Participant

    @borti4938 Can you post the new formula that you used? I would like to test it. I like that the scanline dissappears so this will probably be about taste 🙂

    #19648
    borti4938
    Participant

    You’ll need another multiplication.

    sl_str_hybr = sl_str * (1 – hybr_contr*I)

    sl_str_hybr … new sl_str value
    sl_str … scanline strength (from 0 to 1)
    hybr_contr … hybrid contrast
    I … input intensity (R,G,B or Y) (also from 0 to 1)

    You can make the scanline completely disappear at I = 1, i.e. digital 255, if you choose hybr_contr = 1, which is pretty neat. My choices are just for testing and not preset 😉

    If you want to simulate, you can download the small program here: https://www.dropbox.com/s/o7u40uij7bgyn7a/sl_test_ossc.m?dl=0

    You’ll need MATLAB or Octave to run the script. Octave is freely available.

    I’ll share hdl-code once I tested it. I’m not 100% sure that it works with my first implementation attemp as I haven’t written a tenchbench so far.

    #19658
    James-F
    Participant

    @borti4938
    The possibility to change the intensity thus gamma curve without clipping in my opinion is a great way to do hybrid scanlines.
    Multiplication + ‘non-clipping hybrid’ looks very promising according to the graphs.
    Hope the VHDL code works as well as the graphs.

    #19659
    borti4938
    Participant

    Indeed, a gamma curve would be great. But due to limiting BRAM (no blocks are left atm), an option would be piecewise linear approximation. But maybe in a further step. For now I’m quite happy.


    @paulb_nl

    I’ve pushed the HDL to GitHub – again in my backlight test branch, first.
    https://github.com/borti4938/ossc/tree/dev_lcdbl

    Could you also take a look into your reverse LPF implementation? I integrated it more deeply into the post-processing pipeline.

    The contrast values are chosen to 0% (Off), 25% (Low), 50% (Medium) and 75% (High) but are discussable. 100% for high would be possible, too – of course ^^

    #19660
    James-F
    Participant

    If it is not too cumbersome please upload a test build for end users to try and give feedback.

    #19661
    borti4938
    Participant

    test builds are in subfolder fw_build: https://github.com/borti4938/ossc/tree/dev_lcdbl/fw_build
    Just download the file you need:
    – *.bin = for SD card
    – *.sof = for USB Blaster (keeping your ‘old’ firmware; just power cycle your OSSC)
    – *.jic = for USB Blaster (fw written into flash; power cycle to start after flashing)

    #19674
    paulb_nl
    Participant

    I have tested your formula but I don’t like the new hybrid method. With the current method I like that I can set the scanlines so that multiple brightest colors have no scanline with the scanline strength setting but with the new method only color 255 has no scanline and only at hybrid 100%.

    If people don’t calibrate their consoles with the gain function then most consoles will output <= 240 so with the new method they won’t have colors without scanlines.

    If you want to have scanlines in all colors you could just use Linear scanlines with Hybrid Low around 50% scanline strength or use Multiplication which always has scanlines in all colors with any setting.

    I tested the reverse LPF but its not working anymore. It just shifts the picture to the right when > 0.

    #19679
    borti4938
    Participant

    The clipping looks awfull on my set. So I would love to keep that as it is.
    However, what I‘ll do is to make overstearing possible such that the curve saturates before 255.

    I‘ll take a look into the rlpf. I have an idea where a bitshift error is. I ask you because it was never stable for me. (and also I’ve a weird feeling about it from what I‘ve learned about equalization in communication engineering, but that’s another point)

    Will got you back soon.

    #19682
    paulb_nl
    Participant

    The new hybrid method vs current method is like multiplication vs subtraction so if you want to keep that maybe you can set multiplication to use the new method and subtraction to use the current method?

    However with the current method clipping is optional and we could also just lower the percentages if you think they are too strong. Maybe something like 37, 50, 67%. Also I found that multiplication + current hybrid has no clipping during my testing so you could use that?

    Im not sure what you mean about reverse lpf not being stable. Depending on the SNES revision it works quite well in optimized mode at least?

    #19685
    James-F
    Participant

    Linear with old hybrid produces the most convincing (CRT like) scanlines but the gamma is too high (dark image).
    Multiplication will have more correct gamma but the scanlines do not vary with brightness enough.

    As I understand it, scanlines with variable thickness is essential for a convincing CRT look but the gamma curve should be fixed in the active part of the image (not the black lines).

    Maybe a different approach is needed for this?
    1. Create a convincing variable scanline thickness.
    2. Fix the gamma curve of the final image with a simple reverse gamma function: y=x^(1/a) where “a” is variable and normalizing the output to peak white.

    #19686
    paulb_nl
    Participant

    I don’t think the image is too dark. Old hybrid + linear for me looks great and as you said it most CRT like. IMO brightening the non-scanlines with gamma makes it look washed out. Just look at UltraHDMI and Super NT.

    We don’t have to do every image processing on the OSSC. If you want to have a brighter picture you have settings on your TV for that.

    #19690
    James-F
    Participant

    IMO brightening the non-scanlines with gamma makes it look washed out.

    The image with scanlines has much higher gamma in comparison to without scanlines.
    I meant using reversed gamma curve on all the image after processing not only on non-scanlines, this might be the most versatile solution at least in beta testing.
    While we are beta testing, maybe make all parameters variable (0-100%) so we can find a few sweet spots?
    That would be: Contrast str, Scanline str, Gamma fix str.

    #19714
    borti4938
    Participant

    Two fun facts beforehand:
    – We talk about ‘scanlines’ but we mean off-scanline, which is the line to be darken. But I will keep our false friend 😉
    – Multiplication and subtraction are both linear operations

    The new hybrid method vs current method is like multiplication vs subtraction so if you want to keep that maybe you can set multiplication to use the new method and subtraction to use the current method?

    Give me one good reason why keeping your origin hybrid approach?
    The main drawback in my point of view is that the saturation point (point where the scanline completely disappears) massively depends on the scanline strength.
    My modification on your approach resolves the problem (yes, it is a problem in my point of view). And as said, it can be overdriven without any problem such that the saturation is before intensity equals 1. See the comparison here:

    In this perspective one could call this option hybrid strength and make this a variable number from e.g. 0 to 15, where 0 is off and 8 is 100%.

    Linear with old hybrid produces the most convincing (CRT like) scanlines but the gamma is too high (dark image).
    Multiplication will have more correct gamma but the scanlines do not vary with brightness enough.

    In the same way the multiplication can be overdriven, too. This would allow the user to set the output to zero right for small intensities.

    Gamma in the scanline is atm only possible by either tailor approximation or piecewise linear interpolation. I would delay this for now.

    And what now? I corrected the GitHub branch. Hybrid contrast is still the modified approach with example values off = 0, low = 50%, med = 100% and high = 125% -> https://github.com/borti4938/ossc/tree/dev_lcdbl (RLPF also corrected)

    I also want to mention that the discoloring observation by @retrorunner with subtraction method for scanlines does not come from his TV. I build a firmware where you can see, what the scanline really looks like.
    it can be downloaded here: https://www.dropbox.com/s/g499kqjklbqoceq/ossc_0.80-what_sl_do.zip?dl=0
    Just set the scanlines to manual and vertical to draw all lines as like as they were scanlines. You can definitely see the discoloring effect which is increased in certain circumstances with hybrid scanlines. And no: do not compare with pure color bars, compare at ‘ordinary’ material, where you have mixed colors. E.g. the logo in F-Zero will become red with the subtraction method.

    #19716
    James-F
    Participant

    Well done.
    Both Multi and Sub on Low has the most useful range, and looks great.
    If anything this is close to what I would put as Default.

    *The small LCD backlight turning off is really annoying, maybe make it switchable in the Setting menu?

Viewing 15 posts - 46 through 60 (of 98 total)
  • You must be logged in to reply to this topic.