avimit
Jun 21 2004, 02:31
Hi All, I am designing my own MP3 decoder. I am having some problems in implimenting 'Requantizaion and Scaling' formula given in ISO 11173-3 specs. Does any body know what is the best way to evaluate x^(4/3) or x^(1/3) i.e cube root of x?
Kind regards,
Aviral Mittal
metaller
Jun 21 2004, 03:28
IMHO the best way is to use table of precalculated values.
What exactly your problem is?
avimit
Jun 21 2004, 04:00
I am designing a hardware MP3 decoder. My problem is how do I calculate cube root of a number, which can range from 0to8192. A look up table I guess will consume a lot of memory. So I need is some kind of algorithm, which impliments x^4/3 or x^1/3 and save me area.
Kr,
Avi
metaller
Jun 21 2004, 04:18
That will probably be very slow. What is the CPU you are using?
Gabriel
Jun 21 2004, 04:32
QUOTE
I am designing a hardware MP3 decoder. My problem is how do I calculate cube root of a number, which can range from 0to8192.
I think that you want more than 8192:
http://www.mail-archive.com/mp3encoder@gee...e/msg05012.htmlRegarding your question, an usual solution is to use a table that is only 1/4 the size and to use interpolation between values.
You might find interesting info in the papers that are in the programmer's corner of mp3-tech.org
avimit
Jun 21 2004, 07:10
QUOTE
I think that you want more than 8192
I dont understand when you say 'I think that you want more than 8192'.
There are ONLY 8192 possible values for the frequency lines? so how come I will want more that that?
Kr,
Avi
You can skip SOME values in a lookup table by only having the top of the range, and multiplying the intial value (if lower) by X and dividing the result by the cube root of X - the easy example (though it doesn't save much) is 8 and 2 so by bit-shifting the initial value 3 places up, you shift the result one place down - ok, so it only saves on 1/8th of the places in a lookup table, but it's accurate and easy.
PS. The maximum according to link - is actually 8206 - and there is a famous test sample (artificial) that can provoke a bug in decoders which only support the supposed standard limit of 8191, instead of the architectural maximum of 8206.
There are proponents of sticking to 8191, while others say - use EVERY bit available, and use 8206 - you can't gurantee NOT to meet something in the 8192-8206 range, and if you don't choose to be accurate for it, then at least detect and return the same value as for 8191 - giving less aberration than falling off the end of a lookup table!
avimit
Jun 21 2004, 09:16
Thanks Matth for your advice.
I have already thought what you suggested, and indeed it will reduce the size of the table. But this is not enouth, so I was trying to ask if there exist any other algorithm e.g Newton-Raphson method, or any other method which s'body has succesfully implimented.
Kr,
Avi
A table-based method suitable for hardware implementations is described in the IEEE paper by Tsung-Han Tsai and Chuh-Chu Yen:
"A High Quality Re-quantization/Quantization Mehtod for MP3 and MPEG-4 AAC Audio Coding"
/Pontus
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.