#ifndef flac__decode_h
#define flac__decode_h
+#include "analyze.h"
+
/* outfile == 0 => test only */
-int decode_wav(const char *infile, const char *outfile, bool analysis_mode, bool analyze_residual, bool verbose, uint64 skip);
-int decode_raw(const char *infile, const char *outfile, bool analysis_mode, bool analyze_residual, bool verbose, uint64 skip, bool is_big_endian, bool is_unsigned_samples);
+int decode_wav(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip);
+int decode_raw(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip, bool is_big_endian, bool is_unsigned_samples);
#endif
#include <stdlib.h>
#include <string.h>
#include "FLAC/all.h"
+#include "analyze.h"
#include "decode.h"
#include "encode.h"
int i;
bool verify = false, verbose = true, lax = false, mode_decode = false, test_only = false, analyze = false;
bool do_mid_side = true, loose_mid_side = false, do_exhaustive_model_search = false, do_qlp_coeff_prec_search = false;
- bool analyze_residual = false;
+ analysis_options aopts;
unsigned padding = 0;
unsigned max_lpc_order = 8;
unsigned qlp_coeff_precision = 0;
int format_channels = -1, format_bps = -1, format_sample_rate = -1;
int blocksize = -1, rice_optimization_level = -1;
+ aopts.do_residual_text = false;
+ aopts.do_residual_gnuplot = false;
+
if(argc <= 1)
return usage(0);
qlp_coeff_precision = atoi(argv[++i]);
else if(0 == strcmp(argv[i], "-r"))
rice_optimization_level = atoi(argv[++i]);
- else if(0 == strcmp(argv[i], "-v"))
- analyze_residual = true;
- else if(0 == strcmp(argv[i], "-v-"))
- analyze_residual = false;
else if(0 == strcmp(argv[i], "-V"))
verify = true;
else if(0 == strcmp(argv[i], "-V-"))
format_is_wave = false;
else if(0 == strcmp(argv[i], "-fw"))
format_is_wave = true;
+ else if(0 == strcmp(argv[i], "--a-rgp"))
+ aopts.do_residual_gnuplot = true;
+ else if(0 == strcmp(argv[i], "--a-rgp-"))
+ aopts.do_residual_gnuplot = false;
else if(0 == strcmp(argv[i], "-0")) {
do_exhaustive_model_search = false;
do_mid_side = false;
if(mode_decode)
if(format_is_wave)
- return decode_wav(argv[i], test_only? 0 : argv[i+1], analyze, analyze_residual, verbose, skip);
+ return decode_wav(argv[i], test_only? 0 : argv[i+1], analyze, aopts, verbose, skip);
else
- return decode_raw(argv[i], test_only? 0 : argv[i+1], analyze, analyze_residual, verbose, skip, format_is_big_endian, format_is_unsigned_samples);
+ return decode_raw(argv[i], test_only? 0 : argv[i+1], analyze, aopts, verbose, skip, format_is_big_endian, format_is_unsigned_samples);
else
if(format_is_wave)
return encode_wav(argv[i], argv[i+1], verbose, skip, verify, lax, do_mid_side, loose_mid_side, do_exhaustive_model_search, do_qlp_coeff_prec_search, rice_optimization_level, max_lpc_order, (unsigned)blocksize, qlp_coeff_precision, padding);
printf(" -s : silent (do not write runtime encode/decode statistics to stdout)\n");
printf(" --skip samples : can be used both for encoding and decoding\n");
printf("analyze options:\n");
- printf(" -v : verbose (include residual signal in output)\n");
+ printf(" --a-rtext : include residual signal in text output\n");
+ printf(" --a-rgp : generate gnuplot files of residual distribution of each subframe\n");
printf("encoding options:\n");
printf(" --lax : allow encoder to generate non-Subset files\n");
printf(" -P bytes : write a PADDING block of the given length (0 => no PADDING block, default is -P 0)\n");