pass aopts to analyze_init/finish()

This commit is contained in:
Josh Coalson 2001-03-29 22:19:24 +00:00
parent 3e7fc0521f
commit 470785c319
2 changed files with 12 additions and 8 deletions

View File

@ -47,10 +47,12 @@ 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)
{
if(aopts.do_residual_gnuplot) {
init_stats(&all_);
}
}
void analyze_frame(const FLAC__Frame *frame, unsigned frame_number, analysis_options aopts, FILE *fout)
{
@ -123,17 +125,19 @@ 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)
{
if(aopts.do_residual_gnuplot) {
compute_stats(&all_);
(void)dump_stats(&all_, "all");
}
}
void init_stats(subframe_stats_t *stats)
{

View File

@ -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