add undocumented option --apply-replaygain-which-is-not-lossless to flac; required a lot of reorganization; gain_analysis lib renamed to replaygain_analyis; replaygain_synthesis moved out of plugin_common into its own library in share/

This commit is contained in:
Josh Coalson 2003-12-17 04:51:06 +00:00
parent 628f4efc55
commit 9c650a561a
56 changed files with 481 additions and 206 deletions

View File

@ -48,7 +48,10 @@ Package=<4>
Project_Dep_Name grabbag_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name gain_analysis_static
Project_Dep_Name replaygain_analysis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name replaygain_synthesis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name getopt_static
@ -132,7 +135,10 @@ Package=<4>
Project_Dep_Name grabbag_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name gain_analysis_static
Project_Dep_Name replaygain_analysis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name replaygain_synthesis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name getopt_static
@ -189,7 +195,10 @@ Package=<4>
Project_Dep_Name grabbag_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name gain_analysis_static
Project_Dep_Name replaygain_analysis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name replaygain_synthesis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name getopt_static
@ -231,7 +240,19 @@ Package=<4>
###############################################################################
Project: "gain_analysis_static"=.\src\share\gain_analysis\gain_analysis_static.dsp - Package Owner=<4>
Project: "replaygain_analysis_static"=.\src\share\replaygain_analysis\replaygain_analysis_static.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "replaygain_synthesis_static"=.\src\share\replaygain_synthesis\replaygain_synthesis_static.dsp - Package Owner=<4>
Package=<5>
{{{
@ -267,7 +288,7 @@ Package=<4>
Project_Dep_Name libFLAC_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name gain_analysis_static
Project_Dep_Name replaygain_analysis_static
End Project Dependency
}}}
@ -420,7 +441,7 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name gain_analysis_static
Project_Dep_Name replaygain_analysis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name getopt_static
@ -446,6 +467,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name replaygain_synthesis_static
End Project Dependency
Begin Project Dependency
Project_Dep_Name libFLAC_static
End Project Dependency

View File

@ -19,7 +19,7 @@
# instead of FLAC__ since autoconf triggers off 'AC_' in strings
AC_INIT(src/flac/main.c)
AM_INIT_AUTOMAKE(flac, 1.1.0)
AM_INIT_AUTOMAKE(flac, CVS-20031217)
# Don't automagically regenerate autoconf/automake generated files unless
# explicitly requested. Eases autobuilding -mdz
@ -361,9 +361,10 @@ AC_OUTPUT( \
src/plugin_winamp3/Makefile \
src/plugin_xmms/Makefile \
src/share/Makefile \
src/share/gain_analysis/Makefile \
src/share/getopt/Makefile \
src/share/grabbag/Makefile \
src/share/replaygain_analysis/Makefile \
src/share/replaygain_synthesis/Makefile \
src/share/utf8/Makefile \
src/test_grabbag/Makefile \
src/test_grabbag/cuesheet/Makefile \

View File

@ -5,7 +5,8 @@ AUTOMAKE_OPTIONS = foreign
SUBDIRS = grabbag
EXTRA_DIST = \
gain_analysis.h \
getopt.h \
grabbag.h \
replaygain_analysis.h \
replaygain_synthesis.h \
utf8.h

View File

@ -17,7 +17,7 @@
*/
/*
* This wraps the gain_analysis lib, which is LGPL. This wrapper
* This wraps the replaygain_analysis lib, which is LGPL. This wrapper
* allows analysis of different input resolutions by automatically
* scaling the input signal
*/

View File

@ -16,16 +16,18 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FLAC__PLUGIN_COMMON__REPLAYGAIN_SYNTHESIS_H
#define FLAC__PLUGIN_COMMON__REPLAYGAIN_SYNTHESIS_H
#ifndef FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H
#define FLAC__SHARE__REPLAYGAIN_SYNTHESIS_H
#include "defs.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_MEDUIM = 2,
NOISE_SHAPING_MEDIUM = 2,
NOISE_SHAPING_HIGH = 3
} NoiseShaping;
@ -34,16 +36,16 @@ typedef struct {
FLAC__uint64 Mask;
double Add;
float Dither;
float ErrorHistory [FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS] [16]; /* 16th order Noise shaping */
float DitherHistory [FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS] [16];
int LastRandomNumber [FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS];
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__plugin_common__init_dither_context(DitherContext *dither, int bits, int shapingtype);
void FLAC__replaygain_synthesis__init_dither_context(DitherContext *dither, int bits, int shapingtype);
/* scale = (float) pow(10., (double)replaygain * 0.05); */
int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endian_data_out, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, const unsigned source_bps, const unsigned target_bps, const float scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context);
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 float scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context);
#endif

View File

@ -44,8 +44,9 @@ flac_SOURCES = \
flac_LDADD = \
$(NEED_OGGFLAC_LIB) \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \

View File

@ -24,16 +24,16 @@ topdir = ../..
PROGRAM_NAME = flac
ifeq ($(DARWIN_BUILD),yes)
INCLUDES = -I./include -I$(topdir)/include
LIBS = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lc -lm
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -lc -lm
else
#@@@ TODO: conditionalize ogg includes, defines, and -logg
ifeq ($(SOLARIS_BUILD),yes)
INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
LIBS = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
LIBS = -lgrabbag -lOggFLAC -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
else
#@@@ TODO: conditionalize ogg includes, defines, and -logg
INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
LIBS = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
LIBS = -lgrabbag -lOggFLAC -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
endif
endif

View File

