aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-06-26 11:53:18 +0100
committerNadesh Ramanathan <nadeshramanathan88@gmail.com>2020-06-26 11:53:18 +0100
commit26f73ea7c9f77b6941075571cd1dc91e15c114c3 (patch)
treeab734e7e7c3ea72cd5dafdce885571db8164776f
parentea0f077891a3935f1138f14796b323b1a9bdab1f (diff)
downloadvericert-26f73ea7c9f77b6941075571cd1dc91e15c114c3.tar.gz
vericert-26f73ea7c9f77b6941075571cd1dc91e15c114c3.zip
working adpcm in coqup
-rwxr-xr-xbenchmarks/CHStone/adpcm/adpcm.c84
1 files changed, 41 insertions, 43 deletions
diff --git a/benchmarks/CHStone/adpcm/adpcm.c b/benchmarks/CHStone/adpcm/adpcm.c
index b11eed9..bb44500 100755
--- a/benchmarks/CHStone/adpcm/adpcm.c
+++ b/benchmarks/CHStone/adpcm/adpcm.c
@@ -354,11 +354,46 @@ adpcm_main (const int test_data[SIZE], int compressed[SIZE], int result[SIZE])
1448, 128, -624, 48, 212, -44, -44, 12
};
- int xl, xh;
/* variables for receive quadrature mirror filter here */
int accumc[11], accumd[11];
+ const int qq2_code2_table[4] = {
+ -7408, -1616, 7408, 1616
+ };
+
+ const int qq4_code4_table[16] = {
+ 0, -20456, -12896, -8968, -6288, -4240, -2584, -1200,
+ 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0
+ };
+ const int qq6_code6_table[64] = {
+ -136, -136, -136, -136, -24808, -21904, -19008, -16704,
+ -14984, -13512, -12280, -11192, -10232, -9360, -8576, -7856,
+ -7192, -6576, -6000, -5456, -4944, -4464, -4008, -3576,
+ -3168, -2776, -2400, -2032, -1688, -1360, -1040, -728,
+ 24808, 21904, 19008, 16704, 14984, 13512, 12280, 11192,
+ 10232, 9360, 8576, 7856, 7192, 6576, 6000, 5456,
+ 4944, 4464, 4008, 3576, 3168, 2776, 2400, 2032,
+ 1688, 1360, 1040, 728, 432, 136, -432, -136
+ };
+
+
+ int delay_dhx[6];
+
+ int delay_bph[6];
+
+ int dec_del_bpl[6];
+
+ int dec_del_dltx[6];
+
+ /* variables used in filtez */
+ int dec_del_bph[6];
+
+ int dec_del_dhx[6];
+
+ int delay_bpl[6];
+
+ int delay_dltx[6];
/* outputs of decode() */
int xout1, xout2;
@@ -368,9 +403,6 @@ adpcm_main (const int test_data[SIZE], int compressed[SIZE], int result[SIZE])
int il, szl, spl, sl, el;
- int delay_bpl[6];
-
- int delay_dltx[6];
int nbl; /* delay line */
int al1, al2;
@@ -384,31 +416,17 @@ adpcm_main (const int test_data[SIZE], int compressed[SIZE], int result[SIZE])
int sh; /* this comes from adaptive predictor */
int eh;
- const int qq2_code2_table[4] = {
- -7408, -1616, 7408, 1616
- };
-
+ int ah1, ah2;
+ int ph1, ph2;
+ int rh1, rh2;
int dh, ih;
int nbh, szh;
int sph, ph, yh, rh;
- int delay_dhx[6];
-
- int delay_bph[6];
-
- int ah1, ah2;
- int ph1, ph2;
- int rh1, rh2;
-
/* variables for decoder here */
int ilr, rl;
int dec_deth, dec_detl, dec_dlt;
-
- int dec_del_bpl[6];
-
- int dec_del_dltx[6];
-
int dec_plt, dec_plt1, dec_plt2;
int dec_szl, dec_spl, dec_sl;
int dec_rlt1, dec_rlt2, dec_rlt;
@@ -416,11 +434,6 @@ adpcm_main (const int test_data[SIZE], int compressed[SIZE], int result[SIZE])
int dl;
int dec_nbl, dec_dh, dec_nbh;
- /* variables used in filtez */
- int dec_del_bph[6];
-
- int dec_del_dhx[6];
-
int dec_szh;
/* variables used in filtep */
int dec_rh1, dec_rh2;
@@ -432,21 +445,6 @@ adpcm_main (const int test_data[SIZE], int compressed[SIZE], int result[SIZE])
int dec_ph1, dec_ph2;
int i, j;
- const int qq4_code4_table[16] = {
- 0, -20456, -12896, -8968, -6288, -4240, -2584, -1200,
- 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0
- };
- const int qq6_code6_table[64] = {
- -136, -136, -136, -136, -24808, -21904, -19008, -16704,
- -14984, -13512, -12280, -11192, -10232, -9360, -8576, -7856,
- -7192, -6576, -6000, -5456, -4944, -4464, -4008, -3576,
- -3168, -2776, -2400, -2032, -1688, -1360, -1040, -728,
- 24808, 21904, 19008, 16704, 14984, 13512, 12280, 11192,
- 10232, 9360, 8576, 7856, 7192, 6576, 6000, 5456,
- 4944, 4464, 4008, 3576, 3168, 2776, 2400, 2032,
- 1688, 1360, 1040, 728, 432, 136, -432, -136
- };
-
/* reset, initialize required memory */
detl = dec_detl = 32; /* reset to min scale factor */
@@ -843,13 +841,13 @@ main ()
{
main_result += 1;
}
- }
+ }/*
for (i = 0; i < IN_END; i++)
{
if (result[i] != test_result[i])
{
main_result += 1;
}
- }
+ }*/
return main_result;
}