• Home
  • Raw
  • Download

Lines Matching refs:k

46 static	int		decay_response (int k) ;
79 int k, m, *orig, *data ; in lcomp_test_int() local
97 for (k = 0 ; k < datalen ; k++) in lcomp_test_int()
98 orig [k] = orig_buffer.d [k] ; in lcomp_test_int()
112 if ((k = sf_writef_int (file, orig, datalen)) != datalen) in lcomp_test_int()
113 { printf ("sf_writef_int failed with short write (%" PRId64 " => %d).\n", datalen, k) ; in lcomp_test_int()
151 if ((k = sf_readf_int (file, data, datalen)) != datalen) in lcomp_test_int()
152 { printf ("Line %d: short read (%d should be %" PRId64 ").\n", __LINE__, k, datalen) ; in lcomp_test_int()
157 for (k = 0 ; k < datalen ; k++) in lcomp_test_int()
158 { if (error_function (data [k] / scale, orig [k] / scale, margin)) in lcomp_test_int()
159 …e %d: Incorrect sample (#%d : %f should be %f).\n", __LINE__, k, data [k] / scale, orig [k] / scal… in lcomp_test_int()
163 sum_abs += abs (data [k]) ; in lcomp_test_int()
171 if ((k = sf_readf_int (file, data, datalen)) != sfinfo.frames - datalen) in lcomp_test_int()
172 …e %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, sfinfo.frames - datalen, k) ; in lcomp_test_int()
180 for (k = 0 ; k < sfinfo.frames - datalen ; k++) in lcomp_test_int()
181 if (ABS (data [k] / scale) > decay_response (k)) in lcomp_test_int()
182 …ncorrect sample B (#%d : abs (%d) should be < %d).\n", __LINE__, k, data [k], decay_response (k)) ; in lcomp_test_int()
193 if ((k = sf_seek (file, 0, SEEK_SET)) != 0) in lcomp_test_int()
194 { printf ("Line %d: Seek to start of file failed (%d).\n", __LINE__, k) ; in lcomp_test_int()
201 if ((k = sf_readf_int (file, data, 11)) != 11) in lcomp_test_int()
202 { printf ("Line %d: Incorrect read length (11 => %d).\n", __LINE__, k) ; in lcomp_test_int()
206 for (k = 0 ; k < 11 ; k++) in lcomp_test_int()
207 if (error_function (data [k] / scale, orig [k + m * 11] / scale, margin)) in lcomp_test_int()
208 …rrect sample (m = %d) (#%d : %d => %d).\n", __LINE__, m, k + m * 11, orig [k + m * 11], data [k]) ; in lcomp_test_int()
219 if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) in lcomp_test_int()
220 { printf ("Seek to start of file + %" PRId64 " failed (%d).\n", seekpos, k) ; in lcomp_test_int()
224 if ((k = sf_readf_int (file, data, 1)) != 1) in lcomp_test_int()
225 { printf ("Line %d: sf_readf_int (file, data, 1) returned %d.\n", __LINE__, k) ; in lcomp_test_int()
234 if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) in lcomp_test_int()
235 … sf_seek (SEEK_CUR) with 0 offset failed (%d should be %" PRId64 ")\n", __LINE__, k, seekpos + 1) ; in lcomp_test_int()
240 k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; in lcomp_test_int()
242 if (error_function ((double) data [0], (double) orig [seekpos], margin) || k != seekpos) in lcomp_test_int()
243 …df_int failed (%d, %d) (%d, %" PRId64 ").\n", __LINE__, data [0], orig [seekpos], k, seekpos + 1) ; in lcomp_test_int()
249 k = sf_seek (file, -20, SEEK_CUR) ; in lcomp_test_int()
251 if (error_function ((double) data [0], (double) orig [seekpos], margin) || k != seekpos) in lcomp_test_int()
252 …owed by sf_readf_int failed (%d, %d) (%d, %" PRId64 ").\n", data [0], orig [seekpos], k, seekpos) ; in lcomp_test_int()
259 if ((k = sf_readf_int (file, data, datalen)) != 0) in lcomp_test_int()
260 …rintf ("Line %d: Return value from sf_readf_int past end of file incorrect (%d).\n", __LINE__, k) ; in lcomp_test_int()
265 if ((k = sf_seek (file, 5 - (int) sfinfo.frames, SEEK_END)) != 5) in lcomp_test_int()
266 { printf ("sf_seek (SEEK_END) returned %d instead of %d.\n", k, 5) ; in lcomp_test_int()
289 decay_response (int k) in decay_response() argument
290 { if (k < 1) in decay_response()
292 if (k > DECAY_COUNT) in decay_response()
294 return (int) (1.2 * SIGNAL_MAXVAL * (DECAY_COUNT - k) / (1.0 * DECAY_COUNT)) ; in decay_response()
299 { int k, ramplen ; in gen_signal_double() local
304 for (k = 0 ; k < datalen ; k++) in gen_signal_double()
305 { if (k <= ramplen) in gen_signal_double()
306 amp = scale * k / ((double) ramplen) ; in gen_signal_double()
307 else if (k > datalen - ramplen) in gen_signal_double()
308 amp = scale * (datalen - k) / ((double) ramplen) ; in gen_signal_double()
310 data [k] = amp * (0.4 * sin (33.3 * 2.0 * M_PI * ((double) (k + 1)) / ((double) SAMPLE_RATE)) in gen_signal_double()
311 + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k + 1)) / ((double) SAMPLE_RATE))) ; in gen_signal_double()