mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 01:49:53 +00:00
tests: Improvements to floating point tests
Two basic changes: * Increase DFT_DATA_LENGTH to 8192. * Fill the data to 5/6ths of the length instead of 1/2. The first is designed to catch errors in CAF/alac encoding when passed more than 4096 samples at a time. The second makes it easier to catch this kind os problem.
This commit is contained in:
parent
d87b2319b0
commit
55f0beddc6
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2015 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#define DFT_DATA_LENGTH (2048)
|
||||
#define DFT_DATA_LENGTH (8192)
|
||||
|
||||
double dft_cmp_float (int linenum, const float *orig, const float *test, int len, double tolerance, int allow_exit) ;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[+ AutoGen5 template h c +]
|
||||
/*
|
||||
** Copyright (C) 2002-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2015 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@ -214,13 +214,8 @@ gen_windowed_sine_[+ (get "name") +] ([+ (get "name") +] *data, int len, double
|
||||
{ int k ;
|
||||
|
||||
memset (data, 0, len * sizeof ([+ (get "name") +])) ;
|
||||
/*
|
||||
** Choose a frequency of 1/32 so that it aligns perfectly with a DFT
|
||||
** bucket to minimise spreading of energy over more than one bucket.
|
||||
** Also do not want to make the frequency too high as some of the
|
||||
** codecs (ie gsm610) have a quite severe high frequency roll off.
|
||||
*/
|
||||
len /= 2 ;
|
||||
|
||||
len = (5 * len) / 6 ;
|
||||
|
||||
for (k = 0 ; k < len ; k++)
|
||||
{ data [k] = sin (2.0 * k * M_PI * 1.0 / 32.0 + 0.4) ;
|
||||
|
Loading…
Reference in New Issue
Block a user