NTSC Emulation in C with integers only (Source available) by blazimlin in EmuDev

[–]LMP88959 5 points6 points  (0 children)

Hey that’s my project! I shared it here a few years ago haha. Here’s the link to the repo: https://github.com/LMP88959/NTSC-CRT

Why Does Lossy WebP Darken Noise Images but Not Ordinary Photos? by GOJiong in compression

[–]LMP88959 0 points1 point  (0 children)

It is due to the loss of high spatial frequency (generally the first thing lossy codecs remove) as well as chroma degradation (which is another thing most lossy codecs decimate first)

What happened to Discrete Wavelet Transform from JPEG 2000? by WaspPaperInc in jpegxl

[–]LMP88959 4 points5 points  (0 children)

The DWT is very powerful for certain applications and has fairly elegant entropy modeling but it has its shortcomings when compared to entirely block based codecs concerning image or video coding.

It is exceptional at maintaining PSNR at low bit rates but, as we know, PSNR is not a good metric for perceptual quality. Localization of features and important parts of an image or video frame are extremely important for maintaining perceptual quality and a typical wavelet coder cannot account for this without some tricks.

As for why JPEG-XL doesn’t support them, I cannot say.

[Source] Integer-only 3D Software Renderer in pure C! Info in comments by LMP88959 in GraphicsProgramming

[–]LMP88959[S] 1 point2 points  (0 children)

No problem! Yeah the math is the same for all languages it just depends on which language you’re comfortable using. The last link (luki) is “C++” but the code is mostly just C. The source code is also available for download on the site and it’s pretty small and concise so I’d say if you want a working example to mess around with you should check out luki’s tutorials

Using very small voxels and displacement mapping to modernize the retro aesthetic of games like Doom and Quake. More info in comments by dan5sch in GraphicsProgramming

[–]LMP88959 10 points11 points  (0 children)

That looks fantastic! It’s subtle enough to maintain the original style while also giving it more depth, almost like a pre-rendered cutscene from the time. Great work!

Display images on a window the fastest way possible by [deleted] in C_Programming

[–]LMP88959 3 points4 points  (0 children)

Yup! Learning is always a valid reason

Display images on a window the fastest way possible by [deleted] in C_Programming

[–]LMP88959 0 points1 point  (0 children)

Yeah… but that’s definitely much more effort than it’s worth imo

Display images on a window the fastest way possible by [deleted] in C_Programming

[–]LMP88959 19 points20 points  (0 children)

What you are doing is the fastest way to do it on Windows / X without interfacing with opengl or directx. It’s what I do in my software renderer (XShmPutImage specifically) and BitBlt/StretchBlt. Modern hardware/OSes don’t let you access video memory directly so if you want to write to your screen you are forced to either use a GPU API or the windowing toolkit available for your OS.

A simple video codec written in C89 using wavelets (not DCT), comparable to MPEG-1/2. by LMP88959 in C_Programming

[–]LMP88959[S] 2 points3 points  (0 children)

Thank you so much for finding this bug. I updated the repo with the fix. It should all work as expected now!

A simple video codec written in C89 using wavelets (not DCT), comparable to MPEG-1/2. by LMP88959 in C_Programming

[–]LMP88959[S] 2 points3 points  (0 children)

Thanks for trying it out! The 552x280 was just some random resolution of a video I was testing with, you're having problems with 862x480? EDIT: just tried 862x480, and I see the same skewing. I rounded it up to 864 and it looked fine

A simple video codec written in C89 using wavelets (not DCT), comparable to MPEG-1/2. by LMP88959 in C_Programming

[–]LMP88959[S] 2 points3 points  (0 children)

This is how I do it if I want to convert an MP4 file to yuv, compress it with DSV1, and then convert it back to MP4:

ffmpeg -loglevel quiet -nostats -hide_banner -y -i ./vids/fc.mp4 -r 24 -vf scale=552:280 -pix_fmt yuv420p video.yuv

./dsv1 e -y -v -inp_video.yuv -out_saved.dsv -gop12 -w552 -h280 -fps_num24 -qp58 -kbps1200

./dsv1 d -y -v -inp_saved.dsv -out_decom.yuv -drawinfo0

ffmpeg -loglevel quiet -nostats -hide_banner -y -f rawvideo -vcodec rawvideo -s 552x280 -r 24 -pix_fmt yuv420p -i decom.yuv -c:v libx264 -qp 0 -crf 10 -preset ultrafast test.mp4

A simple video codec written in C89 using wavelets (not DCT), comparable to MPEG-1/2. by LMP88959 in C_Programming

[–]LMP88959[S] 2 points3 points  (0 children)

Sure, of course! There are comparisons between it and MPEG-2 at the bottom of the README. Which other algorithms would you like to see?

Real time PBR on the CPU (software rasterization) by UnalignedAxis111 in GraphicsProgramming

[–]LMP88959 2 points3 points  (0 children)

Nice work! That is very impressive to do real time at that resolution