diff options
author | Steve Kondik <shade@chemlab.org> | 2014-07-25 05:33:22 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2014-07-25 05:33:22 -0700 |
commit | a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f (patch) | |
tree | a5d0d048e3976331e7001ed2eea256c67dc10b2a /include/share/replaygain_synthesis.h | |
parent | d3c04b5f963ef86e1aeb74656151f175aefa4c48 (diff) | |
download | android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.tar.gz android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.tar.bz2 android_external_flac-a05c01b7806ce0ff2b110ad36dbfe5727cb8cd4f.zip |
Upgrade to libFLAC 1.3.0cm-11.0-XNPH44S-bacon-5fa8c79c0bcm-11.0-XNPH05Q-tomato-9828f8e9cccm-11.0-XNPH05Q-bacon-5229c4ef56stable/cm-11.0-XNG3Cstable/cm-11.0-XNG2Sstable/cm-11.0-XNF9Xstable/cm-11.0-XNF8Ystable/cm-11.0shipping/cm-11.0
Change-Id: Ibd991640b7c85a96f4d1a43381acd199a6d197fd
Diffstat (limited to 'include/share/replaygain_synthesis.h')
-rw-r--r-- | include/share/replaygain_synthesis.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/include/share/replaygain_synthesis.h b/include/share/replaygain_synthesis.h new file mode 100644 index 0000000..bb8885c --- /dev/null +++ b/include/share/replaygain_synthesis.h @@ -0,0 +1,52 @@ +/* replaygain_synthesis - Routines for applying ReplayGain to a signal + * Copyright (C) 2002-2009 Josh Coalson + * Copyright (C) 2011-2013 Xiph.Org Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H +#define FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H + +#include <stdlib.h> /* for size_t */ +#include "FLAC/ordinals.h" + +#define FLAC_SHARE__MAX_SUPPORTED_CHANNELS 2 + +typedef enum { + NOISE_SHAPING_NONE = 0, + NOISE_SHAPING_LOW = 1, + NOISE_SHAPING_MEDIUM = 2, + NOISE_SHAPING_HIGH = 3 +} NoiseShaping; + +typedef struct { + const float* FilterCoeff; + FLAC__uint64 Mask; + double Add; + float Dither; + float ErrorHistory [FLAC_SHARE__MAX_SUPPORTED_CHANNELS] [16]; /* 16th order Noise shaping */ + float DitherHistory [FLAC_SHARE__MAX_SUPPORTED_CHANNELS] [16]; + int LastRandomNumber [FLAC_SHARE__MAX_SUPPORTED_CHANNELS]; + unsigned LastHistoryIndex; + NoiseShaping ShapingType; +} DitherContext; + +void FLAC__replaygain_synthesis__init_dither_context(DitherContext *dither, int bits, int shapingtype); + +/* scale = (float) pow(10., (double)replaygain * 0.05); */ +size_t FLAC__replaygain_synthesis__apply_gain(FLAC__byte *data_out, FLAC__bool little_endian_data_out, FLAC__bool unsigned_data_out, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, const unsigned source_bps, const unsigned target_bps, const double scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context); + +#endif |