Move a few small tables into PROGMEM

No reason not to save a few bytes of RAM by moving some char[] to PROGMEM.
This commit is contained in:
Earle F. Philhower, III committed 2017-11-23 19:31:39 -08:00
1 parent 1875683ce1
commit 373b4ef6ff
3 files changed
+13 -13

No files matched your search

+6 -6
View File
@@ -187,17 +187,17 @@ extern const int sampRateTab[NUM_SAMPLE_RATES];
extern const int predSFBMax[NUM_SAMPLE_RATES];
extern const int channelMapTab[NUM_DEF_CHAN_MAPS];
extern const int elementNumChans[NUM_ELEMENTS];
extern const unsigned char sfBandTotalShort[NUM_SAMPLE_RATES];
extern const unsigned char sfBandTotalLong[NUM_SAMPLE_RATES];
extern const unsigned /*char*/ int sfBandTotalShort[NUM_SAMPLE_RATES];
extern const unsigned /*char*/ int sfBandTotalLong[NUM_SAMPLE_RATES];
extern const int sfBandTabShortOffset[NUM_SAMPLE_RATES];
extern const /*short*/ int sfBandTabShort[76];
extern const int sfBandTabLongOffset[NUM_SAMPLE_RATES];
extern const /*short*/ int sfBandTabLong[325];
extern const int tnsMaxBandsShortOffset[AAC_NUM_PROFILES];
extern const unsigned char tnsMaxBandsShort[2*NUM_SAMPLE_RATES];
extern const unsigned char tnsMaxOrderShort[AAC_NUM_PROFILES];
extern const unsigned /*char*/ int tnsMaxBandsShort[2*NUM_SAMPLE_RATES];
extern const unsigned /*char*/ int tnsMaxOrderShort[AAC_NUM_PROFILES];
extern const int tnsMaxBandsLongOffset[AAC_NUM_PROFILES];
extern const unsigned char tnsMaxBandsLong[2*NUM_SAMPLE_RATES];
extern const unsigned char tnsMaxOrderLong[AAC_NUM_PROFILES];
extern const unsigned /*char*/ int tnsMaxBandsLong[2*NUM_SAMPLE_RATES];
extern const unsigned /*char*/ int tnsMaxOrderLong[AAC_NUM_PROFILES];
#endif /* _AACCOMMON_H */
+6 -6
View File
@@ -69,11 +69,11 @@ const int elementNumChans[NUM_ELEMENTS] PROGMEM = {
};
/* total number of scale factor bands in one window */
const unsigned char sfBandTotalShort[NUM_SAMPLE_RATES] = {
const unsigned int /*char*/ sfBandTotalShort[NUM_SAMPLE_RATES] PROGMEM = {
12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
};
const unsigned char sfBandTotalLong[NUM_SAMPLE_RATES] = {
const unsigned int /*char*/ sfBandTotalLong[NUM_SAMPLE_RATES] PROGMEM = {
41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
};
@@ -140,18 +140,18 @@ const /*short*/ int sfBandTabLong[325] PROGMEM = {
/* TNS max bands (table 4.139) and max order (table 4.138) */
const int tnsMaxBandsShortOffset[AAC_NUM_PROFILES] PROGMEM = {0, 0, 12};
const unsigned char tnsMaxBandsShort[2*NUM_SAMPLE_RATES] = {
const unsigned /*char*/ int tnsMaxBandsShort[2*NUM_SAMPLE_RATES] PROGMEM = {
9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, /* short block, Main/LC */
7, 7, 7, 6, 6, 6, 7, 7, 8, 8, 8, 7 /* short block, SSR */
};
const unsigned char tnsMaxOrderShort[AAC_NUM_PROFILES] = {7, 7, 7};
const unsigned /*char*/ int tnsMaxOrderShort[AAC_NUM_PROFILES] PROGMEM = {7, 7, 7};
const int tnsMaxBandsLongOffset[AAC_NUM_PROFILES] PROGMEM = {0, 0, 12};
const unsigned char tnsMaxBandsLong[2*NUM_SAMPLE_RATES] = {
const unsigned int /*char*/ tnsMaxBandsLong[2*NUM_SAMPLE_RATES] PROGMEM = {
31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, /* long block, Main/LC */
28, 28, 27, 26, 26, 26, 29, 29, 23, 23, 23, 19, /* long block, SSR */
};
const unsigned char tnsMaxOrderLong[AAC_NUM_PROFILES] = {20, 12, 12};
const unsigned /*char*/ int tnsMaxOrderLong[AAC_NUM_PROFILES] PROGMEM = {20, 12, 12};
+1 -1
View File
@@ -190,7 +190,7 @@ int TNSFilter(AACDecInfo *aacDecInfo, int ch)
int *audioCoef;
unsigned char *filtLength, *filtOrder, *filtRes, *filtDir;
signed char *filtCoef;
const unsigned char *tnsMaxBandTab;
const unsigned /*char*/ int *tnsMaxBandTab;
const /*short*/ int *sfbTab;
ICSInfo *icsInfo;
TNSInfo *ti;