annotate src/flac112/replaygain_analysis.h @ 540:62c4c304a997 trunk

[svn] - handle OV_HOLE gracefully
author nenolod
date Tue, 23 Jan 2007 06:25:58 -0800
parents 4b31176c198a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
1 /*
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
2 * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
3 * Copyright (C) 2001 David Robinson and Glen Sawyer
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
4 *
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
8 * version 2.1 of the License, or (at your option) any later version.
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
9 *
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
13 * Lesser General Public License for more details.
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
14 *
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
18 *
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
19 * concept and filter values by David Robinson (David@Robinson.org)
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
20 * -- blame him if you think the idea is flawed
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
21 * coding by Glen Sawyer (glensawyer@hotmail.com) 442 N 700 E, Provo, UT 84606 USA
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
22 * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
23 * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
24 *
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
25 * For an explanation of the concepts and the basic algorithms involved, go to:
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
26 * http://www.replaygain.org/
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
27 */
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
28
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
29 #ifndef GAIN_ANALYSIS_H
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
30 #define GAIN_ANALYSIS_H
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
31
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
32 #include <stddef.h>
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
33
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
34 #define GAIN_NOT_ENOUGH_SAMPLES -24601
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
35 #define GAIN_ANALYSIS_ERROR 0
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
36 #define GAIN_ANALYSIS_OK 1
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
37
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
38 #define INIT_GAIN_ANALYSIS_ERROR 0
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
39 #define INIT_GAIN_ANALYSIS_OK 1
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
40
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
41 #ifdef __cplusplus
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
42 extern "C" {
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
43 #endif
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
44
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
45 typedef float Float_t; /* Type used for filtering */
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
46
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
47 int InitGainAnalysis ( long samplefreq );
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
48 int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
49 int ResetSampleFrequency ( long samplefreq );
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
50 Float_t GetTitleGain ( void );
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
51 Float_t GetAlbumGain ( void );
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
52
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
53 #ifdef __cplusplus
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
54 }
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
55 #endif
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
56
4b31176c198a [svn] - 1.1.2 compatible plugin (I HATE YOU FLAC PEOPLE)
nenolod
parents:
diff changeset
57 #endif /* GAIN_ANALYSIS_H */