diff options
Diffstat (limited to 'apps/plugins/mp3_encoder.c')
-rw-r--r-- | apps/plugins/mp3_encoder.c | 80 |
1 files changed, 34 insertions, 46 deletions
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 0368edbc88..177835549c 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c | |||
@@ -152,7 +152,7 @@ static const uint8_t ht_count[2][2][16] = | |||
152 | { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ | 152 | { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ |
153 | { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ | 153 | { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ |
154 | 154 | ||
155 | static const uint8_t t1HB[4] = {1,1,1,0}; | 155 | static const uint8_t t1HB[4] = {1,1,1,0}; |
156 | static const uint8_t t2HB[9] = {1,2,1,3,1,1,3,2,0}; | 156 | static const uint8_t t2HB[9] = {1,2,1,3,1,1,3,2,0}; |
157 | static const uint8_t t3HB[9] = {3,2,1,1,1,1,3,2,0}; | 157 | static const uint8_t t3HB[9] = {3,2,1,1,1,1,3,2,0}; |
158 | static const uint8_t t5HB[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; | 158 | static const uint8_t t5HB[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; |
@@ -802,7 +802,7 @@ static const int16_t win[18][4] = { | |||
802 | { 529, -831,-3747,-2387 }, | 802 | { 529, -831,-3747,-2387 }, |
803 | { 362, -471,-3579,-2747 }, | 803 | { 362, -471,-3579,-2747 }, |
804 | { 134, -146,-3352,-3072 } }; | 804 | { 134, -146,-3352,-3072 } }; |
805 | 805 | ||
806 | static char* mp3_enc_err[] = { | 806 | static char* mp3_enc_err[] = { |
807 | /* 0 */ "", | 807 | /* 0 */ "", |
808 | /* 1 */ "Cannot open file.", | 808 | /* 1 */ "Cannot open file.", |
@@ -880,21 +880,21 @@ static int wave_open(void) | |||
880 | 880 | ||
881 | if((wavfile = rb->open(wav_filename, O_RDONLY)) < 0) | 881 | if((wavfile = rb->open(wav_filename, O_RDONLY)) < 0) |
882 | return -1; | 882 | return -1; |
883 | 883 | ||
884 | if(!checkString(wavfile,"RIFF")) return -2; | 884 | if(!checkString(wavfile,"RIFF")) return -2; |
885 | Read32BitsLowHigh(wavfile); /* complete wave chunk size */ | 885 | Read32BitsLowHigh(wavfile); /* complete wave chunk size */ |
886 | if(!checkString(wavfile,"WAVE")) return -3; | 886 | if(!checkString(wavfile,"WAVE")) return -3; |
887 | if(!checkString(wavfile,"fmt ")) return -4; | 887 | if(!checkString(wavfile,"fmt ")) return -4; |
888 | 888 | ||
889 | header_size = Read32BitsLowHigh(wavfile); /* chunk size */ | 889 | header_size = Read32BitsLowHigh(wavfile); /* chunk size */ |
890 | wFormatTag = Read16BitsLowHigh(wavfile); | 890 | wFormatTag = Read16BitsLowHigh(wavfile); |
891 | 891 | ||
892 | cfg.channels = Read16BitsLowHigh(wavfile); | 892 | cfg.channels = Read16BitsLowHigh(wavfile); |
893 | cfg.samplerate = Read32BitsLowHigh(wavfile); | 893 | cfg.samplerate = Read32BitsLowHigh(wavfile); |
894 | /*dAvgBytesPerSec*/ Read32BitsLowHigh(wavfile); | 894 | /*dAvgBytesPerSec*/ Read32BitsLowHigh(wavfile); |
895 | /*wBlockAlign */ Read16BitsLowHigh(wavfile); | 895 | /*wBlockAlign */ Read16BitsLowHigh(wavfile); |
896 | bits_per_samp = Read16BitsLowHigh(wavfile); | 896 | bits_per_samp = Read16BitsLowHigh(wavfile); |
897 | 897 | ||
898 | if(wFormatTag != 0x0001) return -5; /* linear PCM required */ | 898 | if(wFormatTag != 0x0001) return -5; /* linear PCM required */ |
899 | if(bits_per_samp != 16) return -6; /* 16 bps required */ | 899 | if(bits_per_samp != 16) return -6; /* 16 bps required */ |
900 | if(cfg.channels > 2) return -7; /* <=2 channels required */ | 900 | if(cfg.channels > 2) return -7; /* <=2 channels required */ |
@@ -904,11 +904,11 @@ static int wave_open(void) | |||
904 | if((cfg.samplerate != 16000) && (cfg.samplerate != 22050) && | 904 | if((cfg.samplerate != 16000) && (cfg.samplerate != 22050) && |
905 | (cfg.samplerate != 24000) && (cfg.samplerate != 32000) && | 905 | (cfg.samplerate != 24000) && (cfg.samplerate != 32000) && |
906 | (cfg.samplerate != 44100) && (cfg.samplerate != 48000)) return -9; | 906 | (cfg.samplerate != 44100) && (cfg.samplerate != 48000)) return -9; |
907 | 907 | ||
908 | header_size = 0x28; | 908 | header_size = 0x28; |
909 | wav_size = rb->filesize(wavfile); | 909 | wav_size = rb->filesize(wavfile); |
910 | rb->lseek(wavfile, header_size, SEEK_SET); | 910 | rb->lseek(wavfile, header_size, SEEK_SET); |
911 | 911 | ||
912 | return 0; | 912 | return 0; |
913 | } | 913 | } |
914 | 914 | ||
@@ -946,7 +946,7 @@ static void encodeSideInfo( side_info_t si[2][2] ) | |||
946 | { | 946 | { |
947 | int gr, ch, header; | 947 | int gr, ch, header; |
948 | uint32_t cc=0, sz=0; | 948 | uint32_t cc=0, sz=0; |
949 | 949 | ||
950 | /* | 950 | /* |
951 | * MPEG header layout: | 951 | * MPEG header layout: |
952 | * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM | 952 | * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM |
@@ -1053,7 +1053,7 @@ static void Huffmancodebits( short *ix, char *xr_sign, side_info_t *gi ) | |||
1053 | 1053 | ||
1054 | if(bigvals > region2) | 1054 | if(bigvals > region2) |
1055 | bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); | 1055 | bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); |
1056 | 1056 | ||
1057 | if(count1 > bigvals) | 1057 | if(count1 > bigvals) |
1058 | bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); | 1058 | bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); |
1059 | 1059 | ||
@@ -1251,7 +1251,7 @@ static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits ) | |||
1251 | { | 1251 | { |
1252 | uint32_t i; | 1252 | uint32_t i; |
1253 | int max, table0, table1; | 1253 | int max, table0, table1; |
1254 | 1254 | ||
1255 | for(i=begin,max=0; i<end; i++) | 1255 | for(i=begin,max=0; i<end; i++) |
1256 | if(ix[i] > max) | 1256 | if(ix[i] > max) |
1257 | max = ix[i]; | 1257 | max = ix[i]; |
@@ -1408,7 +1408,7 @@ static int calc_runlen( short *ix, side_info_t *si ) | |||
1408 | int w = ix[i-2]; | 1408 | int w = ix[i-2]; |
1409 | int x = ix[i-3]; | 1409 | int x = ix[i-3]; |
1410 | int y = ix[i-4]; | 1410 | int y = ix[i-4]; |
1411 | 1411 | ||
1412 | if((v | w | x | y) <= 1) | 1412 | if((v | w | x | y) <= 1) |
1413 | { | 1413 | { |
1414 | p = (y<<3) + (x<<2) + (w<<1) + (v); | 1414 | p = (y<<3) + (x<<2) + (w<<1) + (v); |
@@ -1473,7 +1473,7 @@ static int quantize_int(int *xr, short *ix, side_info_t *si) | |||
1473 | static void subdivide(side_info_t *si) | 1473 | static void subdivide(side_info_t *si) |
1474 | { | 1474 | { |
1475 | int scfb, count0, count1; | 1475 | int scfb, count0, count1; |
1476 | 1476 | ||
1477 | if( !si->address3 ) | 1477 | if( !si->address3 ) |
1478 | { /* no bigvalue region */ | 1478 | { /* no bigvalue region */ |
1479 | si->region_0_1 = 0; | 1479 | si->region_0_1 = 0; |
@@ -1535,7 +1535,7 @@ static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si) | |||
1535 | 1535 | ||
1536 | /************************************************************************/ | 1536 | /************************************************************************/ |
1537 | /* The code selects the best quantStep for a particular set of scalefacs*/ | 1537 | /* The code selects the best quantStep for a particular set of scalefacs*/ |
1538 | /************************************************************************/ | 1538 | /************************************************************************/ |
1539 | static int inner_loop(int *xr, int max_bits, side_info_t *si) | 1539 | static int inner_loop(int *xr, int max_bits, side_info_t *si) |
1540 | { | 1540 | { |
1541 | int bits; | 1541 | int bits; |
@@ -1877,7 +1877,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) | |||
1877 | a[ 7] -= a[ 6]; | 1877 | a[ 7] -= a[ 6]; |
1878 | a[22] -= a[ 7]; | 1878 | a[22] -= a[ 7]; |
1879 | a[23] -= a[22]; | 1879 | a[23] -= a[22]; |
1880 | 1880 | ||
1881 | xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; | 1881 | xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; |
1882 | xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; | 1882 | xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; |
1883 | xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; | 1883 | xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; |
@@ -1897,23 +1897,23 @@ void window_subband2(short *x1, int a[SBLIMIT]) | |||
1897 | xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; | 1897 | xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; |
1898 | xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; | 1898 | xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; |
1899 | xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; | 1899 | xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; |
1900 | 1900 | ||
1901 | xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; | 1901 | xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; |
1902 | xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; | 1902 | xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; |
1903 | xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; | 1903 | xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; |
1904 | xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; | 1904 | xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; |
1905 | 1905 | ||
1906 | xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; | 1906 | xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; |
1907 | xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; | 1907 | xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; |
1908 | xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; | 1908 | xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; |
1909 | 1909 | ||
1910 | xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; | 1910 | xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; |
1911 | xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; | 1911 | xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; |
1912 | xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; | 1912 | xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; |
1913 | xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; | 1913 | xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; |
1914 | 1914 | ||
1915 | xr = a[27]; a[27] = a[6] - xr; a[6] += xr; | 1915 | xr = a[27]; a[27] = a[6] - xr; a[6] += xr; |
1916 | 1916 | ||
1917 | xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; | 1917 | xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; |
1918 | xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; | 1918 | xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; |
1919 | xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; | 1919 | xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; |
@@ -1922,15 +1922,15 @@ void window_subband2(short *x1, int a[SBLIMIT]) | |||
1922 | xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; | 1922 | xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; |
1923 | xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; | 1923 | xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; |
1924 | xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; | 1924 | xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; |
1925 | 1925 | ||
1926 | xr = a[24] - a[16]; a[24] = xr; | 1926 | xr = a[24] - a[16]; a[24] = xr; |
1927 | xr = a[20] - xr; a[20] = xr; | 1927 | xr = a[20] - xr; a[20] = xr; |
1928 | xr = a[28] - xr; a[28] = xr; | 1928 | xr = a[28] - xr; a[28] = xr; |
1929 | 1929 | ||
1930 | xr = a[25] - a[17]; a[25] = xr; | 1930 | xr = a[25] - a[17]; a[25] = xr; |
1931 | xr = a[21] - xr; a[21] = xr; | 1931 | xr = a[21] - xr; a[21] = xr; |
1932 | xr = a[29] - xr; a[29] = xr; | 1932 | xr = a[29] - xr; a[29] = xr; |
1933 | 1933 | ||
1934 | xr = a[17] - a[1]; a[17] = xr; | 1934 | xr = a[17] - a[1]; a[17] = xr; |
1935 | xr = a[ 9] - xr; a[ 9] = xr; | 1935 | xr = a[ 9] - xr; a[ 9] = xr; |
1936 | xr = a[25] - xr; a[25] = xr; | 1936 | xr = a[25] - xr; a[25] = xr; |
@@ -1938,7 +1938,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) | |||
1938 | xr = a[21] - xr; a[21] = xr; | 1938 | xr = a[21] - xr; a[21] = xr; |
1939 | xr = a[13] - xr; a[13] = xr; | 1939 | xr = a[13] - xr; a[13] = xr; |
1940 | xr = a[29] - xr; a[29] = xr; | 1940 | xr = a[29] - xr; a[29] = xr; |
1941 | 1941 | ||
1942 | xr = a[ 1] - a[0]; a[ 1] = xr; | 1942 | xr = a[ 1] - a[0]; a[ 1] = xr; |
1943 | xr = a[16] - xr; a[16] = xr; | 1943 | xr = a[16] - xr; a[16] = xr; |
1944 | xr = a[17] - xr; a[17] = xr; | 1944 | xr = a[17] - xr; a[17] = xr; |
@@ -1954,7 +1954,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) | |||
1954 | xr = a[13] - xr; a[13] = xr; | 1954 | xr = a[13] - xr; a[13] = xr; |
1955 | xr = a[28] - xr; a[28] = xr; | 1955 | xr = a[28] - xr; a[28] = xr; |
1956 | xr = a[29] - xr; a[29] = xr; | 1956 | xr = a[29] - xr; a[29] = xr; |
1957 | 1957 | ||
1958 | xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; | 1958 | xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; |
1959 | xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; | 1959 | xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; |
1960 | xr = a[16]; a[16] += a[15]; a[15] -= xr; | 1960 | xr = a[16]; a[16] += a[15]; a[15] -= xr; |
@@ -1994,7 +1994,7 @@ void mdct_long(int *out, int *in) | |||
1994 | ct = (tc1 - tc3 - tc4) * cx[6]; | 1994 | ct = (tc1 - tc3 - tc4) * cx[6]; |
1995 | out[5] = ct + st; | 1995 | out[5] = ct + st; |
1996 | out[6] = ct - st; | 1996 | out[6] = ct - st; |
1997 | 1997 | ||
1998 | tc2 = (in[16] - in[10]) * cx[6]; | 1998 | tc2 = (in[16] - in[10]) * cx[6]; |
1999 | ts6 = ts6 * cx[7] + in[4] * cx[8]; | 1999 | ts6 = ts6 * cx[7] + in[4] * cx[8]; |
2000 | 2000 | ||
@@ -2002,12 +2002,12 @@ void mdct_long(int *out, int *in) | |||
2002 | st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; | 2002 | st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; |
2003 | out[1] = ct + st; | 2003 | out[1] = ct + st; |
2004 | out[2] = ct - st; | 2004 | out[2] = ct - st; |
2005 | 2005 | ||
2006 | ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; | 2006 | ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; |
2007 | st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; | 2007 | st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; |
2008 | out[ 9] = ct + st; | 2008 | out[ 9] = ct + st; |
2009 | out[10] = ct - st; | 2009 | out[10] = ct - st; |
2010 | 2010 | ||
2011 | ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; | 2011 | ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; |
2012 | st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; | 2012 | st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; |
2013 | out[13] = ct + st; | 2013 | out[13] = ct + st; |
@@ -2089,7 +2089,7 @@ static void init_mp3_encoder_engine(bool stereo, int bitrate, uint16_t sample_ra | |||
2089 | cfg.mpg.smpl_id = find_samplerate_index(cfg.samplerate, &cfg.mpg.type); | 2089 | cfg.mpg.smpl_id = find_samplerate_index(cfg.samplerate, &cfg.mpg.type); |
2090 | cfg.mpg.bitr_id = find_bitrate_index(cfg.mpg.type, cfg.mpg.bitrate); | 2090 | cfg.mpg.bitr_id = find_bitrate_index(cfg.mpg.type, cfg.mpg.bitrate); |
2091 | cfg.mpg.num_bands = num_bands[stereo ? cfg.mpg.type : 2][cfg.mpg.bitr_id]; | 2091 | cfg.mpg.num_bands = num_bands[stereo ? cfg.mpg.type : 2][cfg.mpg.bitr_id]; |
2092 | 2092 | ||
2093 | if(0 == cfg.mpg.type) | 2093 | if(0 == cfg.mpg.type) |
2094 | { /* use MPEG2 format */ | 2094 | { /* use MPEG2 format */ |
2095 | cfg.smpl_per_frm = MAX_SAMP_PER_FRAME/2; | 2095 | cfg.smpl_per_frm = MAX_SAMP_PER_FRAME/2; |
@@ -2172,13 +2172,13 @@ static void compress(void) | |||
2172 | { | 2172 | { |
2173 | if((frames & 7) == 0) | 2173 | if((frames & 7) == 0) |
2174 | { rb->lcd_clear_display(); | 2174 | { rb->lcd_clear_display(); |
2175 | rb->lcd_putsxyf(4, 20, "Frame %d / %d", frames, | 2175 | rb->lcd_putsxyf(4, 20, "Frame %d / %d", frames, |
2176 | wav_size/cfg.smpl_per_frm/cfg.channels/2); | 2176 | wav_size/cfg.smpl_per_frm/cfg.channels/2); |
2177 | rb->lcd_update(); | 2177 | rb->lcd_update(); |
2178 | } | 2178 | } |
2179 | /* encode one mp3 frame in this loop */ | 2179 | /* encode one mp3 frame in this loop */ |
2180 | memset(CodedData.bbuf, 0, sizeof(CodedData.bbuf)); | 2180 | memset(CodedData.bbuf, 0, sizeof(CodedData.bbuf)); |
2181 | 2181 | ||
2182 | if((cfg.slot_lag += cfg.frac_per_frame) >= 64) | 2182 | if((cfg.slot_lag += cfg.frac_per_frame) >= 64) |
2183 | { /* Padding for this frame */ | 2183 | { /* Padding for this frame */ |
2184 | cfg.slot_lag -= 64; | 2184 | cfg.slot_lag -= 64; |
@@ -2556,19 +2556,7 @@ CONFIG_KEYPAD == MROBE500_PAD | |||
2556 | #define MP3ENC_DONE BUTTON_POWER | 2556 | #define MP3ENC_DONE BUTTON_POWER |
2557 | #define MP3ENC_SELECT BUTTON_SELECT | 2557 | #define MP3ENC_SELECT BUTTON_SELECT |
2558 | 2558 | ||
2559 | #elif CONFIG_KEYPAD == XDUOO_X3_PAD | 2559 | #elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD |
2560 | #define MP3ENC_PREV BUTTON_HOME | ||
2561 | #define MP3ENC_NEXT BUTTON_OPTION | ||
2562 | #define MP3ENC_DONE BUTTON_POWER | ||
2563 | #define MP3ENC_SELECT BUTTON_PLAY | ||
2564 | |||
2565 | #elif CONFIG_KEYPAD == XDUOO_X3II_PAD | ||
2566 | #define MP3ENC_PREV BUTTON_HOME | ||
2567 | #define MP3ENC_NEXT BUTTON_OPTION | ||
2568 | #define MP3ENC_DONE BUTTON_POWER | ||
2569 | #define MP3ENC_SELECT BUTTON_PLAY | ||
2570 | |||
2571 | #elif CONFIG_KEYPAD == XDUOO_X20_PAD | ||
2572 | #define MP3ENC_PREV BUTTON_HOME | 2560 | #define MP3ENC_PREV BUTTON_HOME |
2573 | #define MP3ENC_NEXT BUTTON_OPTION | 2561 | #define MP3ENC_NEXT BUTTON_OPTION |
2574 | #define MP3ENC_DONE BUTTON_POWER | 2562 | #define MP3ENC_DONE BUTTON_POWER |
@@ -2580,13 +2568,13 @@ CONFIG_KEYPAD == MROBE500_PAD | |||
2580 | #define MP3ENC_DONE BUTTON_POWER | 2568 | #define MP3ENC_DONE BUTTON_POWER |
2581 | #define MP3ENC_SELECT BUTTON_PLAY | 2569 | #define MP3ENC_SELECT BUTTON_PLAY |
2582 | 2570 | ||
2583 | #elif CONFIG_KEYPAD == IHIFI_770_PAD | 2571 | #elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD |
2584 | #define MP3ENC_PREV BUTTON_PREV | 2572 | #define MP3ENC_PREV BUTTON_PREV |
2585 | #define MP3ENC_NEXT BUTTON_NEXT | 2573 | #define MP3ENC_NEXT BUTTON_NEXT |
2586 | #define MP3ENC_DONE BUTTON_POWER | 2574 | #define MP3ENC_DONE BUTTON_POWER |
2587 | #define MP3ENC_SELECT BUTTON_PLAY | 2575 | #define MP3ENC_SELECT BUTTON_PLAY |
2588 | 2576 | ||
2589 | #elif CONFIG_KEYPAD == IHIFI_800_PAD | 2577 | #elif CONFIG_KEYPAD == EROSQ_PAD |
2590 | #define MP3ENC_PREV BUTTON_PREV | 2578 | #define MP3ENC_PREV BUTTON_PREV |
2591 | #define MP3ENC_NEXT BUTTON_NEXT | 2579 | #define MP3ENC_NEXT BUTTON_NEXT |
2592 | #define MP3ENC_DONE BUTTON_POWER | 2580 | #define MP3ENC_DONE BUTTON_POWER |