From 470785c319627879cc396cdb9bd19c89b02fc7d5 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Thu, 29 Mar 2001 22:19:24 +0000 Subject: [PATCH] pass aopts to analyze_init/finish() --- src/flac/analyze.c | 16 ++++++++++------ src/flac/analyze.h | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/flac/analyze.c b/src/flac/analyze.c index f424aabb..231d92fb 100644 --- a/src/flac/analyze.c +++ b/src/flac/analyze.c @@ -47,9 +47,11 @@ static void update_stats(subframe_stats_t *stats, int32 residual, unsigned incr) static void compute_stats(subframe_stats_t *stats); static bool dump_stats(const subframe_stats_t *stats, const char *filename); -void analyze_init() +void analyze_init(analysis_options aopts) { - init_stats(&all_); + if(aopts.do_residual_gnuplot) { + init_stats(&all_); + } } void analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_options aopts, FILE *fout) @@ -123,16 +125,18 @@ void analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_opt /* write the subframe */ sprintf(outfilename, "f%06u.s%u.gp", frame_number, channel); compute_stats(&stats); -if(frame_number<50)//@@@ + (void)dump_stats(&stats, outfilename); } } } -void analyze_finish() +void analyze_finish(analysis_options aopts) { - compute_stats(&all_); - (void)dump_stats(&all_, "all"); + if(aopts.do_residual_gnuplot) { + compute_stats(&all_); + (void)dump_stats(&all_, "all"); + } } void init_stats(subframe_stats_t *stats) diff --git a/src/flac/analyze.h b/src/flac/analyze.h index 24a791c8..29e6c562 100644 --- a/src/flac/analyze.h +++ b/src/flac/analyze.h @@ -24,8 +24,8 @@ typedef struct { bool do_residual_gnuplot; } analysis_options; -void analyze_init(); +void analyze_init(analysis_options aopts); void analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_options aopts, FILE *fout); -void analyze_finish(); +void analyze_finish(analysis_options aopts); #endif