Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
flac
Commits
1ba525b9
Commit
1ba525b9
authored
Sep 03, 2003
by
Josh Coalson
Browse files
fix rounding bug in buffer size calculation (MAX_SAMPLES_PER_WINDOW)
parent
bef021a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/share/gain_analysis/gain_analysis.c
View file @
1ba525b9
...
...
@@ -110,7 +110,13 @@ typedef signed int Int32_t;
#define MAX_dB 120.
/* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER)
#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME)
/* max. Samples per Time slice */
/* [JEC] the following was originally #defined as:
* (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME)
* but that seemed to fail to take into account the ceil() part of the
* sampleWindow calculation in ResetSampleFrequency(), and was causing
* buffer overflows for 48kHz analysis, hence the +1.
*/
#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.)
/* max. Samples per Time slice */
#define PINK_REF 64.82
/* 298640883795 */
/* calibration value */
static
Float_t
linprebuf
[
MAX_ORDER
*
2
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment