Commit f8b9515a authored by Daniel Povey's avatar Daniel Povey
Browse files

Merge pull request #44 from vdp/po-to-opts

Cosmetic variable name change: OptionsItf po -> OptionsItf opts
parents 5c01929a 28d28b07
...@@ -38,13 +38,13 @@ struct AlignConfig { ...@@ -38,13 +38,13 @@ struct AlignConfig {
AlignConfig(): beam(200.0), retry_beam(0.0), careful(false) { } AlignConfig(): beam(200.0), retry_beam(0.0), careful(false) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("beam", &beam, "Decoding beam used in alignment"); opts->Register("beam", &beam, "Decoding beam used in alignment");
po->Register("retry-beam", &retry_beam, opts->Register("retry-beam", &retry_beam,
"Decoding beam for second try at alignment"); "Decoding beam for second try at alignment");
po->Register("careful", &careful, opts->Register("careful", &careful,
"If true, do 'careful' alignment, which is better at detecting " "If true, do 'careful' alignment, which is better at detecting "
"alignment failure (involves loop to start of decoding graph)."); "alignment failure (involves loop to start of decoding graph).");
} }
}; };
......
...@@ -42,18 +42,18 @@ struct FasterDecoderOptions { ...@@ -42,18 +42,18 @@ struct FasterDecoderOptions {
// alignment, use small default. // alignment, use small default.
beam_delta(0.5), beam_delta(0.5),
hash_ratio(2.0) { } hash_ratio(2.0) { }
void Register(OptionsItf *po, bool full) { /// if "full", use obscure void Register(OptionsItf *opts, bool full) { /// if "full", use obscure
/// options too. /// options too.
/// Depends on program. /// Depends on program.
po->Register("beam", &beam, "Decoder beam"); opts->Register("beam", &beam, "Decoder beam");
po->Register("max-active", &max_active, "Decoder max active states."); opts->Register("max-active", &max_active, "Decoder max active states.");
po->Register("min-active", &min_active, opts->Register("min-active", &min_active,
"Decoder min active states (don't prune if #active less than this)."); "Decoder min active states (don't prune if #active less than this).");
if (full) { if (full) {
po->Register("beam-delta", &beam_delta, opts->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]"); "Increment used in decoder [obscure setting]");
po->Register("hash-ratio", &hash_ratio, opts->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior"); "Setting used in decoder to control hash behavior");
} }
} }
}; };
......
...@@ -64,22 +64,22 @@ struct LatticeFasterDecoderConfig { ...@@ -64,22 +64,22 @@ struct LatticeFasterDecoderConfig {
beam_delta(0.5), beam_delta(0.5),
hash_ratio(2.0), hash_ratio(2.0),
prune_scale(0.1) { } prune_scale(0.1) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
det_opts.Register(po); det_opts.Register(opts);
po->Register("beam", &beam, "Decoding beam."); opts->Register("beam", &beam, "Decoding beam.");
po->Register("max-active", &max_active, "Decoder max active states."); opts->Register("max-active", &max_active, "Decoder max active states.");
po->Register("min-active", &min_active, "Decoder minimum #active states."); opts->Register("min-active", &min_active, "Decoder minimum #active states.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam"); opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at " opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens"); "which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, " opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only " "determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."); "best pdf-sequence for each word-sequence).");
po->Register("beam-delta", &beam_delta, "Increment used in decoding-- this " opts->Register("beam-delta", &beam_delta, "Increment used in decoding-- this "
"parameter is obscure and relates to a speedup in the way the " "parameter is obscure and relates to a speedup in the way the "
"max-active constraint is applied. Larger is more accurate."); "max-active constraint is applied. Larger is more accurate.");
po->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control" opts->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior"); " hash behavior");
} }
void Check() const { void Check() const {
KALDI_ASSERT(beam > 0.0 && max_active > 1 && lattice_beam > 0.0 KALDI_ASSERT(beam > 0.0 && max_active > 1 && lattice_beam > 0.0
......
...@@ -53,15 +53,15 @@ struct LatticeSimpleDecoderConfig { ...@@ -53,15 +53,15 @@ struct LatticeSimpleDecoderConfig {
determinize_lattice(true), determinize_lattice(true),
beam_ratio(0.9), beam_ratio(0.9),
prune_scale(0.1) { } prune_scale(0.1) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
det_opts.Register(po); det_opts.Register(opts);
po->Register("beam", &beam, "Decoding beam."); opts->Register("beam", &beam, "Decoding beam.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam"); opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at " opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens"); "which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, " opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only " "determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."); "best pdf-sequence for each word-sequence).");
} }
void Check() const { void Check() const {
KALDI_ASSERT(beam > 0.0 && lattice_beam > 0.0 && prune_interval > 0); KALDI_ASSERT(beam > 0.0 && lattice_beam > 0.0 && prune_interval > 0);
......
...@@ -54,23 +54,23 @@ struct LatticeTrackingDecoderConfig { ...@@ -54,23 +54,23 @@ struct LatticeTrackingDecoderConfig {
hash_ratio(2.0), hash_ratio(2.0),
extra_beam(4.0), extra_beam(4.0),
max_beam(40.0) { } max_beam(40.0) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
det_opts.Register(po); det_opts.Register(opts);
po->Register("beam", &beam, "Decoding beam."); opts->Register("beam", &beam, "Decoding beam.");
po->Register("max-active", &max_active, "Decoder max active states."); opts->Register("max-active", &max_active, "Decoder max active states.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam"); opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at " opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens"); "which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, " opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only " "determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."); "best pdf-sequence for each word-sequence).");
po->Register("beam-delta", &beam_delta, "Increment used in decoding"); opts->Register("beam-delta", &beam_delta, "Increment used in decoding");
po->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control" opts->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior"); " hash behavior");
po->Register("extra-beam", &extra_beam, "Increment used in decoding (added " opts->Register("extra-beam", &extra_beam, "Increment used in decoding (added "
"to worst tracked token from first pass)"); "to worst tracked token from first pass)");
po->Register("max-beam", &max_beam, "Maximum beam (in case tracked tokens " opts->Register("max-beam", &max_beam, "Maximum beam (in case tracked tokens "
"go too far from beam)"); "go too far from beam)");
} }
void Check() const { void Check() const {
......
...@@ -41,17 +41,17 @@ struct NBestDecoderOptions { ...@@ -41,17 +41,17 @@ struct NBestDecoderOptions {
max_active(std::numeric_limits<int32>::max()), max_active(std::numeric_limits<int32>::max()),
n_best(1), n_best(1),
beam_delta(0.5), hash_ratio(2.0) { } beam_delta(0.5), hash_ratio(2.0) { }
void Register(OptionsItf *po, bool full) { /// if "full", use obscure void Register(OptionsItf *opts, bool full) { /// if "full", use obscure
/// options too. /// options too.
/// Depends on program. /// Depends on program.
po->Register("beam", &beam, "Decoder beam"); opts->Register("beam", &beam, "Decoder beam");
po->Register("max-active", &max_active, "Decoder max active states."); opts->Register("max-active", &max_active, "Decoder max active states.");
po->Register("n-best", &n_best, "Decoder number of best tokens."); opts->Register("n-best", &n_best, "Decoder number of best tokens.");
if (full) { if (full) {
po->Register("beam-delta", &beam_delta, opts->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]"); "Increment used in decoder [obscure setting]");
po->Register("hash-ratio", &hash_ratio, opts->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior"); "Setting used in decoder to control hash behavior");
} }
} }
}; };
......
...@@ -42,14 +42,14 @@ struct TrainingGraphCompilerOptions { ...@@ -42,14 +42,14 @@ struct TrainingGraphCompilerOptions {
rm_eps(false), rm_eps(false),
reorder(b) { } reorder(b) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("transition-scale", &transition_scale, "Scale of transition " opts->Register("transition-scale", &transition_scale, "Scale of transition "
"probabilities (excluding self-loops)"); "probabilities (excluding self-loops)");
po->Register("self-loop-scale", &self_loop_scale, "Scale of self-loop vs. " opts->Register("self-loop-scale", &self_loop_scale, "Scale of self-loop vs. "
"non-self-loop probability mass "); "non-self-loop probability mass ");
po->Register("reorder", &reorder, "Reorder transition ids for greater decoding efficiency."); opts->Register("reorder", &reorder, "Reorder transition ids for greater decoding efficiency.");
po->Register("rm-eps", &rm_eps, "Remove [most] epsilons before minimization (only applicable " opts->Register("rm-eps", &rm_eps, "Remove [most] epsilons before minimization (only applicable "
"if disambig symbols present)"); "if disambig symbols present)");
} }
}; };
......
...@@ -53,20 +53,20 @@ struct FbankOptions { ...@@ -53,20 +53,20 @@ struct FbankOptions {
htk_compat(false), htk_compat(false),
use_log_fbank(true) {} use_log_fbank(true) {}
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
frame_opts.Register(po); frame_opts.Register(opts);
mel_opts.Register(po); mel_opts.Register(opts);
po->Register("use-energy", &use_energy, opts->Register("use-energy", &use_energy,
"Add an extra dimension with energy to the FBANK output."); "Add an extra dimension with energy to the FBANK output.");
po->Register("energy-floor", &energy_floor, opts->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in FBANK computation"); "Floor on energy (absolute, not relative) in FBANK computation");
po->Register("raw-energy", &raw_energy, opts->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing"); "If true, compute energy before preemphasis and windowing");
po->Register("htk-compat", &htk_compat, "If true, put energy last. " opts->Register("htk-compat", &htk_compat, "If true, put energy last. "
"Warning: not sufficient to get HTK compatible features (need " "Warning: not sufficient to get HTK compatible features (need "
"to change other parameters)."); "to change other parameters).");
po->Register("use-log-fbank", &use_log_fbank, opts->Register("use-log-fbank", &use_log_fbank,
"If true, produce log-filterbank, else produce linear."); "If true, produce log-filterbank, else produce linear.");
} }
}; };
......
...@@ -52,20 +52,20 @@ struct MelBanksOptions { ...@@ -52,20 +52,20 @@ struct MelBanksOptions {
: num_bins(num_bins), low_freq(20), high_freq(0), vtln_low(100), : num_bins(num_bins), low_freq(20), high_freq(0), vtln_low(100),
vtln_high(-500), debug_mel(false), htk_mode(false) {} vtln_high(-500), debug_mel(false), htk_mode(false) {}
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("num-mel-bins", &num_bins, opts->Register("num-mel-bins", &num_bins,
"Number of triangular mel-frequency bins"); "Number of triangular mel-frequency bins");
po->Register("low-freq", &low_freq, opts->Register("low-freq", &low_freq,
"Low cutoff frequency for mel bins"); "Low cutoff frequency for mel bins");
po->Register("high-freq", &high_freq, opts->Register("high-freq", &high_freq,
"High cutoff frequency for mel bins (if < 0, offset from Nyquist)"); "High cutoff frequency for mel bins (if < 0, offset from Nyquist)");
po->Register("vtln-low", &vtln_low, opts->Register("vtln-low", &vtln_low,
"Low inflection point in piecewise linear VTLN warping function"); "Low inflection point in piecewise linear VTLN warping function");
po->Register("vtln-high", &vtln_high, opts->Register("vtln-high", &vtln_high,
"High inflection point in piecewise linear VTLN warping function" "High inflection point in piecewise linear VTLN warping function"
" (if negative, offset from high-mel-freq"); " (if negative, offset from high-mel-freq");
po->Register("debug-mel", &debug_mel, opts->Register("debug-mel", &debug_mel,
"Print out debugging information for mel bin computation"); "Print out debugging information for mel bin computation");
} }
}; };
...@@ -95,26 +95,26 @@ struct FrameExtractionOptions { ...@@ -95,26 +95,26 @@ struct FrameExtractionOptions {
round_to_power_of_two(true), round_to_power_of_two(true),
snip_edges(true){ } snip_edges(true){ }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("sample-frequency", &samp_freq, opts->Register("sample-frequency", &samp_freq,
"Waveform data sample frequency (must match the waveform file, " "Waveform data sample frequency (must match the waveform file, "
"if specified there)"); "if specified there)");
po->Register("frame-length", &frame_length_ms, "Frame length in milliseconds"); opts->Register("frame-length", &frame_length_ms, "Frame length in milliseconds");
po->Register("frame-shift", &frame_shift_ms, "Frame shift in milliseconds"); opts->Register("frame-shift", &frame_shift_ms, "Frame shift in milliseconds");
po->Register("preemphasis-coefficient", &preemph_coeff, opts->Register("preemphasis-coefficient", &preemph_coeff,
"Coefficient for use in signal preemphasis"); "Coefficient for use in signal preemphasis");
po->Register("remove-dc-offset", &remove_dc_offset, opts->Register("remove-dc-offset", &remove_dc_offset,
"Subtract mean from waveform on each frame"); "Subtract mean from waveform on each frame");
po->Register("dither", &dither, "Dithering constant (0.0 means no dither)"); opts->Register("dither", &dither, "Dithering constant (0.0 means no dither)");
po->Register("window-type", &window_type, "Type of window " opts->Register("window-type", &window_type, "Type of window "
"(\"hamming\"|\"hanning\"|\"povey\"|\"rectangular\")"); "(\"hamming\"|\"hanning\"|\"povey\"|\"rectangular\")");
po->Register("round-to-power-of-two", &round_to_power_of_two, opts->Register("round-to-power-of-two", &round_to_power_of_two,
"If true, round window size to power of two."); "If true, round window size to power of two.");
po->Register("snip-edges", &snip_edges, opts->Register("snip-edges", &snip_edges,
"If true, end effects will be handled by outputting only frames that " "If true, end effects will be handled by outputting only frames that "
"completely fit in the file, and the number of frames depends on the " "completely fit in the file, and the number of frames depends on the "
"frame-length. If false, the number of frames depends only on the " "frame-length. If false, the number of frames depends only on the "
"frame-shift, and we reflect the data at the ends."); "frame-shift, and we reflect the data at the ends.");
} }
int32 WindowShift() const { int32 WindowShift() const {
return static_cast<int32>(samp_freq * 0.001 * frame_shift_ms); return static_cast<int32>(samp_freq * 0.001 * frame_shift_ms);
...@@ -197,11 +197,11 @@ struct DeltaFeaturesOptions { ...@@ -197,11 +197,11 @@ struct DeltaFeaturesOptions {
DeltaFeaturesOptions(int32 order = 2, int32 window = 2): DeltaFeaturesOptions(int32 order = 2, int32 window = 2):
order(order), window(window) { } order(order), window(window) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("delta-order", &order, "Order of delta computation"); opts->Register("delta-order", &order, "Order of delta computation");
po->Register("delta-window", &window, opts->Register("delta-window", &window,
"Parameter controlling window for delta computation (actual window" "Parameter controlling window for delta computation (actual window"
" size for each delta order is 1 + 2*delta-window-size)"); " size for each delta order is 1 + 2*delta-window-size)");
} }
}; };
...@@ -233,11 +233,11 @@ struct ShiftedDeltaFeaturesOptions { ...@@ -233,11 +233,11 @@ struct ShiftedDeltaFeaturesOptions {
ShiftedDeltaFeaturesOptions(): ShiftedDeltaFeaturesOptions():
window(1), num_blocks(7), block_shift(3) { } window(1), num_blocks(7), block_shift(3) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("delta-window", &window, "Size of delta advance and delay."); opts->Register("delta-window", &window, "Size of delta advance and delay.");
po->Register("num-blocks", &num_blocks, "Number of delta blocks in advance" opts->Register("num-blocks", &num_blocks, "Number of delta blocks in advance"
" of each frame to be concatenated"); " of each frame to be concatenated");
po->Register("block-shift", &block_shift, "Distance between each block"); opts->Register("block-shift", &block_shift, "Distance between each block");
} }
}; };
...@@ -320,17 +320,17 @@ struct SlidingWindowCmnOptions { ...@@ -320,17 +320,17 @@ struct SlidingWindowCmnOptions {
normalize_variance(false), normalize_variance(false),
center(false) { } center(false) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("cmn-window", &cmn_window, "Window in frames for running " opts->Register("cmn-window", &cmn_window, "Window in frames for running "
"average CMN computation"); "average CMN computation");
po->Register("min-cmn-window", &min_window, "Minimum CMN window " opts->Register("min-cmn-window", &min_window, "Minimum CMN window "
"used at start of decoding (adds latency only at start). " "used at start of decoding (adds latency only at start). "
"Only applicable if center == false, ignored if center==true"); "Only applicable if center == false, ignored if center==true");
po->Register("norm-vars", &normalize_variance, "If true, normalize " opts->Register("norm-vars", &normalize_variance, "If true, normalize "
"variance to one."); // naming this as in apply-cmvn.cc "variance to one."); // naming this as in apply-cmvn.cc
po->Register("center", &center, "If true, use a window centered on the " opts->Register("center", &center, "If true, use a window centered on the "
"current frame (to the extent possible, modulo end effects). " "current frame (to the extent possible, modulo end effects). "
"If false, window is to the left."); "If false, window is to the left.");
} }
void Check() const; void Check() const;
}; };
......
...@@ -57,23 +57,23 @@ struct MfccOptions { ...@@ -57,23 +57,23 @@ struct MfccOptions {
cepstral_lifter(22.0), cepstral_lifter(22.0),
htk_compat(false) {} htk_compat(false) {}
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
frame_opts.Register(po); frame_opts.Register(opts);
mel_opts.Register(po); mel_opts.Register(opts);
po->Register("num-ceps", &num_ceps, opts->Register("num-ceps", &num_ceps,
"Number of cepstra in MFCC computation (including C0)"); "Number of cepstra in MFCC computation (including C0)");
po->Register("use-energy", &use_energy, opts->Register("use-energy", &use_energy,
"Use energy (not C0) in MFCC computation"); "Use energy (not C0) in MFCC computation");
po->Register("energy-floor", &energy_floor, opts->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in MFCC computation"); "Floor on energy (absolute, not relative) in MFCC computation");
po->Register("raw-energy", &raw_energy, opts->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing"); "If true, compute energy before preemphasis and windowing");
po->Register("cepstral-lifter", &cepstral_lifter, opts->Register("cepstral-lifter", &cepstral_lifter,
"Constant that controls scaling of MFCCs"); "Constant that controls scaling of MFCCs");
po->Register("htk-compat", &htk_compat, opts->Register("htk-compat", &htk_compat,
"If true, put energy or C0 last and use a factor of sqrt(2) on " "If true, put energy or C0 last and use a factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features " "C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."); "(need to change other parameters).");
} }
}; };
......
...@@ -66,29 +66,29 @@ struct PlpOptions { ...@@ -66,29 +66,29 @@ struct PlpOptions {
cepstral_scale(1.0), cepstral_scale(1.0),
htk_compat(false) {} htk_compat(false) {}
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
frame_opts.Register(po); frame_opts.Register(opts);
mel_opts.Register(po); mel_opts.Register(opts);
po->Register("lpc-order", &lpc_order, opts->Register("lpc-order", &lpc_order,
"Order of LPC analysis in PLP computation"); "Order of LPC analysis in PLP computation");
po->Register("num-ceps", &num_ceps, opts->Register("num-ceps", &num_ceps,
"Number of cepstra in PLP computation (including C0)"); "Number of cepstra in PLP computation (including C0)");
po->Register("use-energy", &use_energy, opts->Register("use-energy", &use_energy,
"Use energy (not C0) for zeroth PLP feature"); "Use energy (not C0) for zeroth PLP feature");
po->Register("energy-floor", &energy_floor, opts->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in PLP computation"); "Floor on energy (absolute, not relative) in PLP computation");
po->Register("raw-energy", &raw_energy, opts->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing"); "If true, compute energy before preemphasis and windowing");
po->Register("compress-factor", &compress_factor, opts->Register("compress-factor", &compress_factor,
"Compression factor in PLP computation"); "Compression factor in PLP computation");
po->Register("cepstral-lifter", &cepstral_lifter, opts->Register("cepstral-lifter", &cepstral_lifter,
"Constant that controls scaling of PLPs"); "Constant that controls scaling of PLPs");
po->Register("cepstral-scale", &cepstral_scale, opts->Register("cepstral-scale", &cepstral_scale,
"Scaling constant in PLP computation"); "Scaling constant in PLP computation");
po->Register("htk-compat", &htk_compat, opts->Register("htk-compat", &htk_compat,
"If true, put energy or C0 last and put factor of sqrt(2) on " "If true, put energy or C0 last and put factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features " "C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."); "(need to change other parameters).");
} }
}; };
......
...@@ -44,12 +44,12 @@ struct SpectrogramOptions { ...@@ -44,12 +44,12 @@ struct SpectrogramOptions {
energy_floor(0.0), // not in log scale: a small value e.g. 1.0e-10 energy_floor(0.0), // not in log scale: a small value e.g. 1.0e-10
raw_energy(true) {} raw_energy(true) {}
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
frame_opts.Register(po); frame_opts.Register(opts);
po->Register("energy-floor", &energy_floor, opts->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in Spectrogram computation"); "Floor on energy (absolute, not relative) in Spectrogram computation");
po->Register("raw-energy", &raw_energy, opts->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing"); "If true, compute energy before preemphasis and windowing");
} }
}; };
......
...@@ -132,68 +132,68 @@ struct PitchExtractionOptions { ...@@ -132,68 +132,68 @@ struct PitchExtractionOptions {
nccf_ballast_online(false), nccf_ballast_online(false),
snip_edges(true) { } snip_edges(true) { }
void Register(OptionsItf *po) { void Register(OptionsItf *opts) {
po->Register("sample-frequency", &samp_freq, opts->Register("sample-frequency", &samp_freq,
"Waveform data sample frequency (must match the waveform " "Waveform data sample frequency (must match the waveform "
"file, if specified there)"); "file, if specified there)");
po->Register("frame-length", &frame_length_ms, "Frame length in " opts->Register("frame-length", &frame_length_ms, "Frame length in "
"milliseconds"); "milliseconds");
po->Register("frame-shift", &frame_shift_ms, "Frame shift in milliseconds"); opts->Register("frame-shift", &frame_shift_ms, "Frame shift in milliseconds");
po->Register("preemphasis-coefficient", &preemph_coeff, opts->Register("preemphasis-coefficient", &preemph_coeff,
"Coefficient for use in signal preemphasis (deprecated)"); "Coefficient for use in signal preemphasis (deprecated)");
po->Register("min-f0", &min_f0, opts->Register("min-f0", &min_f0,
"min. F0 to search for (Hz)"); "min. F0 to search for (Hz)");
po->Register("max-f0", &max_f0, opts->Register("max-f0", &max_f0,
"max. F0 to search for (Hz)");