@ -31,6 +31,7 @@
#include <string.h> /* for strcmp() */
#include "FLAC/all.h"
#include "share/grabbag.h"
#include "share/replaygain_synthesis.h"
#include "decode.h"
#ifdef FLAC__HAS_OGG
@ -46,6 +47,13 @@ typedef struct {
FLAC__bool is_aiff_out;
FLAC__bool is_wave_out;
FLAC__bool continue_through_decode_errors;
struct {
replaygain_synthesis_spec_t spec;
double scale;
DitherContext dither_context;
} replaygain;
FLAC__bool test_only;
FLAC__bool analysis_mode;
analysis_options aopts;
@ -97,7 +105,7 @@ static FLAC__bool is_big_endian_host_;
/*
* local routines
*/
static FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool verbose, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool continue_through_decode_errors, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, const char *infilename, const char *outfilename);
static FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool verbose, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool continue_through_decode_errors, replaygain_synthesis_spec_t replaygain_synthesis_spec, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, const char *infilename, const char *outfilename);
static void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred);
static FLAC__bool DecoderSession_init_decoder(DecoderSession *d, decode_options_t decode_options, const char *infilename);
static FLAC__bool DecoderSession_process(DecoderSession *d);
@ -144,6 +152,7 @@ int flac__decode_aiff(const char *infilename, const char *outfilename, FLAC__boo
/*is_aiff_out=*/true,
/*is_wave_out=*/false,
options.common.continue_through_decode_errors,
options.common.replaygain_synthesis_spec,
analysis_mode,
aopts,
&options.common.skip_specification,
@ -179,6 +188,7 @@ int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool
/*is_aiff_out=*/false,
/*is_wave_out=*/true,
options.common.continue_through_decode_errors,
options.common.replaygain_synthesis_spec,
analysis_mode,
aopts,
&options.common.skip_specification,
@ -217,6 +227,7 @@ int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool
/*is_aiff_out=*/false,
/*is_wave_out=*/false,
options.common.continue_through_decode_errors,
options.common.replaygain_synthesis_spec,
analysis_mode,
aopts,
&options.common.skip_specification,
@ -236,7 +247,7 @@ int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool
return DecoderSession_finish_ok(&decoder_session);
}
FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool verbose, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool continue_through_decode_errors, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, const char *infilename, const char *outfilename)
FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool verbose, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool continue_through_decode_errors, replaygain_synthesis_spec_t replaygain_synthesis_spec, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, const char *infilename, const char *outfilename)
{
#ifdef FLAC__HAS_OGG
d->is_ogg = is_ogg;
@ -248,6 +259,9 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
d->is_aiff_out = is_aiff_out;
d->is_wave_out = is_wave_out;
d->continue_through_decode_errors = continue_through_decode_errors;
d->replaygain.spec = replaygain_synthesis_spec;
d->replaygain.scale = 0.0;
/* d->replaygain.dither_context gets initialized later once we know the sample resolution */
d->test_only = (0 == outfilename);
d->analysis_mode = analysis_mode;
d->aopts = aopts;
@ -338,6 +352,8 @@ FLAC__bool DecoderSession_init_decoder(DecoderSession *decoder_session, decode_o
if(!decode_options.use_first_serial_number)
OggFLAC__stream_decoder_set_serial_number(decoder_session->decoder.ogg.stream, decode_options.serial_number);
if (decoder_session->replaygain.spec.apply)
OggFLAC__stream_decoder_set_metadata_respond(decoder_session->decoder.ogg.stream, FLAC__METADATA_TYPE_VORBIS_COMMENT);
OggFLAC__stream_decoder_set_read_callback(decoder_session->decoder.ogg.stream, read_callback);
/*
@ -369,6 +385,8 @@ FLAC__bool DecoderSession_init_decoder(DecoderSession *decoder_session, decode_o
FLAC__file_decoder_set_md5_checking(decoder_session->decoder.flac.file, true);
FLAC__file_decoder_set_filename(decoder_session->decoder.flac.file, infilename);
if (decoder_session->replaygain.spec.apply)
FLAC__file_decoder_set_metadata_respond(decoder_session->decoder.flac.file, FLAC__METADATA_TYPE_VORBIS_COMMENT);
/*
* The three ugly casts here are to 'downcast' the 'void *' argument of
* the callback down to 'FLAC__FileDecoder *'.
@ -800,7 +818,25 @@ FLAC__StreamDecoderWriteStatus write_callback(const void *decoder, const FLAC__F
flac__analyze_frame(frame, decoder_session->frame_counter-1, decoder_session->aopts, fout);
}
else if(!decoder_session->test_only) {
if(bps == 8) {
if (decoder_session->replaygain.spec.apply) {
const size_t n = FLAC__replaygain_synthesis__apply_gain(
u8buffer,
is_big_endian,
is_unsigned_samples,
buffer,
wide_samples,
channels,
bps, /* source_bps */
bps, /* target_bps */
decoder_session->replaygain.scale,
decoder_session->replaygain.spec.limiter == RGSS_LIMIT__HARD, /* hard_limit */
decoder_session->replaygain.spec.noise_shaping != NOISE_SHAPING_NONE, /* do_dithering */
&decoder_session->replaygain.dither_context
);
if(flac__utils_fwrite(u8buffer, 1, n, fout) != n)
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
else if(bps == 8) {
if(is_unsigned_samples) {
for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++)
for(channel = 0; channel < channels; channel++, sample++)
@ -1047,6 +1083,23 @@ void metadata_callback(const void *decoder, const FLAC__StreamMetadata *metadata
}
}
}
else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
if (decoder_session->replaygain.spec.apply) {
double gain, peak;
if (!(decoder_session->replaygain.spec.apply = grabbag__replaygain_load_from_vorbiscomment(metadata, decoder_session->replaygain.spec.use_album_gain, &gain, &peak))) {
fprintf(stderr, "%s: WARNING: can't get %s ReplayGain tag\n", decoder_session->inbasefilename, decoder_session->replaygain.spec.use_album_gain? "album":"track");
}
else {
const char *ls[] = { "no", "peak", "hard" };
const char *ns[] = { "no", "low", "medium", "high" };
decoder_session->replaygain.scale = grabbag__replaygain_compute_scale_factor(peak, gain, decoder_session->replaygain.spec.preamp, decoder_session->replaygain.spec.limiter == RGSS_LIMIT__PEAK);
assert(decoder_session->bps > 0 && decoder_session->bps <= 32);
FLAC__replaygain_synthesis__init_dither_context(&decoder_session->replaygain.dither_context, decoder_session->bps, decoder_session->replaygain.spec.noise_shaping);
fprintf(stderr, "%s: INFO: applying %s ReplayGain (gain=%0.2fdB+preamp=%0.1fdB, %s noise shaping, %s limiting) to output\n", decoder_session->inbasefilename, decoder_session->replaygain.spec.use_album_gain? "album":"track", gain, decoder_session->replaygain.spec.preamp, ns[decoder_session->replaygain.spec.noise_shaping], ls[decoder_session->replaygain.spec.limiter]);
fprintf(stderr, "%s: WARNING: applying ReplayGain is not lossless\n", decoder_session->inbasefilename);
}
}
}
}
void error_callback(const void *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)

