I compiled mad with profiling and am in the process of running it over my entire mp3 library. I have mp3's encoded w/ bladenc, gogo, and those traded with other people. When finished, I will have 179 profiling outputs.
My current findings are (about 2/3's done):
Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 31.21 4.26 4.26 5239 0.81 1.10 mad_synth_frame 24.98 7.67 3.41 668256 0.01 0.01 imdct36 16.19 9.88 2.21 5239 0.42 1.43 III_decode 10.84 11.36 1.48 377208 0.00 0.00 dct32
These are consistently the top 4.
I compiled mad with profiling and am in the process of running it over my entire mp3 library. I have mp3's encoded w/ bladenc, gogo, and those traded with other people. When finished, I will have 179 profiling outputs.
My current findings are (about 2/3's done):
Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 31.21 4.26 4.26 5239 0.81 1.10 mad_synth_frame 24.98 7.67 3.41 668256 0.01 0.01 imdct36 16.19 9.88 2.21 5239 0.42 1.43 III_decode 10.84 11.36 1.48 377208 0.00 0.00 dct32
Your findings so far are pretty much in agreement with my own profiling results. I doubt you'll find significant variation throughout your MP3 collection, although the ratio of short to long Layer III blocks produced by various encoders might make a small difference.
mad_synth_frame is the subband synthesis routine for all layers; it calls dct32. I did some work to optimize this early on, but it might be possible to improve it further.
The "easy" targets out of that list are imdct36 (the Layer III long block IMDCT) and to a lesser extent, III_decode which is currently doing more data copying than it should.
What platform are you profiling on?
-rob
What platform are you profiling on?
a pII 400, 128mb. I also have a pentium 233mmx laptop and a dual pIII 500 box at work I can run tests on. When I get back from my 3 week leave I start Friday, I will install linux on my ppc 604e, perhaps on a bebox I have at work also. Then I will try and run tests on ppc as well. Dunno how hard getting sound to work will be.
Sean 'Shaleh' Perry wrote:
... Then I will try and run tests on ppc as well. Dunno how hard getting sound to work will be.
I have been working on Linux/PowerPC for the last few days. Similar profile results, and I always run the "64bit" mode. The compiler does a very good job with the instructions, I doubt hand coding would result in anything better. I was thinking about arranging the instructions and/or data so the functions would take advantage of cache line hits. I am running on an MPC8xx that certainly doesn't have the horsepower right now to do real-time decode, so my challenge is more than just making it better....I am just trying to make it work :-). I am doing my development and testing on the iMac, where it does work.
I really don't know how MP3 works, and Rob's latest comments really help :-). Thanks.
-- Dan