tikevin83

Pixel Exact GBI-HF Output

Mar 18th, 2019
2,505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. Obtaining Pixel Exact GBI-HF Output
  2.  
  3. A quick overview of the GB/GBC/GBA pixel dimensions:
  4. GB/GBC is 160 pixels wide, 144 tall at 59.7275 frames per second.
  5. GBA is 240 pixels wide, 160 pixels tall at the same framerate.
  6.  
  7. GBI-HF's part
  8. GBI-HF does a double scale using nearest neighbor (integer scale) to 320x288 or 480x320, then letterboxes to 720x480 (fills the rest of the pixels with empty space).
  9.  
  10. The problem
  11. The DOL-001 model GameCube's digital port operates on a funky protocol called ITU-R BT.656. It's not really important to understand the signal protocol except that it only is capable of 4:2:2 color. This means that straight from the GameCube, whether the source is a GB game or a full GameCube game, the color of every other vertical line is interpolated (guessed) based on nearby pixels. This makes it impossible to capture the full color accuracy of the original signal over a digital connection. However, a GCVideo-DVI 2.4b device like the Insurrection Carby or Eon GCHD MkII can upsample the 4:2:2 signal to 4:4:4 RGB and deliver the image with both the original lines and interpolated lines over HDMI for capture.
  12.  
  13. The solution
  14. The GameCube's output error from 4:2:2 only hits every other line of pixels, and GBI-HF has done a double integer scale. This means that for GBI-HF we can drop the half of the vertical lines that are interpolated to recreate the original double scaled image. Sadly because we can't double scale GameCube games the same fix cannot be done for them over native HDMI out.
  15. This OBS filter does that:
  16. https://obsproject.com/forum/resources/gc-444-filter.790/
  17. And this is the result, scaled up 15x to 2400x2160 to fit 4K height perfectly.
  18. https://cdn.discordapp.com/attachments/309926269582311424/557061735027048448/Yellow_4K_from_Console.png
  19. A few more pixel exact examples from tweets with less insane scaling:
  20. https://twitter.com/Tikevin83/status/1107494458675941377
  21.  
  22. Technical requirements:
  23. A DOL-001 model Gamecube, a Game Boy Player, a method to load homebrew, and a GCVideo 2.4b HDMI output device
  24. A Datapath Vision RGB E1 or similar capture card and a computer with an available PCIe slot operating at x4
  25. And OBS-Studio compiled from my linked source branch. I'll look into how this effect might be more widely distributed as building OBS sources is challenging. Andersama, who helped write the filter, has an experimental plugin to load shaders on the fly in OBS.
  26.  
  27. Additional Reference Capture for YouTube:
  28. In OBS, set the output size to 480x320 and export in lossless AVI for further processing in FFMPEG
  29. Then this CLI for FFMPEG should output 4k video for upload to YT
  30. ffmpeg -i input.avi -vf scale=2880x1920:flags=neighbor,pad=3840:2160:(ow-iw)/2:(oh-ih)/2 -c:v libx264 -crf 0 -c:a copy -pix_fmt yuv444p output.mkv
Add Comment
Please, Sign In to add comment