The VCD project is inspired on the asian SCPH-5903 console with its hardware based VCD decoder, which made wonder if it wouldn't be possible to make a software based VCD decoder (apart from wondering what VCDs are; if you don't know: VCD are Video CDs, mostly popular in asia, with quality lower than DVDs, but roughly similar to VHS tapes).
If anybody is interested, here's the VCD source code (can be assembled via no$psx v2.0, see Utility, Assemble File): I've tried to make best use of the hardware to get everything working fast enough to view movies. And, to some level, I got it working at around 10fps, monochrome, with 11kHz mono audio. VCDs at full quality would be around 30fps, color, 44.1kHz stereo. Nethertheless, the movie is playing at full speed with continous audio, and actually doesn't look too bad.
Screenshots, showing The Fifth Element on SCPH-5903 hardware (color) and Retail PSX console (mono)
The first problem has been finding VCDs which are nearly unknown in western world. I finally got two sample VCDs, and -shortly after - four real movies on pressed discs from TriMesh. Then I've blown up a bunch of weeks on learning how to implement the MP2 audio and MPEG1 video decoding, and first implemented it as 80x86 asm code (which is now also included in no$psx, somewhat emulating the SCPH-5903 hardware; with 30fps/color/stereo).
Next, I've ported the 80x86 code to MIPS, aiming at 10fps/mono, and the first built did actually reach around 5fps, which wasn't too bad, considering that it wasn't yet really optimized for the PSX hardware. So I've blown up some more weeks on optimizations: Using the MDEC hardware. Using DMA transfers. Using some macros for some functions. Squeezing most variables & cpu stack into the 1Kbyte scratchpad (=fast RAM) memory. Changing byte operations to process four bytes at once via 32bit memory access, in some cases also doing multiple 8bit operations via 32bit registers (for color additions & saturations).
The funny part was when I got it working at 10fps, and then TriMesh mentioned that audio decoding might also consume a lot of cpu load. I didn't believe it, and mounted to audio engine the next day - which dropped the frame rate back to around 5fps. Okay, maybe I had underestimated something. But then, reducing the sample rate, dropping stereo, unrolling some loops, and optimizing some stuff helped to reduce the audio load.
Oh, and side note: There's some profiler in no$psx. I don't if anybody has ever used that feature, but it was really useful to figure out which functions did eat up how many clock cycles (and to optimize the code as best as possible).