MP3 -> PCM converter preview (incomplete)
Rayman
Posts: 14,833
I've translated enough of the LIBMAD MP3 code into SPIN to generate the first 576 PCM samples of a test MP3 file.· It gives exactly the same values as LIBMAD (with the appropriate compiler flags).· These 576 samples represent the first channel of the first granule of the first frame.· It is incomplete, but it does give me a good idea of the·memory requirements for a Prop (or Prop II) MP3 player.·
I couldn't fit it into a single file, so there is a part A and part B.· Part A decodes the Huffman data and generates the·frequency domain samples.· Part B converts to·time domain and then does the synthesis.
I'll put the associated data files on my web site later...
Regarding MP3 playback on Prop, I have two concerns; memory and speed.· The nice thing about having SPIN and ASM on this platform is that they seem to generate about the same memory size code.· So, I figure that if I can squeeze this down to 32k, then maybe it's possible.· Also, SPIN is known to be 40-200 times slower, so if this can be done within that factor of real-time, maybe an assembly version could do real-time playback.
I've already taken some liberties with LIBMAD and made some long tables into word tables because with the "FPM_default" compiler flag, the result wasn't affected.· Also, many of the arrays are only sized for a single channel.
Even so, there's not much room left with 64k in two files.· But, I think may arrays could be converted from long to word with acceptable loss in quality...
At this moment, I am highly pessimistic about real-time playback with Prop1.· This is mostly due to memory space.· I haven't looked at speed too much, but the lack of·a multiply instruction is going to be a real problem...
Post Edited (Rayman) : 1/15/2008 1:49:48 AM GMT
I couldn't fit it into a single file, so there is a part A and part B.· Part A decodes the Huffman data and generates the·frequency domain samples.· Part B converts to·time domain and then does the synthesis.
I'll put the associated data files on my web site later...
Regarding MP3 playback on Prop, I have two concerns; memory and speed.· The nice thing about having SPIN and ASM on this platform is that they seem to generate about the same memory size code.· So, I figure that if I can squeeze this down to 32k, then maybe it's possible.· Also, SPIN is known to be 40-200 times slower, so if this can be done within that factor of real-time, maybe an assembly version could do real-time playback.
I've already taken some liberties with LIBMAD and made some long tables into word tables because with the "FPM_default" compiler flag, the result wasn't affected.· Also, many of the arrays are only sized for a single channel.
Even so, there's not much room left with 64k in two files.· But, I think may arrays could be converted from long to word with acceptable loss in quality...
At this moment, I am highly pessimistic about real-time playback with Prop1.· This is mostly due to memory space.· I haven't looked at speed too much, but the lack of·a multiply instruction is going to be a real problem...
Post Edited (Rayman) : 1/15/2008 1:49:48 AM GMT
Comments
I'm not sure if the Prop 1 can decode MP3 in realtime, but the propII should. [noparse]:)[/noparse]
I'm cheering you on!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Share the knowledge: propeller.wikispaces.com
Lets make some music: www.andrewarsenault.com/hss
Baggers
http://www.rayslogic.com/propeller/Programming/RaysStuff/MP3/MP3.htm
I took a closer look at the memory requirements and I think the arrays could be shrunk down to 21 kB, leaving ~ 10 kB for code.· So, perhaps it's plausible still...
It will be very easy to do on Prop2 though I think. Especially, if we can use the actual C code to do it...