How to reduce the Helix MP3 decoder decoding time for LPC4350 (M4)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to reduce the Helix MP3 decoder decoding time for LPC4350 (M4)

4,373 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinu282 on Wed Feb 06 00:20:07 MST 2013
Hi All,
        Am using Hitex Board-LPC4350(M4,M0) for audio application. Referring AN11178( MP3 player solution on NXP LPC1700 series) document and took the helix MP3 decoder code from
https://datatype.helixcommunity.org/Mp3dec . In M4 using  is code to decode MP3  to PCM Conversion .

M4 Core SPEED : 192MHZ

SDCARD CLK : 34MHZ.
I2S configuration : 16bit,MONO,44.1kHZ.    
   MP3 files is  reading from SDCARD. For 4K data read time : 2.8ms.
  To decode one frame using Helix MP3 decoder : 110ms.
DMA transfor : 12ms  
For MP3, the duration of playing a single frame is fixed at ~26 ms.
How can I reduce Helix MP3 decoder decoding time?
As per AN11178 document helix MP3 decoder code is optimized for Fixed point decoder.
How can i choose fixed point decoder in my application?
Tried the option like in KEIL project “target”--floating  point hardware  Not used
No change in timing (110ms). How can I reduce MP3 decoder decoding time to 8ms from 110ms?

  
标签 (1)
0 项奖励
回复
6 回复数

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Wed Feb 13 03:16:10 MST 2013
Hi Sreenivas,

looks OK, with the setting you've done the code for this specific file is executed from internal RAM with no waitstates at 192MHz.
But take care that this code does not fetch data from the outside, e.g. when calling a function which is still in the outside memory.

Best regards,
Bernhard.
0 项奖励
回复

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinu282 on Fri Feb 08 04:00:28 MST 2013
Hi Bernhard,
         Thanks for your POST. Can you guide me how can I put the decoder functions in internal SRAM (LPC4350 has overall 264Kb). Right now am doing like this
In “Target”  Read/write Memory Areas
  IRAM1 : 0x10004000(start) ,oxFA0(SIZE).
I Kept all MP3 decoder files(.c) options like
File name : Mp3dec.c   right click on it and select “Options for File mp3dec.c”
In “properties tab” - Memory Assignment
                        Code/Const : IRAM1(0x10004000-0x10004F9F).
                         Zero Initialized Data : IRAM1(0x10004000-0x10004F9F).
                        Other Data : IRAM1(0x10004000-0x10004F9F).
In C/C++ Tab
       Language/Code Generation
        Optimization: Level 3(-o3).
      Tick for “Optimize for Time”.
Is this correct?
Please help me to get out of this problem.
Thanks in advance.

Regards
Sreenivas ida
0 项奖励
回复

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Feb 07 11:17:45 MST 2013
Even if the LPC4300 has a floating point unit, it mustn't be used.
The Helix with fixed point is quite OK. Don't think about floating point for this MP3 decoding job, it will not help.
Maybe it's getting even worse ;-)

I think your problem is the slow execution speed from the external 16-bit flash.
This is really incredibly slow, compared to the execution speed you can achieve with internal memory.

The solution could be to put the decoder functions into internal SRAM (LPC4350 has overall 264Kb).
Alternatively you could also use the qSPI (SPIFI) for your executable code instead of the external parallel flash.
The SPIFI interface is quite fast and should do the job.

Hope this helps a little bit,
Bernhard.
0 项奖励
回复

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by srinu282 on Thu Feb 07 02:39:49 MST 2013
Hi Dave,

      Thanks for  your reply.i tried with Level 3 Optimization  with "Optimize for time". But there is no change in decode time.
For this experiment  Floating point Hardware is selected as "Not Used".

Am referring AN11178(MP3 player solution on NXP LPC1700 series) document in that
"The Helix MP3 decoder provides MPEG-compliant decoding of MP3 content. Both floating-point and fixed-point decoder implementations are available.The fixed-point decoder is optimized especially for ARM processors but can run on any 32-bit fixed-point processor which can perform a long multiply operation (two 32-bit inputs generating a 64-bit result) and long multiply-accumulate (long multiply with 64-bit accumulator)."

So Is LPC4350(M4)is a 32-bit fixed-point processor?








0 项奖励
回复

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxp21346 on Wed Feb 06 11:22:59 MST 2013
Hello,

Have you tried to enable the Keil Optimizer? You can set Level 3 Optimization and check "Optimize for Time" on the C/C++ tab in the target options dialog. This should be the fastest optimization, but you might have to experiment to be sure. If the Helix MP3 decoder is specifically written to used fixed-point operations, then it will not benefit from enabling floating point in the compiler. You might want to check if the Helix code has any compiler options (#defines) to enable floating point computation.

-Dave @ NXP
0 项奖励
回复

3,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Feb 06 02:12:26 MST 2013
You may want to try MAD:

http://www.underbit.com/products/mad/

I got good results with an ARM9 and 66MHz Clock.

Optimisation:
- place the Stack in internal RAM
- place parts of the code in internal RAM

Good luck!


0 项奖励
回复