• AVR Freaks

mp3 decoding

Author
harleybg
New Member
  • Total Posts : 25
  • Reward points : 0
  • Joined: 2007/12/30 12:06:53
  • Location: Sofia, Bulgaria
  • Status: offline
2011/02/18 08:10:48 (permalink)
0

mp3 decoding

There are many topics about mp3 players built with external decoder.
Which MCU will be suitable for software decoding of mp3 and reading files from memory card? DAC will be external.
Approximately how many MIPS will take a MP3 decoding?
#1

6 Replies Related Threads

    bkamen
    Super Member
    • Total Posts : 822
    • Reward points : 0
    • Joined: 2010/01/26 12:39:27
    • Location: Central Illinois, USA
    • Status: offline
    Re:mp3 decoding 2011/02/18 08:24:26 (permalink)
    0
    If you look at the internet radio app/demo PCB schematics, you will find that other than being short on RAM, a PIC18 w/Ethernet can stream live Internet MP3...

    The reason being is the PIC18 uses an external MP3 decoder IC.

    Check it out...

    A PIC32 (if doing the decoding in external hardware) is overkill.

     -Ben
    #2
    zilym
    Super Member
    • Total Posts : 225
    • Reward points : 0
    • Joined: 2003/11/07 12:43:37
    • Location: Mesa, AZ
    • Status: offline
    Re:mp3 decoding 2011/02/18 08:44:18 (permalink)
    0
     I've been able to do software decoding in my TRAXMOD project using no more than 40MIPS on the PIC32MX695F512H chip. The PIC32 core is really fast, so MIPS really isn't the concern. The constraint I'd be more concerned with is RAM usage. I would not choose any of the microcontrollers with less than 32KB RAM because it is a little too tight. PIC32MX695F512H has 128KB of RAM which is really great -- plenty of space for the software decoder, memory card buffering, output audio buffering, etc.

    Lucio was able to do it on a 32KB RAM PIC32MX460F512L (YouTube video). I'm not sure exactly what he did to fit it into that small space, but it's gotta be tight. Maybe the Helix decoder software uses less memory than the MAD decoder I used? There is a Microchip application note AN1367 which discusses porting Helix to PIC32.

    post edited by zilym - 2011/02/18 08:57:21
    #3
    Neiwiertz
    Super Member
    • Total Posts : 2094
    • Reward points : 0
    • Joined: 2004/09/01 02:58:52
    • Status: offline
    Re:mp3 decoding 2011/02/18 14:37:24 (permalink)
    0
    Also have a sneak preview here at [link]http://www.microchip.com/forums/fb.ashx?m=339169]E16 Audio and Speech/link] from the E16 Gallery real cool work
    post edited by Neiwiertz - 2011/02/18 14:38:35

    Flying With --|Explorer 16|HardWare|SoftWare|-- Fav(s) Gallery Lists
    #4
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:mp3 decoding 2011/02/19 05:38:20 (permalink)
    0
    Yeah, I always wanted to test a sw solution on PICs... Smile

    GENOVA :D :D ! GODO
    #5
    pirev
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2004/12/17 04:25:56
    • Status: offline
    Re:mp3 decoding 2011/04/04 10:58:37 (permalink)
    0
    Hi all,

      it is look that int32 IMDCTInfo.outBuf[MAX_CHAN/*2*/][BLOCK_SIZE/*18*/][NBANDS/*32*/] can be used to store output pcm samples. Total size of this buffer is 4608 bytes and if output pcm samples are 16-bit this buffer will be enough to store samples ( 2 ch x 1152 samples x 2 bytes each ). 
    The sequence of functions that manipulate the buffer is:
    - IMDCT();
    - HybridTransform();
    - Subband();
    - FDCT32();

    After FDCT32() Helix call PolyphaseStereo() or PolyphaseMono() as first parameter is supplied from MP3Decode() pointer to pcm  outbuf. Instead of separate pcm buffer defined somewhere in main.c may be it is possible to supply MP3Decode with pointer to IMDCTInfo.outBuf ( through MP3DecInfo->IMDCTInfoPS->outBuf ). MP3Decode() works with input MP3 data in granule, then in channels ( one for mono, two for stereo ), blocks ( up to 18 ) and finally bands ( 32 ). After every step it is look that data remained from previous step in IMDCTInfo.outBuf are no more used, so we can use it to store pcm samples. This will save 4608 bytes RAM. I did not test yet this idea, probably in next few days will be able to test it.

    I think MAD library use similar technology because MAD invoke user call back function with pointer to output pcm samples.

    Regards,
    Pirev
    post edited by pirev - 2011/04/04 11:04:53
    #6
    pirev
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2004/12/17 04:25:56
    • Status: offline
    Re:mp3 decoding 2011/04/13 07:57:40 (permalink)
    0
    Hi,

    I ran Helix code in 32kB, actually it use 29.2kB RAM :-) 

    I made a little modification of MP3Decode(), PolyphaseStereo(), PolyphaseMono() and Subband() functions, as well as MP3DecInfo structure. The code ran on Explorer16 + AV16/32 board from Lucio Di Jasio ( http://www.exploringpic32.com/hw.html ) AV16/32 is simple plug in board for Ex16, it have SD card and low pass active filter with OpAmp. Audio is produced from OC1 & OC2 using DMA channel 0 & 1.

    In next days I will try to run the code on Mikroelektronika PIC32MX4 Multimedia board , it has PIC32MX460F512L ( 32kB RAM ) and codec WM8731. Then will post the project here.

    Regards,
    Pirev   
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5