View File

@ -21,14 +21,24 @@
#include "analyze.h"
#include "utils.h"
#include "share/replaygain_synthesis.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef struct {
FLAC__bool apply;
FLAC__bool use_album_gain; /* false => use track gain */
enum { RGSS_LIMIT__NONE, RGSS_LIMIT__PEAK, RGSS_LIMIT__HARD} limiter;
NoiseShaping noise_shaping;
double preamp;
} replaygain_synthesis_spec_t;
typedef struct {
FLAC__bool verbose;
FLAC__bool continue_through_decode_errors;
replaygain_synthesis_spec_t replaygain_synthesis_spec;
#ifdef FLAC__HAS_OGG
FLAC__bool is_ogg;
FLAC__bool use_first_serial_number;

View File

@ -1825,6 +1825,8 @@ void ogg_stream_encoder_metadata_callback(const OggFLAC__StreamEncoder *encoder,
void ogg_file_encoder_progress_callback(const OggFLAC__FileEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data)
{
(void)encoder;
flac_file_encoder_progress_callback(0, bytes_written, samples_written, frames_written, total_frames_estimate, client_data);
}

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\replaygain_synthesis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "flac - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\replaygain_synthesis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -85,103 +85,104 @@ static struct share__option long_options_[] = {
/*
* general options
*/
{ "help", 0, 0, 'h' },
{ "explain", 0, 0, 'H' },
{ "version", 0, 0, 'v' },
{ "decode", 0, 0, 'd' },
{ "analyze", 0, 0, 'a' },
{ "test", 0, 0, 't' },
{ "stdout", 0, 0, 'c' },
{ "silent", 0, 0, 's' },
{ "delete-input-file", 0, 0, 0 },
{ "output-prefix", 1, 0, 0 },
{ "output-name", 1, 0, 'o' },
{ "skip", 1, 0, 0 },
{ "until", 1, 0, 0 },
{ "help" , share__no_argument, 0, 'h' },
{ "explain" , share__no_argument, 0, 'H' },
{ "version" , share__no_argument, 0, 'v' },
{ "decode" , share__no_argument, 0, 'd' },
{ "analyze" , share__no_argument, 0, 'a' },
{ "test" , share__no_argument, 0, 't' },
{ "stdout" , share__no_argument, 0, 'c' },
{ "silent" , share__no_argument, 0, 's' },
{ "delete-input-file", share__no_argument, 0, 0 },
{ "output-prefix" , share__required_argument, 0, 0 },
{ "output-name" , share__required_argument, 0, 'o' },
{ "skip" , share__required_argument, 0, 0 },
{ "until" , share__required_argument, 0, 0 },
/*
* decoding options
*/
{ "decode-through-errors", 0, 0, 'F' },
{ "decode-through-errors", share__no_argument, 0, 'F' },
{ "apply-replaygain-which-is-not-lossless", share__optional_argument, 0, 0 }, /* undocumented */
/*
* encoding options
*/
{ "cuesheet", 1, 0, 0 },
{ "no-cued-seekpoints", 0, 0, 0 },
{ "tag", 1, 0, 'T' },
{ "compression-level-0", 0, 0, '0' },
{ "compression-level-1", 0, 0, '1' },
{ "compression-level-2", 0, 0, '2' },
{ "compression-level-3", 0, 0, '3' },
{ "compression-level-4", 0, 0, '4' },
{ "compression-level-5", 0, 0, '5' },
{ "compression-level-6", 0, 0, '6' },
{ "compression-level-7", 0, 0, '7' },
{ "compression-level-8", 0, 0, '8' },
{ "compression-level-9", 0, 0, '9' },
{ "best", 0, 0, '8' },
{ "fast", 0, 0, '0' },
{ "super-secret-totally-impractical-compression-level", 0, 0, 0 },
{ "verify", 0, 0, 'V' },
{ "force-aiff-format", 0, 0, 0 },
{ "force-raw-format", 0, 0, 0 },
{ "lax", 0, 0, 0 },
{ "replay-gain", 0, 0, 0 },
{ "sector-align", 0, 0, 0 },
{ "seekpoint", 1, 0, 'S' },
{ "padding", 1, 0, 'P' },
{ "cuesheet" , share__required_argument, 0, 0 },
{ "no-cued-seekpoints" , share__no_argument, 0, 0 },
{ "tag" , share__required_argument, 0, 'T' },
{ "compression-level-0" , share__no_argument, 0, '0' },
{ "compression-level-1" , share__no_argument, 0, '1' },
{ "compression-level-2" , share__no_argument, 0, '2' },
{ "compression-level-3" , share__no_argument, 0, '3' },
{ "compression-level-4" , share__no_argument, 0, '4' },
{ "compression-level-5" , share__no_argument, 0, '5' },
{ "compression-level-6" , share__no_argument, 0, '6' },
{ "compression-level-7" , share__no_argument, 0, '7' },
{ "compression-level-8" , share__no_argument, 0, '8' },
{ "compression-level-9" , share__no_argument, 0, '9' },
{ "best" , share__no_argument, 0, '8' },
{ "fast" , share__no_argument, 0, '0' },
{ "super-secret-totally-impractical-compression-level", share__no_argument, 0, 0 },
{ "verify" , share__no_argument, 0, 'V' },
{ "force-aiff-format" , share__no_argument, 0, 0 },
{ "force-raw-format" , share__no_argument, 0, 0 },
{ "lax" , share__no_argument, 0, 0 },
{ "replay-gain" , share__no_argument, 0, 0 },
{ "sector-align" , share__no_argument, 0, 0 },
{ "seekpoint" , share__required_argument, 0, 'S' },
{ "padding" , share__required_argument, 0, 'P' },
#ifdef FLAC__HAS_OGG
{ "ogg", 0, 0, 0 },
{ "serial-number", 1, 0, 0 },
{ "ogg" , share__no_argument, 0, 0 },
{ "serial-number" , share__required_argument, 0, 0 },
#endif
{ "blocksize", 1, 0, 'b' },
{ "exhaustive-model-search", 0, 0, 'e' },
{ "max-lpc-order", 1, 0, 'l' },
{ "mid-side", 0, 0, 'm' },
{ "adaptive-mid-side", 0, 0, 'M' },
{ "qlp-coeff-precision-search", 0, 0, 'p' },
{ "qlp-coeff-precision", 1, 0, 'q' },
{ "rice-partition-order", 1, 0, 'r' },
{ "endian", 1, 0, 0 },
{ "channels", 1, 0, 0 },
{ "bps", 1, 0, 0 },
{ "sample-rate", 1, 0, 0 },
{ "sign", 1, 0, 0 },
{ "blocksize" , share__required_argument, 0, 'b' },
{ "exhaustive-model-search" , share__no_argument, 0, 'e' },
{ "max-lpc-order" , share__required_argument, 0, 'l' },
{ "mid-side" , share__no_argument, 0, 'm' },
{ "adaptive-mid-side" , share__no_argument, 0, 'M' },
{ "qlp-coeff-precision-search", share__no_argument, 0, 'p' },
{ "qlp-coeff-precision" , share__required_argument, 0, 'q' },
{ "rice-partition-order" , share__required_argument, 0, 'r' },
{ "endian" , share__required_argument, 0, 0 },
{ "channels" , share__required_argument, 0, 0 },
{ "bps" , share__required_argument, 0, 0 },
{ "sample-rate" , share__required_argument, 0, 0 },
{ "sign" , share__required_argument, 0, 0 },
/*
* analysis options
*/
{ "residual-gnu-plot", 0, 0, 0 },
{ "residual-text", 0, 0, 0 },
{ "residual-gnu-plot", share__no_argument, 0, 0 },
{ "residual-text", share__no_argument, 0, 0 },
/*
* negatives
*/
{ "no-decode-through-errors", 0, 0, 0 },
{ "no-silent", 0, 0, 0 },
{ "no-seektable", 0, 0, 0 },
{ "no-delete-input-file", 0, 0, 0 },
{ "no-replay-gain", 0, 0, 0 },
{ "no-sector-align", 0, 0, 0 },
{ "no-lax", 0, 0, 0 },
{ "no-decode-through-errors" , share__no_argument, 0, 0 },
{ "no-silent" , share__no_argument, 0, 0 },
{ "no-seektable" , share__no_argument, 0, 0 },
{ "no-delete-input-file" , share__no_argument, 0, 0 },
{ "no-replay-gain" , share__no_argument, 0, 0 },
{ "no-sector-align" , share__no_argument, 0, 0 },
{ "no-lax" , share__no_argument, 0, 0 },
#ifdef FLAC__HAS_OGG
{ "no-ogg", 0, 0, 0 },
{ "no-ogg" , share__no_argument, 0, 0 },
#endif
{ "no-exhaustive-model-search", 0, 0, 0 },
{ "no-mid-side", 0, 0, 0 },
{ "no-adaptive-mid-side", 0, 0, 0 },
{ "no-qlp-coeff-prec-search", 0, 0, 0 },
{ "no-padding", 0, 0, 0 },
{ "no-verify", 0, 0, 0 },
{ "no-residual-gnuplot", 0, 0, 0 },
{ "no-residual-text", 0, 0, 0 },
{ "no-exhaustive-model-search", share__no_argument, 0, 0 },
{ "no-mid-side" , share__no_argument, 0, 0 },
{ "no-adaptive-mid-side" , share__no_argument, 0, 0 },
{ "no-qlp-coeff-prec-search" , share__no_argument, 0, 0 },
{ "no-padding" , share__no_argument, 0, 0 },
{ "no-verify" , share__no_argument, 0, 0 },
{ "no-residual-gnuplot" , share__no_argument, 0, 0 },
{ "no-residual-text" , share__no_argument, 0, 0 },
/*
* undocumented debugging options for the test suite
*/
{ "disable-constant-subframes", 0, 0, 0 },
{ "disable-fixed-subframes", 0, 0, 0 },
{ "disable-verbatim-subframes", 0, 0, 0 },
{ "disable-constant-subframes", share__no_argument, 0, 0 },
{ "disable-fixed-subframes" , share__no_argument, 0, 0 },
{ "disable-verbatim-subframes", share__no_argument, 0, 0 },
{0, 0, 0, 0}
};
@ -199,6 +200,7 @@ static struct {
FLAC__bool verify;
FLAC__bool verbose;
FLAC__bool continue_through_decode_errors;
replaygain_synthesis_spec_t replaygain_synthesis_spec;
FLAC__bool lax;
FLAC__bool test_only;
FLAC__bool analyze;
@ -520,6 +522,11 @@ FLAC__bool init_options()
option_values.verify = false;
option_values.verbose = true;
option_values.continue_through_decode_errors = false;
option_values.replaygain_synthesis_spec.apply = false;
option_values.replaygain_synthesis_spec.use_album_gain = true;
option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__HARD;
option_values.replaygain_synthesis_spec.noise_shaping = NOISE_SHAPING_LOW;
option_values.replaygain_synthesis_spec.preamp = 0.0;
option_values.lax = false;
option_values.test_only = false;
option_values.analyze = false;
@ -635,6 +642,31 @@ int parse_option(int short_option, const char *long_option, const char *option_a
FLAC__ASSERT(0 != option_argument);
option_values.until_specification = option_argument;
}
else if(0 == strcmp(long_option, "apply-replaygain-which-is-not-lossless")) {
option_values.replaygain_synthesis_spec.apply = true;
if (0 != option_argument) {
char *p;
option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__NONE;
option_values.replaygain_synthesis_spec.noise_shaping = NOISE_SHAPING_NONE;
option_values.replaygain_synthesis_spec.preamp = strtod(option_argument, &p);
for ( ; *p; p++) {
if (*p == 'a')
option_values.replaygain_synthesis_spec.use_album_gain = true;
else if (*p == 't')
option_values.replaygain_synthesis_spec.use_album_gain = false;
else if (*p == 'l')
option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__PEAK;
else if (*p == 'L')
option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__HARD;
else if (*p == 'n' && p[1] >= '0' && p[1] <= '3') {
option_values.replaygain_synthesis_spec.noise_shaping = p[1] - '0';
p++;
}
else
return usage_error("ERROR: bad specification string \"%s\" for --%s\n", option_argument, long_option);
}
}
}
else if(0 == strcmp(long_option, "cuesheet")) {
FLAC__ASSERT(0 != option_argument);
option_values.cuesheet_filename = option_argument;
@ -1570,6 +1602,7 @@ int decode_file(const char *infilename)
common_options.verbose = option_values.verbose;
common_options.continue_through_decode_errors = option_values.continue_through_decode_errors;
common_options.replaygain_synthesis_spec = option_values.replaygain_synthesis_spec;
#ifdef FLAC__HAS_OGG
common_options.is_ogg = treat_as_ogg;
common_options.use_first_serial_number = !option_values.has_serial_number;

View File

@ -1,6 +1,8 @@
/* flac - Command-line FLAC encoder/decoder
*/
#include <string.h>
#include "utils.h"
/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $

View File

@ -40,7 +40,7 @@ metaflac_LDFLAGS =
metaflac_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \

View File

@ -23,7 +23,7 @@ topdir = ../..
PROGRAM_NAME = metaflac
INCLUDES = -I./include -I$(topdir)/include
LIBS = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lm
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -lm
SRCS_C = \
main.c \

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "metaflac - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -2,8 +2,6 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = include .
INCLUDES = -I$(top_srcdir)/include @ID3LIB_CFLAGS@
noinst_LTLIBRARIES = libplugin_common.la
@ -17,7 +15,6 @@ noinst_HEADERS = \
id3v1.h \
id3v2.h \
locale_hack.h \
replaygain_synthesis.h \
vorbiscomment.h
libplugin_common_la_SOURCES = \
@ -26,7 +23,6 @@ libplugin_common_la_SOURCES = \
dither.c \
id3v1.c \
id3v2.c \
replaygain_synthesis.c \
vorbiscomment.c
EXTRA_DIST = \

View File

@ -5,7 +5,7 @@
topdir = ../..
LIB_NAME = libplugin_common
INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include
INCLUDES = -I$(topdir)/include -I$(HOME)/local/include
DEFINES = -DFLAC__HAS_ID3LIB -DID3LIB_MAJOR=3 -DID3LIB_MINOR=8 -DID3LIB_PATCH=0
SRCS_C = \
@ -14,7 +14,6 @@ SRCS_C = \
dither.c \
id3v1.c \
id3v2.c \
replaygain_synthesis.c \
vorbiscomment.c
include $(topdir)/build/lib.mk

View File

@ -25,7 +25,6 @@
#include "id3v1.h"
#include "id3v2.h"
#include "locale_hack.h"
#include "replaygain_synthesis.h"
#include "vorbiscomment.h"
#endif

View File

@ -105,10 +105,6 @@ SOURCE=.\id3v2.c
# End Source File
# Begin Source File
SOURCE=.\replaygain_synthesis.c
# End Source File
# Begin Source File
SOURCE=.\vorbiscomment.c
# End Source File
# End Group
@ -153,10 +149,6 @@ SOURCE=.\locale_hack.h
# End Source File
# Begin Source File
SOURCE=.\replaygain_synthesis.h
# End Source File
# Begin Source File
SOURCE=.\vorbiscomment.h
# End Source File
# End Group

View File

@ -26,6 +26,7 @@
#include "FLAC/all.h"
#include "plugin_common/all.h"
#include "share/grabbag.h"
#include "share/replaygain_synthesis.h"
#include "config.h"
#include "infobox.h"
#include "tagz.h"
@ -151,7 +152,7 @@ int play(char *fn)
cfg.resolution.normal.dither_24_to_16 ? min(file_info_.bits_per_sample, 16) : file_info_.bits_per_sample;
if (file_info_.has_replaygain && cfg.replaygain.enable && cfg.resolution.replaygain.dither)
FLAC__plugin_common__init_dither_context(&file_info_.dither_context, file_info_.bits_per_sample, cfg.resolution.replaygain.noise_shaping);
FLAC__replaygain_synthesis__init_dither_context(&file_info_.dither_context, file_info_.bits_per_sample, cfg.resolution.replaygain.noise_shaping);
maxlatency = mod_.outMod->Open(file_info_.sample_rate, file_info_.channels, file_info_.output_bits_per_sample, -1, -1);
if (maxlatency < 0) /* error opening device */
@ -354,9 +355,10 @@ static DWORD WINAPI DecodeThread(void *unused)
unsigned i;
if(cfg.replaygain.enable && file_info_.has_replaygain) {
bytes = (int)FLAC__plugin_common__apply_gain(
bytes = (int)FLAC__replaygain_synthesis__apply_gain(
sample_buffer_,
true, /* little_endian_data_out */
target_bps == 8, /* unsigned_data_out */
reservoir_,
n,
channels,

View File

@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib gain_analysis_static.lib kernel32.lib user32.lib /nologo /dll /machine:I386 /out:"../../obj/release/bin/in_flac.dll" /libpath:"../../obj/release/lib" /opt:nowin98
# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /machine:I386 /out:"../../obj/release/bin/in_flac.dll" /libpath:"../../obj/release/lib" /opt:nowin98
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "in_flac - Win32 Debug"
@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib gain_analysis_static.lib kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /out:"../../obj/debug/bin/in_flac.dll" /pdbtype:sept /libpath:"../../obj/debug/lib"
# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /out:"../../obj/debug/bin/in_flac.dll" /pdbtype:sept /libpath:"../../obj/debug/lib"
# SUBTRACT LINK32 /pdb:none
!ENDIF

View File

@ -59,7 +59,8 @@ endif
libxmms_flac_la_LIBADD = \
$(top_builddir)/src/plugin_common/libplugin_common.la \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
-L$(top_builddir)/src/libFLAC/.libs \

View File

@ -24,7 +24,7 @@ topdir = ../..
LIB_NAME = libxmms-flac
INCLUDES = $(shell xmms-config --cflags) -I./include -I$(topdir)/include -I..
# refer to the static libs explicitly
LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libgain_analysis.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
SRCS_C = \
charset.c \

View File

@ -35,6 +35,7 @@
#include <xmms/plugin.h>
#include "plugin_common/locale_hack.h"
#include "share/replaygain_synthesis.h" /* for NOISE_SHAPING_LOW */
#include "charset.h"
#include "configure.h"
@ -68,7 +69,7 @@ flac_config_t flac_cfg = {
/* replaygain */
{
TRUE, /* dither */
1, /* noise_shaping */
NOISE_SHAPING_LOW, /* noise_shaping */
16 /* bps_out */
}
}

View File

@ -38,6 +38,7 @@
#include "FLAC/all.h"
#include "plugin_common/all.h"
#include "share/grabbag.h"
#include "share/replaygain_synthesis.h"
#include "configure.h"
#include "wrap_id3.h"
#include "charset.h"
@ -255,7 +256,7 @@ void FLAC_XMMS__play_file(char *filename)
return;
}
}
FLAC__plugin_common__init_dither_context(&file_info_.dither_context, file_info_.sample_format_bytes_per_sample * 8, flac_cfg.output.resolution.replaygain.noise_shaping);
FLAC__replaygain_synthesis__init_dither_context(&file_info_.dither_context, file_info_.sample_format_bytes_per_sample * 8, flac_cfg.output.resolution.replaygain.noise_shaping);
file_info_.is_playing = true;
if(flac_ip.output->open_audio(file_info_.sample_format, file_info_.sample_rate, file_info_.channels) == 0) {
@ -501,19 +502,20 @@ FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder,
sample_buffer_first_ = 0;
}
sample_buffer_start = sample_buffer_ + sample_buffer_last_ * channels * file_info->sample_format_bytes_per_sample;
if(file_info_.has_replaygain && flac_cfg.output.replaygain.enable) {
FLAC__plugin_common__apply_gain(
if(file_info->has_replaygain && flac_cfg.output.replaygain.enable) {
FLAC__replaygain_synthesis__apply_gain(
sample_buffer_start,
!is_big_endian_host_,
file_info->sample_format_bytes_per_sample == 1, /* unsigned_data_out */
buffer,
wide_samples,
channels,
bits_per_sample,
file_info->sample_format_bytes_per_sample * 8,
file_info_.replay_scale,
file_info->replay_scale,
flac_cfg.output.replaygain.hard_limit,
flac_cfg.output.resolution.replaygain.dither,
&file_info_.dither_context
&file_info->dither_context
);
}
else if(is_big_endian_host_) {
@ -557,8 +559,8 @@ void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMeta
else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
double gain, peak;
if(grabbag__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, &gain, &peak)) {
file_info_.has_replaygain = true;
file_info_.replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
file_info->has_replaygain = true;
file_info->replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
}
}
}

View File

@ -15,7 +15,7 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
SUBDIRS = gain_analysis getopt grabbag utf8
SUBDIRS = getopt replaygain_analysis replaygain_synthesis grabbag utf8
EXTRA_DIST = \
Makefile.lite \

View File

@ -15,8 +15,8 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution.
.PHONY: all gain_analysis getopt grabbag utf8
all: gain_analysis getopt grabbag utf8
.PHONY: all getopt grabbag replaygain_analysis replaygain_synthesis utf8
all: getopt grabbag replaygain_analysis replaygain_synthesis utf8
DEFAULT_CONFIG = release
@ -30,20 +30,24 @@ debug : all
valgrind: all
release : all
gain_analysis:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
getopt:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
grabbag:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
replaygain_analysis:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
replaygain_synthesis:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
utf8:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
clean:
-(cd gain_analysis ; $(MAKE) -f Makefile.lite clean)
-(cd getopt ; $(MAKE) -f Makefile.lite clean)
-(cd grabbag ; $(MAKE) -f Makefile.lite clean)
-(cd replaygain_analysis ; $(MAKE) -f Makefile.lite clean)
-(cd replaygain_synthesis ; $(MAKE) -f Makefile.lite clean)
-(cd utf8 ; $(MAKE) -f Makefile.lite clean)

View File

@ -17,7 +17,7 @@
*/
#include "share/grabbag.h"
#include "share/gain_analysis.h"
#include "share/replaygain_analysis.h"
#include "FLAC/assert.h"
#include "FLAC/file_decoder.h"
#include "FLAC/metadata.h"

View File

@ -4,13 +4,13 @@ AUTOMAKE_OPTIONS = foreign
INCLUDES = -I$(top_srcdir)/include/share
noinst_LTLIBRARIES = libgain_analysis.la
noinst_LTLIBRARIES = libreplaygain_analysis.la
libgain_analysis_la_SOURCES = gain_analysis.c
libreplaygain_analysis_la_SOURCES = replaygain_analysis.c
EXTRA_DIST = \
Makefile.lite \
gain_analysis_static.dsp
replaygain_analysis_static.dsp
debug:
$(MAKE) all CFLAGS="@DEBUG@"

View File

@ -4,11 +4,11 @@
topdir = ../../..
LIB_NAME = libgain_analysis
LIB_NAME = libreplaygain_analysis
INCLUDES = -I$(topdir)/include/share
SRCS_C = \
gain_analysis.c
replaygain_analysis.c
include $(topdir)/build/lib.mk

View File

@ -94,7 +94,7 @@
#include <string.h>
#include <math.h>
#include "gain_analysis.h"
#include "replaygain_analysis.h"
typedef unsigned short Uint16_t;
typedef signed short Int16_t;
@ -410,4 +410,4 @@ GetAlbumGain ( void )
return analyzeResult ( B, sizeof(B)/sizeof(*B) );
}
/* end of gain_analysis.c */
/* end of replaygain_analysis.c */

View File

@ -1,34 +1,34 @@
# Microsoft Developer Studio Project File - Name="gain_analysis_static" - Package Owner=<4>
# Microsoft Developer Studio Project File - Name="replaygain_analysis_static" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=gain_analysis_static - Win32 Debug
CFG=replaygain_analysis_static - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "gain_analysis_static.mak".
!MESSAGE NMAKE /f "replaygain_analysis_static.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "gain_analysis_static.mak" CFG="gain_analysis_static - Win32 Debug"
!MESSAGE NMAKE /f "replaygain_analysis_static.mak" CFG="replaygain_analysis_static - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "gain_analysis_static - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "gain_analysis_static - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "replaygain_analysis_static - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "replaygain_analysis_static - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "gain_analysis"
# PROP Scc_ProjName "replaygain_analysis"
# PROP Scc_LocalPath "..\..\.."
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "gain_analysis_static - Win32 Release"
!IF "$(CFG)" == "replaygain_analysis_static - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@ -51,7 +51,7 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /nodefaultlib
!ELSEIF "$(CFG)" == "gain_analysis_static - Win32 Debug"
!ELSEIF "$(CFG)" == "replaygain_analysis_static - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
@ -78,14 +78,14 @@ LIB32=link.exe -lib
# Begin Target
# Name "gain_analysis_static - Win32 Release"
# Name "gain_analysis_static - Win32 Debug"
# Name "replaygain_analysis_static - Win32 Release"
# Name "replaygain_analysis_static - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "c"
# Begin Source File
SOURCE=.\gain_analysis.c
SOURCE=.\replaygain_analysis.c
# End Source File
# End Group
# Begin Group "Private Header Files"
@ -101,7 +101,7 @@ SOURCE=.\gain_analysis.c
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\include\share\gain_analysis.h
SOURCE=..\..\..\include\share\replaygain_analysis.h
# End Source File
# End Group
# End Target

View File

@ -0,0 +1,21 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
SUBDIRS = include .
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/share
noinst_LTLIBRARIES = libreplaygain_synthesis.la
libreplaygain_synthesis_la_SOURCES = replaygain_synthesis.c
EXTRA_DIST = \
Makefile.lite \
replaygain_synthesis_static.dsp
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"

View File

@ -0,0 +1,15 @@
#
# GNU makefile
#
topdir = ../../..
LIB_NAME = libreplaygain_synthesis
INCLUDES = -I./include -I$(topdir)/include -I$(topdir)/include/share
SRCS_C = \
replaygain_synthesis.c
include $(topdir)/build/lib.mk
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -1,4 +1,4 @@
# plugin_common - Routines common to several plugins
# replaygain_synthesis - Routines for applying ReplayGain to a signal
# Copyright (C) 2002,2003 Josh Coalson
#
# This program is free software; you can redistribute it and/or

View File

@ -1,4 +1,4 @@
# plugin_common - Routines common to several plugins
# replaygain_synthesis - Routines for applying ReplayGain to a signal
# Copyright (C) 2002,2003 Josh Coalson
#
# This program is free software; you can redistribute it and/or

View File

@ -1,4 +1,4 @@
/* plugin_common - Routines common to several plugins
/* replaygain_synthesis - Routines for applying ReplayGain to a signal
* Copyright (C) 2002,2003 Josh Coalson
*
* This program is free software; you can redistribute it and/or
@ -199,7 +199,7 @@ static double scalar16_(const float* x, const float* y)
}
void FLAC__plugin_common__init_dither_context(DitherContext *d, int bits, int shapingtype)
void FLAC__replaygain_synthesis__init_dither_context(DitherContext *d, int bits, int shapingtype)
{
static unsigned char default_dither [] = { 92, 92, 88, 84, 81, 78, 74, 67, 0, 0 };
static const float* F [] = { F44_0, F44_1, F44_2, F44_3 };
@ -288,7 +288,7 @@ static FLAC__INLINE FLAC__int64 dither_output_(DitherContext *d, FLAC__bool do_d
#endif
int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endian_data_out, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, const unsigned source_bps, const unsigned target_bps, const float scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context)
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 float scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context)
{
static const FLAC__int32 conv_factors_[33] = {
-1, /* 0 bits-per-sample (not supported) */
@ -375,12 +375,14 @@ int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endi
const FLAC__int32 *input_;
double sample;
const unsigned bytes_per_sample = target_bps / 8;
unsigned inc = bytes_per_sample * channels, last_history_index = dither_context->LastHistoryIndex;
const unsigned last_history_index = dither_context->LastHistoryIndex;
NoiseShaping noise_shaping = dither_context->ShapingType;
FLAC__int64 val64;
FLAC__int32 val32;
FLAC__int32 uval32;
const FLAC__uint32 twiggle = 1u << (target_bps - 1);
FLAC__ASSERT(channels > 0 && channels <= FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS);
FLAC__ASSERT(channels > 0 && channels <= FLAC_SHARE__MAX_SUPPORTED_CHANNELS);
FLAC__ASSERT(source_bps >= 4);
FLAC__ASSERT(target_bps >= 4);
FLAC__ASSERT(source_bps <= 32);
@ -388,9 +390,10 @@ int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endi
FLAC__ASSERT((target_bps & 7) == 0);
for(channel = 0; channel < channels; channel++) {
const unsigned incr = bytes_per_sample * channels;
data_out = start + bytes_per_sample * channel;
input_ = input[channel];
for(i = 0; i < wide_samples; i++, data_out += inc) {
for(i = 0; i < wide_samples; i++, data_out += incr) {
sample = (double)input_[i] * multi_scale;
if(hard_limit) {
@ -410,33 +413,36 @@ int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endi
else if(val64 < hard_clip_factor)
val32 = (FLAC__int32)hard_clip_factor;
uval32 = (FLAC__uint32)val32;
if (unsigned_data_out)
uval32 ^= twiggle;
if (little_endian_data_out) {
switch(target_bps) {
case 8:
data_out[0] = val32 ^ 0x80;
break;
case 24:
data_out[2] = (FLAC__byte)(val32 >> 16);
data_out[2] = (FLAC__byte)(uval32 >> 16);
/* fall through */
case 16:
data_out[1] = (FLAC__byte)(val32 >> 8);
data_out[0] = (FLAC__byte)val32;
data_out[1] = (FLAC__byte)(uval32 >> 8);
/* fall through */
case 8:
data_out[0] = (FLAC__byte)uval32;
break;
}
}
else {
switch(target_bps) {
case 8:
data_out[0] = val32 ^ 0x80;
case 24:
data_out[0] = (FLAC__byte)(uval32 >> 16);
data_out[1] = (FLAC__byte)(uval32 >> 8);
data_out[2] = (FLAC__byte)uval32;
break;
case 16:
data_out[0] = (FLAC__byte)(val32 >> 8);
data_out[1] = (FLAC__byte)val32;
data_out[0] = (FLAC__byte)(uval32 >> 8);
data_out[1] = (FLAC__byte)uval32;
break;
case 24:
data_out[0] = (FLAC__byte)(val32 >> 16);
data_out[1] = (FLAC__byte)(val32 >> 8);
data_out[2] = (FLAC__byte)val32;
case 8:
data_out[0] = (FLAC__byte)uval32;
break;
}
}
@ -444,5 +450,5 @@ int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC__bool little_endi
}
dither_context->LastHistoryIndex = (last_history_index + wide_samples) % 32;
return data_out - start;
return wide_samples * channels * (target_bps/8);
}

View File

@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="replaygain_synthesis_static" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=replaygain_synthesis_static - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "replaygain_synthesis_static.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "replaygain_synthesis_static.mak" CFG="replaygain_synthesis_static - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "replaygain_synthesis_static - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "replaygain_synthesis_static - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "replaygain_synthesis"
# PROP Scc_LocalPath "..\..\.."
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "replaygain_synthesis_static - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "..\..\..\obj\release\lib"
# PROP Intermediate_Dir "Release_static"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\..\include\share" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /nodefaultlib
!ELSEIF "$(CFG)" == "replaygain_synthesis_static - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\..\obj\debug\lib"
# PROP Intermediate_Dir "Debug_static"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include\share" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /nodefaultlib
!ENDIF
# Begin Target
# Name "replaygain_synthesis_static - Win32 Release"
# Name "replaygain_synthesis_static - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "c"
# Begin Source File
SOURCE=.\replaygain_synthesis.c
# End Source File
# End Group
# Begin Group "Private Header Files"
# PROP Default_Filter ""
# End Group
# Begin Group "Protected Header Files"
# PROP Default_Filter ""
# End Group
# Begin Group "Public Header Files"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\include\share\replaygain_synthesis.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -26,7 +26,7 @@ test_cuesheet_SOURCES = \
main.c
test_cuesheet_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
-lm

View File

@ -23,7 +23,7 @@ topdir = ../../..
PROGRAM_NAME = test_cuesheet
INCLUDES = -I./include -I$(topdir)/include
LIBS = -lgrabbag -lgain_analysis -lFLAC -lm
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -lm
SRCS_C = \
main.c

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\..\obj\release\lib\grabbag_static.lib ..\..\..\obj\release\lib\gain_analysis_static.lib ..\..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\..\obj\release\lib\grabbag_static.lib ..\..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "test_cuesheet - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\..\obj\debug\lib\grabbag_static.lib ..\..\..\obj\debug\lib\gain_analysis_static.lib ..\..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\..\obj\debug\lib\grabbag_static.lib ..\..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -25,7 +25,7 @@ EXTRA_DIST = \
noinst_PROGRAMS = test_libFLAC++
test_libFLAC___LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/libFLAC++/libFLAC++.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
-lm

View File

@ -23,7 +23,7 @@ topdir = ../..
PROGRAM_NAME = test_libFLAC++
INCLUDES = -I$(topdir)/include
LIBS = -lgrabbag -lgain_analysis -lFLAC++ -lFLAC -lm
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC++ -lFLAC -lm
SRCS_C = \
file_utils.c \
metadata_utils.c

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\libFLAC++_static.lib ..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\libFLAC++_static.lib ..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "test_libFLAC++ - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\libFLAC++_static.lib ..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\libFLAC++_static.lib ..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -25,7 +25,7 @@ INCLUDES = -I$(top_srcdir)/src/libFLAC/include
noinst_PROGRAMS = test_libFLAC
test_libFLAC_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
-lm
test_libFLAC_SOURCES = \

View File

@ -23,7 +23,7 @@ topdir = ../..
PROGRAM_NAME = test_libFLAC
INCLUDES = -I../libFLAC/include -I$(topdir)/include
LIBS = -lgrabbag -lgain_analysis -lFLAC -lm
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -lm
SRCS_C = \
bitbuffer.c \
decoders.c \

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "test_libFLAC - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -25,7 +25,7 @@ CFLAGS = @CFLAGS@ @OGG_CFLAGS@
noinst_PROGRAMS = test_libOggFLAC++
test_libOggFLAC___LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/libOggFLAC++/libOggFLAC++.la \
$(top_builddir)/src/libOggFLAC/libOggFLAC.la \
$(top_builddir)/src/libFLAC/libFLAC.la \

View File

@ -24,7 +24,7 @@ topdir = ../..
PROGRAM_NAME = test_libOggFLAC++
#@@@ TODO: conditionalize ogg lib path and -logg
INCLUDES = -I$(topdir)/include
LIBS = -lgrabbag -lgain_analysis -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
LIBS = -lgrabbag -lreplaygain_analysis -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
SRCS_C = \
file_utils.c \
metadata_utils.c

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\libOggFLAC++_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC++_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\libOggFLAC++_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC++_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "test_libOggFLAC++ - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\libOggFLAC++_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC++_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\libOggFLAC++_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC++_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF

View File

@ -25,7 +25,7 @@ INCLUDES =
noinst_PROGRAMS = test_libOggFLAC
test_libOggFLAC_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/gain_analysis/libgain_analysis.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/libOggFLAC/libOggFLAC.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \

View File

@ -24,7 +24,7 @@ topdir = ../..
PROGRAM_NAME = test_libOggFLAC
#@@@ TODO: conditionalize ogg lib path and -logg
INCLUDES = -I$(topdir)/include
LIBS = -lgrabbag -lgain_analysis -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
LIBS = -lgrabbag -lreplaygain_analysis -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
SRCS_C = \
decoders.c \
encoders.c \

View File

@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\gain_analysis_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\libOggFLAC_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "test_libOggFLAC - Win32 Debug"
@ -76,7 +76,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\gain_analysis_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\libOggFLAC_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF