summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/codecs.h10
-rw-r--r--lib/rbcodec/codecs/mp3_enc.c52
-rw-r--r--lib/rbcodec/codecs/wav_enc.c4
-rw-r--r--lib/rbcodec/codecs/wavpack_enc.c8
4 files changed, 37 insertions, 37 deletions
diff --git a/lib/rbcodec/codecs/codecs.h b/lib/rbcodec/codecs/codecs.h
index 03167f55bf..ae4233b7a6 100644
--- a/lib/rbcodec/codecs/codecs.h
+++ b/lib/rbcodec/codecs/codecs.h
@@ -107,13 +107,13 @@ enum codec_command_action {
107struct codec_api { 107struct codec_api {
108 off_t filesize; /* Total file length */ 108 off_t filesize; /* Total file length */
109 off_t curpos; /* Current buffer position */ 109 off_t curpos; /* Current buffer position */
110 110
111 struct mp3entry *id3; /* TAG metadata pointer */ 111 struct mp3entry *id3; /* TAG metadata pointer */
112 int audio_hid; /* Current audio handle */ 112 int audio_hid; /* Current audio handle */
113 113
114 /* The dsp instance to be used for audio output */ 114 /* The dsp instance to be used for audio output */
115 struct dsp_config *dsp; 115 struct dsp_config *dsp;
116 116
117 /* Returns buffer to malloc array. Only codeclib should need this. */ 117 /* Returns buffer to malloc array. Only codeclib should need this. */
118 void* (*codec_get_buffer)(size_t *size); 118 void* (*codec_get_buffer)(size_t *size);
119 /* Insert PCM data into audio buffer for playback. Playback will start 119 /* Insert PCM data into audio buffer for playback. Playback will start
@@ -121,7 +121,7 @@ struct codec_api {
121 void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count); 121 void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count);
122 /* Set song position in WPS (value in ms). */ 122 /* Set song position in WPS (value in ms). */
123 void (*set_elapsed)(unsigned long value); 123 void (*set_elapsed)(unsigned long value);
124 124
125 /* Read next <size> amount bytes from file buffer to <ptr>. 125 /* Read next <size> amount bytes from file buffer to <ptr>.
126 Will return number of bytes read or 0 if end of file. */ 126 Will return number of bytes read or 0 if end of file. */
127 size_t (*read_filebuf)(void *ptr, size_t size); 127 size_t (*read_filebuf)(void *ptr, size_t size);
@@ -198,7 +198,7 @@ struct codec_api {
198 void (*profile_func_enter)(void *this_fn, void *call_site); 198 void (*profile_func_enter)(void *this_fn, void *call_site);
199 void (*profile_func_exit)(void *this_fn, void *call_site); 199 void (*profile_func_exit)(void *this_fn, void *call_site);
200#endif 200#endif
201 201
202#ifdef HAVE_RECORDING 202#ifdef HAVE_RECORDING
203 void (*enc_get_inputs)(struct enc_inputs *inputs); 203 void (*enc_get_inputs)(struct enc_inputs *inputs);
204 void (*enc_set_parameters)(struct enc_parameters *params); 204 void (*enc_set_parameters)(struct enc_parameters *params);
diff --git a/lib/rbcodec/codecs/mp3_enc.c b/lib/rbcodec/codecs/mp3_enc.c
index e66ee1d910..000eedd849 100644
--- a/lib/rbcodec/codecs/mp3_enc.c
+++ b/lib/rbcodec/codecs/mp3_enc.c
@@ -185,7 +185,7 @@ static const uint8_t ht_count_const[2][2][16] =
185 { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ 185 { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */
186 { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ 186 { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */
187 187
188static const uint8_t t1HB_const[4] = {1,1,1,0}; 188static const uint8_t t1HB_const[4] = {1,1,1,0};
189static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0}; 189static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0};
190static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0}; 190static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0};
191static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; 191static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0};
@@ -739,11 +739,11 @@ static const short int2idx_const[4096] = /* int2idx[i] = sqrt(i*sqrt(i)); */
739509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510, 739509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510,
740510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 }; 740510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 };
741 741
742static const int order[32] = 742static const int order[32] =
743{ 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29, 743{ 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29,
744 2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 }; 744 2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 };
745 745
746static const long sampr_index[2][3] = 746static const long sampr_index[2][3] =
747{ { 22050, 24000, 16000 }, /* MPEG 2 */ 747{ { 22050, 24000, 16000 }, /* MPEG 2 */
748 { 44100, 48000, 32000 } }; /* MPEG 1 */ 748 { 44100, 48000, 32000 } }; /* MPEG 1 */
749 749
@@ -765,7 +765,7 @@ static const int ca_const[8] =
765static const int cs_const[8] = 765static const int cs_const[8] =
766{ 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 }; 766{ 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 };
767 767
768static const short enwindow_const[15*27+24] = 768static const short enwindow_const[15*27+24] =
769{ 0, 65, 593, 1766, 22228, 2115, 611, 62, 769{ 0, 65, 593, 1766, 22228, 2115, 611, 62,
770 8, 119, 1419, 10564,-11659,-1635,-154, -9, 770 8, 119, 1419, 10564,-11659,-1635,-154, -9,
771 -8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91, 771 -8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91,
@@ -853,7 +853,7 @@ static void encodeSideInfo( side_info_t si[2][2] )
853{ 853{
854 int gr, ch, header; 854 int gr, ch, header;
855 uint32_t cc=0, sz=0; 855 uint32_t cc=0, sz=0;
856 856
857 /* 857 /*
858 * MPEG header layout: 858 * MPEG header layout:
859 * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM 859 * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM
@@ -960,7 +960,7 @@ static void Huffmancodebits( short *ix, char *xr_sign, side_info_t *gi )
960 960
961 if(bigvals > region2) 961 if(bigvals > region2)
962 bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); 962 bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]);
963 963
964 if(count1 > bigvals) 964 if(count1 > bigvals)
965 bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); 965 bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]);
966 966
@@ -1158,7 +1158,7 @@ static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
1158{ 1158{
1159 uint32_t i; 1159 uint32_t i;
1160 int max, table0, table1; 1160 int max, table0, table1;
1161 1161
1162 for(i=begin,max=0; i<end; i++) 1162 for(i=begin,max=0; i<end; i++)
1163 if(ix[i] > max) 1163 if(ix[i] > max)
1164 max = ix[i]; 1164 max = ix[i];
@@ -1315,7 +1315,7 @@ static int calc_runlen( short *ix, side_info_t *si )
1315 int w = ix[i-2]; 1315 int w = ix[i-2];
1316 int x = ix[i-3]; 1316 int x = ix[i-3];
1317 int y = ix[i-4]; 1317 int y = ix[i-4];
1318 1318
1319 if((v | w | x | y) <= 1) 1319 if((v | w | x | y) <= 1)
1320 { 1320 {
1321 p = (y<<3) + (x<<2) + (w<<1) + (v); 1321 p = (y<<3) + (x<<2) + (w<<1) + (v);
@@ -1380,7 +1380,7 @@ static int quantize_int(int *xr, short *ix, side_info_t *si)
1380static void subdivide(side_info_t *si) 1380static void subdivide(side_info_t *si)
1381{ 1381{
1382 int scfb, count0, count1; 1382 int scfb, count0, count1;
1383 1383
1384 if( !si->address3 ) 1384 if( !si->address3 )
1385 { /* no bigvalue region */ 1385 { /* no bigvalue region */
1386 si->region_0_1 = 0; 1386 si->region_0_1 = 0;
@@ -1442,7 +1442,7 @@ static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
1442 1442
1443/************************************************************************/ 1443/************************************************************************/
1444/* The code selects the best quantStep for a particular set of scalefacs*/ 1444/* The code selects the best quantStep for a particular set of scalefacs*/
1445/************************************************************************/ 1445/************************************************************************/
1446static int inner_loop(int *xr, int max_bits, side_info_t *si) 1446static int inner_loop(int *xr, int max_bits, side_info_t *si)
1447{ 1447{
1448 int bits; 1448 int bits;
@@ -1783,7 +1783,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1783 a[ 7] -= a[ 6]; 1783 a[ 7] -= a[ 6];
1784 a[22] -= a[ 7]; 1784 a[22] -= a[ 7];
1785 a[23] -= a[22]; 1785 a[23] -= a[22];
1786 1786
1787 xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; 1787 xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr;
1788 xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; 1788 xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr;
1789 xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; 1789 xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr;
@@ -1803,23 +1803,23 @@ void window_subband2(short *x1, int a[SBLIMIT])
1803 xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; 1803 xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25];
1804 xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; 1804 xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25];
1805 xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; 1805 xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25];
1806 1806
1807 xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; 1807 xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr;
1808 xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; 1808 xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr;
1809 xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; 1809 xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18];
1810 xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; 1810 xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19];
1811 1811
1812 xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; 1812 xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr;
1813 xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; 1813 xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr;
1814 xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; 1814 xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr;
1815 1815
1816 xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; 1816 xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr;
1817 xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; 1817 xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr;
1818 xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; 1818 xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr;
1819 xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; 1819 xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr;
1820 1820
1821 xr = a[27]; a[27] = a[6] - xr; a[6] += xr; 1821 xr = a[27]; a[27] = a[6] - xr; a[6] += xr;
1822 1822
1823 xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; 1823 xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr;
1824 xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; 1824 xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr;
1825 xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; 1825 xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr;
@@ -1828,15 +1828,15 @@ void window_subband2(short *x1, int a[SBLIMIT])
1828 xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; 1828 xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9];
1829 xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; 1829 xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25];
1830 xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; 1830 xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24];
1831 1831
1832 xr = a[24] - a[16]; a[24] = xr; 1832 xr = a[24] - a[16]; a[24] = xr;
1833 xr = a[20] - xr; a[20] = xr; 1833 xr = a[20] - xr; a[20] = xr;
1834 xr = a[28] - xr; a[28] = xr; 1834 xr = a[28] - xr; a[28] = xr;
1835 1835
1836 xr = a[25] - a[17]; a[25] = xr; 1836 xr = a[25] - a[17]; a[25] = xr;
1837 xr = a[21] - xr; a[21] = xr; 1837 xr = a[21] - xr; a[21] = xr;
1838 xr = a[29] - xr; a[29] = xr; 1838 xr = a[29] - xr; a[29] = xr;
1839 1839
1840 xr = a[17] - a[1]; a[17] = xr; 1840 xr = a[17] - a[1]; a[17] = xr;
1841 xr = a[ 9] - xr; a[ 9] = xr; 1841 xr = a[ 9] - xr; a[ 9] = xr;
1842 xr = a[25] - xr; a[25] = xr; 1842 xr = a[25] - xr; a[25] = xr;
@@ -1844,7 +1844,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1844 xr = a[21] - xr; a[21] = xr; 1844 xr = a[21] - xr; a[21] = xr;
1845 xr = a[13] - xr; a[13] = xr; 1845 xr = a[13] - xr; a[13] = xr;
1846 xr = a[29] - xr; a[29] = xr; 1846 xr = a[29] - xr; a[29] = xr;
1847 1847
1848 xr = a[ 1] - a[0]; a[ 1] = xr; 1848 xr = a[ 1] - a[0]; a[ 1] = xr;
1849 xr = a[16] - xr; a[16] = xr; 1849 xr = a[16] - xr; a[16] = xr;
1850 xr = a[17] - xr; a[17] = xr; 1850 xr = a[17] - xr; a[17] = xr;
@@ -1860,7 +1860,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1860 xr = a[13] - xr; a[13] = xr; 1860 xr = a[13] - xr; a[13] = xr;
1861 xr = a[28] - xr; a[28] = xr; 1861 xr = a[28] - xr; a[28] = xr;
1862 xr = a[29] - xr; a[29] = xr; 1862 xr = a[29] - xr; a[29] = xr;
1863 1863
1864 xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; 1864 xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr;
1865 xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; 1865 xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr;
1866 xr = a[16]; a[16] += a[15]; a[15] -= xr; 1866 xr = a[16]; a[16] += a[15]; a[15] -= xr;
@@ -1900,7 +1900,7 @@ void mdct_long(int *out, int *in)
1900 ct = (tc1 - tc3 - tc4) * cx[6]; 1900 ct = (tc1 - tc3 - tc4) * cx[6];
1901 out[5] = ct + st; 1901 out[5] = ct + st;
1902 out[6] = ct - st; 1902 out[6] = ct - st;
1903 1903
1904 tc2 = (in[16] - in[10]) * cx[6]; 1904 tc2 = (in[16] - in[10]) * cx[6];
1905 ts6 = ts6 * cx[7] + in[4] * cx[8]; 1905 ts6 = ts6 * cx[7] + in[4] * cx[8];
1906 1906
@@ -1908,12 +1908,12 @@ void mdct_long(int *out, int *in)
1908 st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; 1908 st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3];
1909 out[1] = ct + st; 1909 out[1] = ct + st;
1910 out[2] = ct - st; 1910 out[2] = ct - st;
1911 1911
1912 ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; 1912 ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0];
1913 st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; 1913 st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4];
1914 out[ 9] = ct + st; 1914 out[ 9] = ct + st;
1915 out[10] = ct - st; 1915 out[10] = ct - st;
1916 1916
1917 ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; 1917 ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1];
1918 st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; 1918 st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5];
1919 out[13] = ct + st; 1919 out[13] = ct + st;
@@ -1966,7 +1966,7 @@ static int find_samplerate_index(long freq, int *mp3_type)
1966 int mpeg = freq >= (32000+24000)/2 ? 1 : 0; 1966 int mpeg = freq >= (32000+24000)/2 ? 1 : 0;
1967 int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true); 1967 int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true);
1968 *mp3_type = mpeg; 1968 *mp3_type = mpeg;
1969 return i; 1969 return i;
1970} 1970}
1971 1971
1972static bool init_mp3_encoder_engine(int sample_rate, 1972static bool init_mp3_encoder_engine(int sample_rate,
@@ -2523,7 +2523,7 @@ static void enc_events_callback(enum enc_events event, void *data)
2523 return; 2523 return;
2524 2524
2525 break; 2525 break;
2526 2526
2527 case ENC_END_FILE: 2527 case ENC_END_FILE:
2528 if (on_end_file((struct enc_file_event_data *)data)) 2528 if (on_end_file((struct enc_file_event_data *)data))
2529 return; 2529 return;
diff --git a/lib/rbcodec/codecs/wav_enc.c b/lib/rbcodec/codecs/wav_enc.c
index 85b6f560e3..01d0f79bcf 100644
--- a/lib/rbcodec/codecs/wav_enc.c
+++ b/lib/rbcodec/codecs/wav_enc.c
@@ -40,7 +40,7 @@ struct riff_header
40 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ 40 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
41 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ 41 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
42 /* Not for audio_format=1 (PCM) */ 42 /* Not for audio_format=1 (PCM) */
43/* unsigned short extra_param_size; 24h - size of extra data */ 43/* unsigned short extra_param_size; 24h - size of extra data */
44/* unsigned char *extra_params; */ 44/* unsigned char *extra_params; */
45 /* data header */ 45 /* data header */
46 uint8_t data_id[4]; /* 24h - "data" */ 46 uint8_t data_id[4]; /* 24h - "data" */
@@ -68,7 +68,7 @@ static const struct riff_header riff_header =
68 /* "RIFF" header */ 68 /* "RIFF" header */
69 { 'R', 'I', 'F', 'F' }, /* riff_id */ 69 { 'R', 'I', 'F', 'F' }, /* riff_id */
70 0, /* riff_size (*) */ 70 0, /* riff_size (*) */
71 /* format header */ 71 /* format header */
72 { 'W', 'A', 'V', 'E' }, /* format */ 72 { 'W', 'A', 'V', 'E' }, /* format */
73 { 'f', 'm', 't', ' ' }, /* format_id */ 73 { 'f', 'm', 't', ' ' }, /* format_id */
74 htole32(16), /* format_size */ 74 htole32(16), /* format_size */
diff --git a/lib/rbcodec/codecs/wavpack_enc.c b/lib/rbcodec/codecs/wavpack_enc.c
index 71454fff7d..1fae2d46a7 100644
--- a/lib/rbcodec/codecs/wavpack_enc.c
+++ b/lib/rbcodec/codecs/wavpack_enc.c
@@ -47,7 +47,7 @@ struct riff_header
47 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ 47 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
48 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ 48 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
49 /* Not for audio_format=1 (PCM) */ 49 /* Not for audio_format=1 (PCM) */
50/* unsigned short extra_param_size; 24h - size of extra data */ 50/* unsigned short extra_param_size; 24h - size of extra data */
51/* unsigned char *extra_params; */ 51/* unsigned char *extra_params; */
52 /* data header */ 52 /* data header */
53 uint8_t data_id[4]; /* 24h - "data" */ 53 uint8_t data_id[4]; /* 24h - "data" */
@@ -82,7 +82,7 @@ static const struct riff_header riff_header =
82 /* "RIFF" header */ 82 /* "RIFF" header */
83 { 'R', 'I', 'F', 'F' }, /* riff_id */ 83 { 'R', 'I', 'F', 'F' }, /* riff_id */
84 0, /* riff_size (*) */ 84 0, /* riff_size (*) */
85 /* format header */ 85 /* format header */
86 { 'W', 'A', 'V', 'E' }, /* format */ 86 { 'W', 'A', 'V', 'E' }, /* format */
87 { 'f', 'm', 't', ' ' }, /* format_id */ 87 { 'f', 'm', 't', ' ' }, /* format_id */
88 htole32(16), /* format_size */ 88 htole32(16), /* format_size */
@@ -234,7 +234,7 @@ static bool on_start_file(struct enc_file_event_data *data)
234 data->num_pcm_samples = 0; 234 data->num_pcm_samples = 0;
235 235
236 /* write template headers */ 236 /* write template headers */
237 if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh)) 237 if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh))
238 != sizeof (wvpk_mdh) || 238 != sizeof (wvpk_mdh) ||
239 ci->write(data->rec_file, &riff_header, sizeof (riff_header)) 239 ci->write(data->rec_file, &riff_header, sizeof (riff_header))
240 != sizeof (riff_header)) 240 != sizeof (riff_header))
@@ -344,7 +344,7 @@ static bool init_encoder(void)
344{ 344{
345 struct enc_inputs inputs; 345 struct enc_inputs inputs;
346 struct enc_parameters params; 346 struct enc_parameters params;
347 347
348 codec_init(); 348 codec_init();
349 349
350 if (ci->enc_get_inputs == NULL || 350 if (ci->enc_get_inputs == NULL ||