Menu

General 2x Horizontal Pixel Multiplication

Home Forums OSSC OSSC – Feature Requests General 2x Horizontal Pixel Multiplication

This topic contains 6 replies, has 2 voices, and was last updated by  yoshiyukiblade 6 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19556

    yoshiyukiblade
    Participant

    As far as I know, there aren’t many readily-available, consumer-grade capture devices that support full RGB or YUV 4:4:4 capture, much less work well with the OSSC. I tested a couple capture devices, including the increasingly popular Elgato Cam Link, and they support the YUY2 color format for the best quality. Since YUY2 is YUV 4:2:2 interleaved, it has only half the chroma resolution of full 4:4:4, so video captures don’t look quite as good as they could. This can be compensated for by doubling the incoming horizontal resolution of the source and point resizing it back down in a program like OBS. This makes lossless RGB or 4:4:4 recording feasible for devices that normally don’t support it. Of course, the resulting bizarre resolutions will inevitably have compatibility issues for some equipment, but I think it has a useful purpose specifically for high quality video capture.

    The Elgato Cam Link has proven to be quite a versatile capture device, and I’ve been able to do something similar, in principle, to my above suggestion on the SNES. I created a pseudo optim. mode by changing the H. sample rate to 682 and H. active to 512, and resized back to 256 px in OBS, resulting in full-color video at the native SNES resolution of 256×224 (very nice to keep the resolution as low as possible for lossless capture). This method isn’t quite as clean as the true optim. mode, but it has some nice trade offs for 2 chip SNES consoles that benefit from the reverse LPF. I took it a step further by doubling everything (H. sample rate: 1364, H. active: 1024) for full color 512×240, which looks great for the rare hi-res modes, but the reverse LPF seems to lose potency as the H. sample rate increases.

    On a side note, the actual 256×240 optim. mode already does 3x pixel multiplication, so point resizing from 768 px back to 256 px also results in full colors no problem. I think generalizing this to any arbitrary horizontal resolution would be a nice addition to the OSSC’s feature set, despite having very specific use cases.

    Edit: Example screenshot of SNES highres mode, point scaled up to 2048×1568: https://i.imgur.com/cCo7cxe.png This isn’t possible without using the settings I described above for 512×224 pixels.
    Edit 2: Here’s a straight 512×224 capture for comparison: https://i.imgur.com/VdV9Uxj.png Notice that the hi-res background is more discolored with half the chroma resolution.

    #19760

    paulb_nl
    Participant

    You can change the optimized modes to any arbitrary resolution with the advanced timing tweaker. LineX2 320×240 optimized uses 2x duplication to output 640×480. You can set H.samplerate to 341 and H.active to 256 for 512×480. Or to capture 512×240 hi-res games use H.samplerate 682 and H.active 512 for 1024×480.

    384p and 480p also use pixel duplication if you set 480pX2 and Upsample2x to off and you can change that to any resolution as well.

    #19813

    yoshiyukiblade
    Participant

    Thanks for the suggestion paulb_nl! I attempted this on 256×240 optim. a while back with no luck and didn’t consider trying it in 320×240 optim. The method almost works, but I lose picture at exactly H. active 512. My CRT can display 511 fine, but the capture card doesn’t like it. H. active 510 works for both outputs, but that’s a net 1 pixel loss for 256×240 content (and I prefer shifting the image to the right 1 pixel and crop the left border, so that’s a net 2 pixel loss).

    Unlike the generic scaler, turning on AV3 interlacefix didn’t allow for higher horizontal resolutions, and I’m not sure what other options I can tweak to make it work. What I see looks good though, and it suits my preferences at the moment.

    #19986

    paulb_nl
    Participant

    I looked into why H.active 512 was not working and found that lineX2 320×240 samples at 4x and 4×512 was just over the limit. I compiled a firmware with the limit increased and I could post a link if you are interested in testing it.

    #19993

    yoshiyukiblade
    Participant

    Certainly, I would be happy to give it a try. Interesting that it did 4×512 multiplication. With H. active at 510, the Cam Link showed a resolution of 1020×480, which is just 2x.

    #19995

    paulb_nl
    Participant

    Yea the digitizer has increased jitter with low pixel clocks so the OSSC lets it sample at 4x and then the FPGA outputs at every other pixel.

    Here is the link with firmwares:
    https://drive.google.com/file/d/1A7tKcpIWvR4xXjuWyMH5Ik7kpxRGpdkh/view?usp=sharing

    #20002

    yoshiyukiblade
    Participant

    Thanks paulb_nl. It looks like the changes allowed for a larger H. active area for 320×240 optim. mode.

    I found a quirk that normally doesn’t appear when using generic scaling, and it’s related to setting the active area well above 512 while keeping the sample rate fixed at 682. I guess a screenshot would best illustrate this problem (point scaled up to 2208×1568): https://i.imgur.com/5eILBOx.png

    In this case, I set the active area to 552 (Cam Link outputs to 1104×480). Normally, the H. active area will just expand to have more open black space on the right-hand-side of the video, allowing for backporch adjustments to move the image to the right. However, it looks like the extra space on the right-hand-side is a copy of a portion of the SNES active area. The right side of the video gets cut off as I increase the backporch, so there’s an invisible barrier and I have to keep the image as far left as possible. I don’t know if its just a problem with the Cam Link, but I figured it was worth mentioning. Other than that, it works nicely when scaled down to 256×240.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.