1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

dcaenc: update

Long story short: previous code was useless and was port of older
dcaenc, this commit just "sync" with current dcaenc, hopefuly
making this encoder more useful.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-04-24 09:41:36 +00:00
parent 8f0db04b08
commit e1ba5fc968
2 changed files with 827 additions and 893 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* /*
* DCA encoder tables * DCA encoder tables
* Copyright (C) 2008 Alexander E. Patrakov * Copyright (C) 2008-2012 Alexander E. Patrakov
* *
* This file is part of FFmpeg. * This file is part of FFmpeg.
* *
@ -24,523 +24,90 @@
#include <stdint.h> #include <stdint.h>
/* This is a scaled version of the response of the reference decoder to typedef struct {
this vector of subband samples: ( 1.0 0.0 0.0 ... 0.0 ) int32_t m;
*/ int32_t e;
} softfloat;
static const int32_t UnQMF[512] = { static const int sample_rates[] = {
7, 8000, 16000, 32000, 11025, 22050, 44100, 12000, 24000, 48000, 0,
4, };
-961,
-2844, static const uint8_t bitstream_sfreq[] = { 1, 2, 3, 6, 7, 8, 11, 12, 13 };
-8024,
-18978, /* Auditory filter center frequencies and bandwidths, in Hz.
-32081, * The last two are made up, because there is no scientific data.
-15635, */
-16582, static uint16_t fc[] = {
-18359, 50, 150, 250, 350, 450, 570, 700, 840, 1000, 1170, 1370, 1600, 1850, 2150,
-17180, 2500, 2900, 3400, 4000, 4800, 5800, 7000, 8500, 10500, 13500, 17000
-14868, };
-11664,
-8051, static uint16_t erb[] = {
-4477, 80, 100, 100, 100, 110, 120, 140, 150, 160, 190, 210, 240, 280,
-1327, 320, 380, 450, 550, 700, 900, 1100, 1300, 1800, 2500, 3500, 4500
-1670, };
-6019,
-11590, static const softfloat stepsize_inv[27] = {
-18030, {0, 0}, {1342177360, 21}, {2147483647, 21}, {1342177360, 20},
-24762, {1819901661, 20}, {2147483647, 20}, {1278263843, 19}, {1579032492, 19},
-30965, {1412817763, 18}, {1220162327, 17}, {1118482133, 16}, {1917391412, 16},
-35947, {1766017772, 15}, {1525212826, 14}, {1290553940, 13}, {2097179000, 13},
-36145, {1677683200, 12}, {1497972244, 11}, {1310893147, 10}, {1165354136, 9},
-37223, {1748031204, 9}, {1542092044, 8}, {1636178017, 7}, {1636178017, 6},
-86311, {1636178017, 5}, {1636178017, 4}, {1636178017, 3},
-57024, };
-27215,
-11274, static const softfloat scalefactor_inv[128] = {
-4684, {2147483647, 1}, {2147483647, 1}, {2147483647, 2}, {2147483647, 2},
42, {2147483647, 2}, {2147483647, 2}, {1431655765, 2}, {1431655765, 2},
108, {1431655765, 2}, {2147483647, 3}, {2147483647, 3}, {1717986918, 3},
188, {1431655765, 3}, {1227133513, 3}, {1227133513, 3}, {2147483647, 4},
250, {1717986918, 4}, {1561806289, 4}, {1431655765, 4}, {1227133513, 4},
-1007, {2147483647, 5}, {1908874353, 5}, {1717986918, 5}, {1493901668, 5},
-596, {1321528398, 5}, {1145324612, 5}, {2021161080, 6}, {1808407282, 6},
-2289, {1561806289, 6}, {1374389534, 6}, {1227133513, 6}, {2147483647, 7},
-12218, {1908874353, 7}, {1676084798, 7}, {1477838209, 7}, {1296593900, 7},
-27191, {1145324612, 7}, {2021161080, 8}, {1773405851, 8}, {1561806289, 8},
-124367, {1374389534, 8}, {1216273924, 8}, {2139127680, 9}, {1882725390, 9},
-184256, {1660893697, 9}, {1462116526, 9}, {1287484341, 9}, {1135859119, 9},
-250538, {1999112050, 10}, {1762037865, 10}, {1552982525, 10}, {1367551775, 10},
-323499, {1205604855, 10}, {2124660150, 11}, {1871509153, 11}, {1648443220, 11},
-397784, {1452459217, 11}, {1279990253, 11}, {1127704233, 11}, {1987368509, 12},
-468855, {1750814693, 12}, {1542632939, 12}, {1359099663, 12}, {1197398995, 12},
-532072, {2109880792, 13}, {1858853132, 13}, {1638006149, 13}, {1443165385, 13},
-583000, {1271479187, 13}, {1120235993, 13}, {1973767086, 14}, {1739045674, 14},
-618041, {1532153461, 14}, {1349922194, 14}, {1189384493, 14}, {2095804865, 15},
-777916, {1846464029, 15}, {1626872524, 15}, {1433347133, 15}, {1262853884, 15},
-783868, {1112619678, 15}, {1960569045, 16}, {1727349015, 16}, {1521881227, 16},
-765968, {1340842289, 16}, {1181357555, 16}, {2081669156, 17}, {1834047752, 17},
-724740, {1615889229, 17}, {1423675973, 17}, {1254322457, 17}, {1105123583, 17},
-662468, {1947330755, 18}, {1715693602, 18}, {1511607799, 18}, {1331801790, 18},
-583058, {1173384427, 18}, {2067616532, 19}, {1821667648, 19}, {1604980024, 19},
-490548, {1414066955, 19}, {1245861410, 19}, {1097665748, 19}, {1934193616, 20},
-401623, {1704119624, 20}, {1501412075, 20}, {1322817107, 20}, {1165466323, 20},
-296090, {2053666205, 21}, {1809379407, 21}, {1594151671, 21}, {1404526328, 21},
-73154, {1237455941, 21}, {1090259329, 21}, {1921143210, 22}, {1692621231, 22},
-36711, {1491281857, 22}, {1313892269, 22}, {1157603482, 22}, {2039810470, 23},
-7766, {1797172644, 23}, {1583396912, 23}, {1395050052, 23}, {1229107276, 23},
-2363, {1082903494, 23}, {1082903494, 23}, {1082903494, 23}, {1082903494, 23},
-4905, };
2388,
2681, /* manually derived from
5651, * Table B.5: Selection of quantization levels and codebooks
4086, * FIXME: will become invalid when Huffman codes are introduced.
71110, */
139742, static const int bit_consumption[27] = {
188067, -8, 28, 40, 48, 52, 60, 68, 76, 80, 96,
151237, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
101355, 272, 288, 304, 320, 336, 352, 368,
309917, };
343690,
358839, /* Table B.5: Selection of quantization levels and codebooks */
357555, static const int quant_levels[27] = {
334606, 1, 3, 5, 7, 9, 13, 17, 25, 32, 64,
289625, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536,
224152, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608,
142063,
48725,
74996,
238425,
411666,
584160,
744276,
880730,
983272,
1041933,
1054396,
789531,
851022,
864032,
675431,
418134,
35762,
66911,
103502,
136403,
-55147,
-245269,
-499595,
-808470,
-1136858,
-2010912,
-2581654,
-3151901,
-3696328,
-4196599,
-4633761,
-4993229,
-5262495,
-5436311,
-477650,
-901314,
-1308090,
-1677468,
-1985525,
-2212848,
-2341196,
-2373915,
-2269552,
-2620489,
-2173858,
-1629954,
-946595,
-193499,
1119459,
1138657,
1335311,
1126544,
2765033,
3139603,
3414913,
3599213,
3676363,
3448981,
3328726,
3111551,
2810887,
2428657,
1973684,
1457278,
893848,
300995,
-292521,
-867621,
-1404936,
-1871278,
-2229831,
-2440932,
-2462684,
-2255006,
-1768898,
-1079574,
82115,
1660302,
3660715,
6123610,
8329598,
11888744,
15722147,
19737089,
25647773,
31039399,
36868007,
43124253,
49737161,
56495958,
63668945,
71039511,
78540240,
86089058,
93600041,
100981151,
108136061,
114970055,
121718321,
127566038,
132774642,
137247294,
140894737,
143635018,
145395599,
146114032,
145742999,
144211606,
141594341,
137808404,
132914122,
126912246,
120243281,
112155281,
103338368,
93904953,
83439152,
72921548,
62192990,
51434918,
40894003,
30786726,
21384955,
12939112,
5718193,
-5790,
-3959261,
-5870978,
-5475538,
-2517061,
3247310,
12042937,
24076729,
39531397,
58562863,
81297002,
107826748,
138209187,
172464115,
210569037,
252468018,
298045453,
347168648,
399634888,
455137189,
513586535,
574537650,
637645129,
702597163,
768856566,
836022040,
903618096,
971159680,
1038137214,
1103987353,
1168195035,
1230223053,
1289539180,
1345620373,
1397957958,
1446063657,
1489474689,
1527740502,
1560502307,
1587383079,
1608071145,
1622301248,
1629859340,
1630584888,
1624373875,
1611178348,
1591018893,
1563948667,
1530105004,
1489673227,
1442904075,
1390107674,
1331590427,
1267779478,
1199115126,
1126053392,
1049146257,
968928307,
885965976,
800851610,
714186243,
626590147,
538672486,
451042824,
364299927,
279026812,
195785029,
115109565,
37503924,
-36564551,
-106668063,
-172421668,
-233487283,
-289575706,
-340448569,
-385919511,
-425854915,
-460174578,
-488840702,
-511893328,
-529405118,
-541489888,
-548312207,
-550036471,
-547005316,
-539436808,
-527630488,
-512084785,
-492941605,
-470665204,
-445668379,
-418328829,
-389072810,
-358293846,
-326396227,
-293769619,
-260792276,
-227825056,
-195208961,
-163262121,
-132280748,
-102533727,
-74230062,
-47600637,
-22817785,
-25786,
20662895,
39167253,
55438413,
69453741,
81242430,
90795329,
98213465,
103540643,
106917392,
108861938,
108539682,
106780704,
103722568,
99043289,
93608686,
87266209,
80212203,
72590022,
64603428,
56362402,
48032218,
39749162,
31638971,
23814664,
16376190,
9409836,
2988017,
-2822356,
-7976595,
-12454837,
-16241147,
-19331944,
-21735011,
-23468284,
-24559822,
-25042936,
-25035583,
-24429587,
-23346408,
-21860411,
-20015718,
-17025330,
-14968728,
-12487138,
-9656319,
-7846681,
-5197816,
-2621904,
-144953,
2144746,
3990570,
5845884,
7454650,
8820394,
9929891,
10784445,
11390921,
11762056,
11916017,
12261189,
12117604,
11815303,
11374622,
10815301,
10157241,
9418799,
8629399,
7780776,
7303680,
6353499,
5392738,
4457895,
3543062,
1305978,
1402521,
1084092,
965652,
-151008,
-666667,
-1032157,
-1231475,
-1319043,
-1006023,
-915720,
-773426,
-612377,
-445864,
-291068,
-161337,
-66484,
-11725,
133453,
388184,
615856,
804033,
942377,
1022911,
1041247,
995854,
891376,
572246,
457992,
316365,
172738,
43037,
-117662,
-98542,
-70279,
-41458,
-535790,
-959038,
-1364456,
-1502265,
-1568530,
-2378681,
-2701111,
-2976407,
-3182552,
-3314415,
-3366600,
-3337701,
-3232252,
-3054999,
1984841,
1925903,
1817377,
1669153,
1490069,
1292040,
1086223,
890983,
699163,
201358,
266971,
296990,
198419,
91119,
4737,
5936,
2553,
2060,
-3828,
-1664,
-4917,
-20796,
-36822,
-131247,
-154923,
-162055,
-161354,
-148762,
-125754,
-94473,
-57821,
-19096,
15172,
43004,
65624,
81354,
89325,
89524,
82766,
71075,
55128,
13686,
6921,
1449,
420,
785,
-215,
-179,
-113,
-49,
6002,
16007,
42978,
100662,
171472,
83975,
93702,
108813,
111893,
110272,
103914,
93973,
81606,
68041,
-54058,
-60695,
-65277,
-67224,
-66213,
-62082,
-55574,
-42988,
-35272,
-63735,
-33501,
-12671,
-4038,
-1232,
5,
7
}; };
#endif /* AVCODEC_DCAENC_H */ #endif /* AVCODEC_DCAENC_H */