summaryrefslogtreecommitdiff
path: root/apps/codecs/libwmapro/wmaprodata.h
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-07-12 15:41:10 +0000
committerMohamed Tarek <mt@rockbox.org>2010-07-12 15:41:10 +0000
commitec4ee483181d01d14444e4431159282ecd92a2c5 (patch)
tree2f5c121e1fd41f518b0ee06362e3023110043e3f /apps/codecs/libwmapro/wmaprodata.h
parentddbfffb2173630b16b5ddafaa6449cad8709bf83 (diff)
downloadrockbox-ec4ee483181d01d14444e4431159282ecd92a2c5.tar.gz
rockbox-ec4ee483181d01d14444e4431159282ecd92a2c5.zip
Complete the conversion of WMA Pro to fixed point. Floating point code is still there for better history and to have a returning point in svn should something go wrong.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27402 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/wmaprodata.h')
-rw-r--r--apps/codecs/libwmapro/wmaprodata.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/apps/codecs/libwmapro/wmaprodata.h b/apps/codecs/libwmapro/wmaprodata.h
index a1d186e0c2..7fb784b39b 100644
--- a/apps/codecs/libwmapro/wmaprodata.h
+++ b/apps/codecs/libwmapro/wmaprodata.h
@@ -31,6 +31,15 @@
31#include <stddef.h> 31#include <stddef.h>
32#include <stdint.h> 32#include <stdint.h>
33 33
34const int32_t fixed_sin64[33] = {
35 0x00000000, 0xF9B82685, 0xF3742CA3, 0xED37EF92, 0xE70747C5, 0xE0E60686,
36 0xDAD7F3A3, 0xD4E0CB16, 0xCF043AB4, 0xC945DFED, 0xC3A94591, 0xBE31E19C,
37 0xB8E3131A, 0xB3C0200D, 0xAECC336D, 0xAA0A5B2F, 0xA57D8667, 0xA1288377,
38 0x9D0DFE55, 0x99307EE1, 0x9592675D, 0x9235F2ED, 0x8F1D343B, 0x8C4A1430,
39 0x89BE50C4, 0x877B7BED, 0x8582FAA6, 0x83D60413, 0x8275A0C1, 0x8162AA05,
40 0x809DC972, 0x80277873, 0x80000001,
41};
42
34/** 43/**
35 * @brief frequencies to divide the frequency spectrum into scale factor bands 44 * @brief frequencies to divide the frequency spectrum into scale factor bands
36 */ 45 */
@@ -375,6 +384,29 @@ static const float coef0_level[HUFF_COEF0_SIZE] = {
375 25, 26, 26, 27, 27, 28, 384 25, 26, 26, 27, 27, 28,
376}; 385};
377 386
387static const int32_t fixcoef0_level[HUFF_COEF0_SIZE] = {
388 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
402 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
403 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5,
404 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11,
405 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18,
406 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25,
407 25, 26, 26, 27, 27, 28,
408};
409
378 410
379static const uint16_t coef1_run[HUFF_COEF1_SIZE] = { 411static const uint16_t coef1_run[HUFF_COEF1_SIZE] = {
380 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 412 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -409,6 +441,23 @@ static const float coef1_level[HUFF_COEF1_SIZE] = {
409 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 441 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46,
410 46, 47, 47, 48, 48, 49, 49, 50, 51, 52, 442 46, 47, 47, 48, 48, 49, 49, 50, 51, 52,
411}; 443};
444
445static const int32_t fixcoef1_level[HUFF_COEF1_SIZE] = {
446 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4,
454 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10,
455 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19,
456 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28,
457 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37,
458 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46,
459 46, 47, 47, 48, 48, 49, 49, 50, 51, 52,
460};
412/** @} */ 461/** @} */
413 462
414 463