diff options
author | Dave Chapman <dave@dchapman.com> | 2009-05-10 22:26:02 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2009-05-10 22:26:02 +0000 |
commit | fc28cb4ed5adf4a0bc548af38ca6de95bbf027e5 (patch) | |
tree | 5902a50d7efe84a5f3e6270c464dbf54572a744a /apps/codecs/libcook/cookdata.h | |
parent | 3a0a9915eb802d558c0399d17a5ac045934d6be1 (diff) | |
download | rockbox-fc28cb4ed5adf4a0bc548af38ca6de95bbf027e5.tar.gz rockbox-fc28cb4ed5adf4a0bc548af38ca6de95bbf027e5.zip |
Patch by Mohamed Tarek from FS#10182 - convert codec to fixed-point using patches submitted to the ffmpeg mailing list in 2007 by Ian Braithwaite.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20901 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libcook/cookdata.h')
-rw-r--r-- | apps/codecs/libcook/cookdata.h | 82 |
1 files changed, 6 insertions, 76 deletions
diff --git a/apps/codecs/libcook/cookdata.h b/apps/codecs/libcook/cookdata.h index e2e81fbab6..a73b96c5f5 100644 --- a/apps/codecs/libcook/cookdata.h +++ b/apps/codecs/libcook/cookdata.h | |||
@@ -18,38 +18,20 @@ | |||
18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public |
19 | * License along with FFmpeg; if not, write to the Free Software | 19 | * License along with FFmpeg; if not, write to the Free Software |
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | * | ||
21 | */ | 22 | */ |
22 | 23 | ||
23 | /** | 24 | /** |
24 | * @file libavcodec/cookdata.h | 25 | * @file cookdata.h |
25 | * Cook AKA RealAudio G2 compatible decoderdata | 26 | * Cook AKA RealAudio G2 compatible decoderdata |
26 | */ | 27 | */ |
27 | 28 | ||
28 | #ifndef AVCODEC_COOKDATA_H | ||
29 | #define AVCODEC_COOKDATA_H | ||
30 | |||
31 | #include <stdint.h> | ||
32 | |||
33 | /* various data tables */ | 29 | /* various data tables */ |
34 | 30 | ||
35 | static const int expbits_tab[8] = { | 31 | static const int expbits_tab[8] = { |
36 | 52,47,43,37,29,22,16,0, | 32 | 52,47,43,37,29,22,16,0, |
37 | }; | 33 | }; |
38 | 34 | ||
39 | static const float dither_tab[8] = { | ||
40 | 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, | ||
41 | }; | ||
42 | |||
43 | static const float quant_centroid_tab[7][14] = { | ||
44 | { 0.000, 0.392, 0.761, 1.120, 1.477, 1.832, 2.183, 2.541, 2.893, 3.245, 3.598, 3.942, 4.288, 4.724 }, | ||
45 | { 0.000, 0.544, 1.060, 1.563, 2.068, 2.571, 3.072, 3.562, 4.070, 4.620, 0.000, 0.000, 0.000, 0.000 }, | ||
46 | { 0.000, 0.746, 1.464, 2.180, 2.882, 3.584, 4.316, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, | ||
47 | { 0.000, 1.006, 2.000, 2.993, 3.985, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, | ||
48 | { 0.000, 1.321, 2.703, 3.983, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, | ||
49 | { 0.000, 1.657, 3.491, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, | ||
50 | { 0.000, 1.964, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 } | ||
51 | }; | ||
52 | |||
53 | static const int invradix_tab[7] = { | 35 | static const int invradix_tab[7] = { |
54 | 74899, 104858, 149797, 209716, 262144, 349526, 524288, | 36 | 74899, 104858, 149797, 209716, 262144, 349526, 524288, |
55 | }; | 37 | }; |
@@ -422,12 +404,12 @@ static const uint16_t cvh_huffcodes6[32] = { | |||
422 | 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff, | 404 | 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff, |
423 | }; | 405 | }; |
424 | 406 | ||
425 | static const uint16_t* const cvh_huffcodes[7] = { | 407 | static const uint16_t* cvh_huffcodes[7] = { |
426 | cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3, | 408 | cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3, |
427 | cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6, | 409 | cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6, |
428 | }; | 410 | }; |
429 | 411 | ||
430 | static const uint8_t* const cvh_huffbits[7] = { | 412 | static const uint8_t* cvh_huffbits[7] = { |
431 | cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3, | 413 | cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3, |
432 | cvh_huffbits4, cvh_huffbits5, cvh_huffbits6, | 414 | cvh_huffbits4, cvh_huffbits5, cvh_huffbits6, |
433 | }; | 415 | }; |
@@ -488,12 +470,12 @@ static const uint8_t ccpl_huffbits6[63] = { | |||
488 | 14,14,16, | 470 | 14,14,16, |
489 | }; | 471 | }; |
490 | 472 | ||
491 | static const uint16_t* const ccpl_huffcodes[5] = { | 473 | static const uint16_t* ccpl_huffcodes[5] = { |
492 | ccpl_huffcodes2,ccpl_huffcodes3, | 474 | ccpl_huffcodes2,ccpl_huffcodes3, |
493 | ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6 | 475 | ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6 |
494 | }; | 476 | }; |
495 | 477 | ||
496 | static const uint8_t* const ccpl_huffbits[5] = { | 478 | static const uint8_t* ccpl_huffbits[5] = { |
497 | ccpl_huffbits2,ccpl_huffbits3, | 479 | ccpl_huffbits2,ccpl_huffbits3, |
498 | ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6 | 480 | ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6 |
499 | }; | 481 | }; |
@@ -509,55 +491,3 @@ static const int cplband[51] = { | |||
509 | 18,18,19,19,19,19,19,19,19,19, | 491 | 18,18,19,19,19,19,19,19,19,19, |
510 | 19, | 492 | 19, |
511 | }; | 493 | }; |
512 | |||
513 | static const float cplscale2[3] = { | ||
514 | 0.953020632266998,0.70710676908493,0.302905440330505, | ||
515 | }; | ||
516 | |||
517 | static const float cplscale3[7] = { | ||
518 | 0.981279790401459,0.936997592449188,0.875934481620789,0.70710676908493, | ||
519 | 0.482430040836334,0.349335819482803,0.192587479948997, | ||
520 | }; | ||
521 | |||
522 | static const float cplscale4[15] = { | ||
523 | 0.991486728191376,0.973249018192291,0.953020632266998,0.930133521556854, | ||
524 | 0.903453230857849,0.870746195316315,0.826180458068848,0.70710676908493, | ||
525 | 0.563405573368073,0.491732746362686,0.428686618804932,0.367221474647522, | ||
526 | 0.302905440330505,0.229752898216248,0.130207896232605, | ||
527 | }; | ||
528 | |||
529 | static const float cplscale5[31] = { | ||
530 | 0.995926380157471,0.987517595291138,0.978726446628571,0.969505727291107, | ||
531 | 0.95979779958725,0.949531257152557,0.938616216182709,0.926936149597168, | ||
532 | 0.914336204528809,0.900602877140045,0.885426938533783,0.868331849575043, | ||
533 | 0.84851086139679,0.824381768703461,0.791833400726318,0.70710676908493, | ||
534 | 0.610737144947052,0.566034197807312,0.529177963733673,0.495983630418777, | ||
535 | 0.464778542518616,0.434642940759659,0.404955863952637,0.375219136476517, | ||
536 | 0.344963222742081,0.313672333955765,0.280692428350449,0.245068684220314, | ||
537 | 0.205169528722763,0.157508864998817,0.0901700109243393, | ||
538 | }; | ||
539 | |||
540 | static const float cplscale6[63] = { | ||
541 | 0.998005926609039,0.993956744670868,0.989822506904602,0.985598564147949, | ||
542 | 0.981279790401459,0.976860702037811,0.972335040569305,0.967696130275726, | ||
543 | 0.962936460971832,0.958047747612000,0.953020632266998,0.947844684123993, | ||
544 | 0.942508161067963,0.936997592449188,0.931297719478607,0.925390899181366, | ||
545 | 0.919256627559662,0.912870943546295,0.906205296516418,0.899225592613220, | ||
546 | 0.891890347003937,0.884148240089417,0.875934481620789,0.867165684700012, | ||
547 | 0.857730865478516,0.847477376461029,0.836184680461884,0.823513329029083, | ||
548 | 0.808890223503113,0.791194140911102,0.767520070075989,0.707106769084930, | ||
549 | 0.641024887561798,0.611565053462982,0.587959706783295,0.567296981811523, | ||
550 | 0.548448026180267,0.530831515789032,0.514098942279816,0.498019754886627, | ||
551 | 0.482430040836334,0.467206478118896,0.452251672744751,0.437485188245773, | ||
552 | 0.422837972640991,0.408248275518417,0.393658757209778,0.379014074802399, | ||
553 | 0.364258885383606,0.349335819482803,0.334183186292648,0.318732559680939, | ||
554 | 0.302905440330505,0.286608695983887,0.269728302955627,0.252119421958923, | ||
555 | 0.233590632677078,0.213876649737358,0.192587479948997,0.169101938605309, | ||
556 | 0.142307326197624,0.109772264957428,0.0631198287010193, | ||
557 | }; | ||
558 | |||
559 | static const float* const cplscales[5] = { | ||
560 | cplscale2, cplscale3, cplscale4, cplscale5, cplscale6, | ||
561 | }; | ||
562 | |||
563 | #endif /* AVCODEC_COOKDATA_H */ | ||