Update of /cvsroot/sp-tk/SPTK4/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11215 Modified Files: acorr.cc all_pole_digital_filter.cc all_pole_digital_filter.h all_zero_digital_filter.cc all_zero_digital_filter.h autocorrelation.cc autocorrelation.h c2mpir.cc cepstrum_to_minimum_phase_impulse_response.cc cepstrum_to_minimum_phase_impulse_response.h excitation_generation.cc excitation_generation.h excite.cc fast_fourier_transform.cc fast_fourier_transform.h fft.cc freqt.cc frequency_transform.cc frequency_transform.h ifft.cc input_source_from_stream.cc input_source_from_stream.h input_source_interpolation.cc input_source_interpolation.h input_source_interpolation_with_magic_number.cc input_source_interpolation_with_magic_number.h input_source_preprocessing_for_filter_gain.cc input_source_preprocessing_for_filter_gain.h levdur.cc levinson_durbin_recursion.cc levinson_durbin_recursion.h lpc.cc m_sequence_generation.cc mseq.cc normal_distributed_random_value_generation.cc nrand.cc poledf.cc sptk_utils.cc sptk_utils.h zerodf.cc Added Files: .clang-format Log Message: fix code format by clang-format command Index: frequency_transform.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/frequency_transform.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** frequency_transform.cc 23 Sep 2016 05:42:45 -0000 1.8 --- frequency_transform.cc 12 Oct 2016 12:14:38 -0000 1.9 *************** *** 50,60 **** namespace sptk { ! bool FrequencyTransform::Run( ! const std::vector<double>& minimum_phase_sequence, ! std::vector<double>* warped_sequence, ! FrequencyTransform::Buffer* buffer) const { // check inputs ! if (minimum_phase_sequence.empty() || ! NULL == warped_sequence || NULL == buffer) { return false; --- 50,58 ---- namespace sptk { ! bool FrequencyTransform::Run(const std::vector<double>& minimum_phase_sequence, ! std::vector<double>* warped_sequence, ! FrequencyTransform::Buffer* buffer) const { // check inputs ! if (minimum_phase_sequence.empty() || NULL == warped_sequence || NULL == buffer) { return false; *************** *** 68,75 **** const int num_input_order(minimum_phase_sequence.size() - 1); ! if (0.0 == alpha_ && ! num_input_order == num_output_order_) { ! std::copy(minimum_phase_sequence.begin(), ! minimum_phase_sequence.end(), warped_sequence->begin()); return true; --- 66,71 ---- const int num_input_order(minimum_phase_sequence.size() - 1); ! if (0.0 == alpha_ && num_input_order == num_output_order_) { ! std::copy(minimum_phase_sequence.begin(), minimum_phase_sequence.end(), warped_sequence->begin()); return true; Index: sptk_utils.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/sptk_utils.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sptk_utils.cc 29 Jul 2016 07:26:20 -0000 1.9 --- sptk_utils.cc 12 Oct 2016 12:14:38 -0000 1.10 *************** *** 53,58 **** bool ReadStream(double* read_data, std::istream* input_stream) { ! if (NULL == read_data || ! NULL == input_stream) { return false; } --- 53,57 ---- bool ReadStream(double* read_data, std::istream* input_stream) { ! if (NULL == read_data || NULL == input_stream) { return false; } *************** *** 71,77 **** std::vector<double>* sequence_to_read, std::istream* input_stream) { ! if (read_size <= 0 || ! NULL == sequence_to_read || ! NULL == input_stream) { return false; } --- 70,74 ---- std::vector<double>* sequence_to_read, std::istream* input_stream) { ! if (read_size <= 0 || NULL == sequence_to_read || NULL == input_stream) { return false; } *************** *** 96,107 **** // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). ! const int num_zeros(std::ceil( ! static_cast<double>(num_bytes - gcount) / type_byte)); if (num_zeros < 0) { return false; // Something wrong! } ! std::fill(sequence_to_read->end() - num_zeros, ! sequence_to_read->end(), 0.0); --- 93,103 ---- // Use std::ceil to zero incomplete data // as gcount may not be a multiple of sizeof(double). ! const int num_zeros( ! std::ceil(static_cast<double>(num_bytes - gcount) / type_byte)); if (num_zeros < 0) { return false; // Something wrong! } ! std::fill(sequence_to_read->end() - num_zeros, sequence_to_read->end(), 0.0); *************** *** 123,131 **** } ! bool WriteStream(int write_size, ! const std::vector<double>& sequence_to_write, std::ostream* output_stream) { ! if (write_size <= 0 || ! NULL == output_stream) { return false; } --- 119,125 ---- } ! bool WriteStream(int write_size, const std::vector<double>& sequence_to_write, std::ostream* output_stream) { ! if (write_size <= 0 || NULL == output_stream) { return false; } Index: input_source_from_stream.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_from_stream.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input_source_from_stream.h 12 Oct 2016 11:13:51 -0000 1.2 --- input_source_from_stream.h 12 Oct 2016 12:14:38 -0000 1.3 *************** *** 59,66 **** InputSourceFromStream(bool zero_padding, int read_size, std::istream* input_stream) ! : zero_padding_(zero_padding), read_size_(read_size), ! input_stream_(input_stream), is_valid_(true) { ! if (read_size <= 0 || ! NULL == input_stream) { is_valid_ = false; } --- 59,67 ---- InputSourceFromStream(bool zero_padding, int read_size, std::istream* input_stream) ! : zero_padding_(zero_padding), ! read_size_(read_size), ! input_stream_(input_stream), ! is_valid_(true) { ! if (read_size <= 0 || NULL == input_stream) { is_valid_ = false; } *************** *** 71,77 **** // ! virtual bool IsValid() const { ! return is_valid_; ! } // --- 72,76 ---- // ! virtual bool IsValid() const { return is_valid_; } // Index: cepstrum_to_minimum_phase_impulse_response.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/cepstrum_to_minimum_phase_impulse_response.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cepstrum_to_minimum_phase_impulse_response.cc 12 Oct 2016 04:31:24 -0000 1.4 --- cepstrum_to_minimum_phase_impulse_response.cc 12 Oct 2016 12:14:38 -0000 1.5 *************** *** 55,61 **** // check inputs if (cepstrum_coefficient.size() != ! static_cast<std::size_t>(num_input_order_ + 1) || ! NULL == minimum_phase_impulse_response || ! !is_valid_) { return false; } --- 55,60 ---- // check inputs if (cepstrum_coefficient.size() != ! static_cast<std::size_t>(num_input_order_ + 1) || ! NULL == minimum_phase_impulse_response || !is_valid_) { return false; } Index: all_pole_digital_filter.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/all_pole_digital_filter.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** all_pole_digital_filter.h 11 Oct 2016 06:38:27 -0000 1.4 --- all_pole_digital_filter.h 12 Oct 2016 12:14:38 -0000 1.5 *************** *** 64,70 **** // ! void Clear() { ! std::fill(signals_.begin(), signals_.end(), 0.0); ! } private: --- 64,68 ---- // ! void Clear() { std::fill(signals_.begin(), signals_.end(), 0.0); } private: *************** *** 81,85 **** // AllPoleDigitalFilter(int num_filter_order, bool transposition) ! : num_filter_order_(num_filter_order), transposition_(transposition), is_valid_(true) { if (num_filter_order_ < 0) { --- 79,84 ---- // AllPoleDigitalFilter(int num_filter_order, bool transposition) ! : num_filter_order_(num_filter_order), ! transposition_(transposition), is_valid_(true) { if (num_filter_order_ < 0) { *************** *** 92,112 **** // ! int GetNumFilterOrder() const { ! return num_filter_order_; ! } // ! bool GetTranspositionFlag() const { ! return transposition_; ! } // ! bool IsValid() const { ! return is_valid_; ! } // ! bool Run(const std::vector<double>& filter_coefficients, ! double filter_input, double* filter_output, AllPoleDigitalFilter::StoredSignals* signals) const; --- 91,105 ---- // ! int GetNumFilterOrder() const { return num_filter_order_; } // ! bool GetTranspositionFlag() const { return transposition_; } // ! bool IsValid() const { return is_valid_; } // ! bool Run(const std::vector<double>& filter_coefficients, double filter_input, ! double* filter_output, AllPoleDigitalFilter::StoredSignals* signals) const; Index: nrand.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/nrand.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nrand.cc 12 Oct 2016 04:31:24 -0000 1.3 --- nrand.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 59,62 **** --- 59,63 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " nrand - generate normal distributed random value" << std::endl; *************** *** 78,81 **** --- 79,83 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 96,101 **** if (!sptk::ConvertStringToInteger(optarg, &output_length)) { std::ostringstream error_message; ! error_message << ! "The argument for the -l option must be integer"; sptk::PrintErrorMessage("nrand", error_message); return 1; --- 98,102 ---- if (!sptk::ConvertStringToInteger(optarg, &output_length)) { std::ostringstream error_message; ! error_message << "The argument for the -l option must be integer"; sptk::PrintErrorMessage("nrand", error_message); return 1; *************** *** 106,111 **** if (!sptk::ConvertStringToInteger(optarg, &seed)) { std::ostringstream error_message; ! error_message << ! "The argument for the -s option must be integer"; sptk::PrintErrorMessage("nrand", error_message); return 1; --- 107,111 ---- if (!sptk::ConvertStringToInteger(optarg, &seed)) { std::ostringstream error_message; ! error_message << "The argument for the -s option must be integer"; sptk::PrintErrorMessage("nrand", error_message); return 1; *************** *** 116,121 **** if (!sptk::ConvertStringToDouble(optarg, &mean)) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; --- 116,120 ---- if (!sptk::ConvertStringToDouble(optarg, &mean)) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; *************** *** 125,133 **** case 'v': { double variance; ! if (!sptk::ConvertStringToDouble(optarg, &variance) || ! variance < 0.0) { std::ostringstream error_message; ! error_message << ! "The argument for the -v option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; --- 124,130 ---- case 'v': { double variance; ! if (!sptk::ConvertStringToDouble(optarg, &variance) || variance < 0.0) { std::ostringstream error_message; ! error_message << "The argument for the -v option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; *************** *** 140,145 **** standard_deviation < 0.0) { std::ostringstream error_message; ! error_message << ! "The argument for the -v option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; --- 137,141 ---- standard_deviation < 0.0) { std::ostringstream error_message; ! error_message << "The argument for the -v option must be double"; sptk::PrintErrorMessage("nrand", error_message); return 1; Index: levinson_durbin_recursion.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/levinson_durbin_recursion.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** levinson_durbin_recursion.h 8 Oct 2016 15:14:59 -0000 1.3 --- levinson_durbin_recursion.h 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- Buffer() {} virtual ~Buffer() {} + private: std::vector<double> c_; *************** *** 78,90 **** // ! double GetEpsilon() const { ! return epsilon_; ! } // bool Run(const std::vector<double>& autocorrelation_sequence, std::vector<double>* linear_predictive_coefficients, ! LevinsonDurbinRecursion::Buffer* buffer, ! bool* is_stable) const; private: --- 79,88 ---- // ! double GetEpsilon() const { return epsilon_; } // bool Run(const std::vector<double>& autocorrelation_sequence, std::vector<double>* linear_predictive_coefficients, ! LevinsonDurbinRecursion::Buffer* buffer, bool* is_stable) const; private: Index: acorr.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/acorr.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** acorr.cc 1 Apr 2016 09:05:46 -0000 1.3 --- acorr.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " acorr - obtain autocorrelation sequence" << std::endl; *************** *** 74,77 **** --- 75,79 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 91,96 **** frame_length <= 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -l option must be a positive integer"; sptk::PrintErrorMessage("acorr", error_message); return 1; --- 93,98 ---- frame_length <= 0) { std::ostringstream error_message; ! error_message ! << "The argument for the -l option must be a positive integer"; sptk::PrintErrorMessage("acorr", error_message); return 1; *************** *** 102,107 **** num_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("acorr", error_message); return 1; --- 104,109 ---- num_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("acorr", error_message); return 1; *************** *** 146,151 **** std::vector<double> output_sequence(output_length); ! while (sptk::ReadStream(false, frame_length, &input_sequence, ! &input_stream)) { if (!autocorrelation.Run(input_sequence, &output_sequence)) { std::ostringstream error_message; --- 148,153 ---- std::vector<double> output_sequence(output_length); ! while ( ! sptk::ReadStream(false, frame_length, &input_sequence, &input_stream)) { if (!autocorrelation.Run(input_sequence, &output_sequence)) { std::ostringstream error_message; Index: levdur.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/levdur.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** levdur.cc 8 Oct 2016 15:14:59 -0000 1.3 --- levdur.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 65,68 **** --- 65,69 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " levdur - solve an autocorrelation normal equation" << std::endl; *************** *** 91,94 **** --- 92,96 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 109,114 **** num_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("levdur", error_message); return 1; --- 111,116 ---- num_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("levdur", error_message); return 1; *************** *** 117,125 **** } case 'f': { ! if (!sptk::ConvertStringToDouble(optarg, &epsilon) || ! epsilon < 0.0) { std::ostringstream error_message; ! error_message << ! "The argument for the -f option must be a non-negative number"; sptk::PrintErrorMessage("levdur", error_message); return 1; --- 119,126 ---- } case 'f': { ! if (!sptk::ConvertStringToDouble(optarg, &epsilon) || epsilon < 0.0) { std::ostringstream error_message; ! error_message ! << "The argument for the -f option must be a non-negative number"; sptk::PrintErrorMessage("levdur", error_message); return 1; *************** *** 187,193 **** std::vector<double> linear_predictive_coefficients(length); ! for (int frame_index(0); ! sptk::ReadStream(false, length, &autocorrelation_sequence, ! &input_stream); ++frame_index) { bool is_stable(false); --- 188,193 ---- std::vector<double> linear_predictive_coefficients(length); ! for (int frame_index(0); sptk::ReadStream( ! false, length, &autocorrelation_sequence, &input_stream); ++frame_index) { bool is_stable(false); Index: autocorrelation.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/autocorrelation.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** autocorrelation.h 25 Mar 2016 06:04:51 -0000 1.2 --- autocorrelation.h 12 Oct 2016 12:14:38 -0000 1.3 *************** *** 68,74 **** // ! int GetNumOrder() const { ! return num_order_; ! } // --- 68,72 ---- // ! int GetNumOrder() const { return num_order_; } // Index: excitation_generation.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/excitation_generation.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** excitation_generation.h 12 Oct 2016 07:44:48 -0000 1.3 --- excitation_generation.h 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 55,61 **** public: // ! ExcitationGeneration( ! InputSourceInterpolationWithMagicNumber *input_source, ! RandomGenerationInterface *random_generation); // --- 55,60 ---- public: // ! ExcitationGeneration(InputSourceInterpolationWithMagicNumber *input_source, ! RandomGenerationInterface *random_generation); // *************** *** 63,73 **** // ! bool IsValid() const { ! return is_valid_; ! } // ! bool Get(double *excitation, double *pulse, double *noise, ! double *pitch); private: --- 62,69 ---- // ! bool IsValid() const { return is_valid_; } // ! bool Get(double *excitation, double *pulse, double *noise, double *pitch); private: Index: m_sequence_generation.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/m_sequence_generation.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** m_sequence_generation.cc 12 Oct 2016 04:31:24 -0000 1.4 --- m_sequence_generation.cc 12 Oct 2016 12:14:38 -0000 1.5 *************** *** 46,55 **** namespace { ! const int kInitialValue(0x55555555); ! const int kB0(0x00000001); ! const int kB28(0x10000000); ! const int kB31(0x80000000); ! const int kB31F(0x7fffffff); ! const int kZ(0x00000000); }; --- 46,55 ---- namespace { ! const int kInitialValue(0x55555555); ! const int kB0(0x00000001); ! const int kB28(0x10000000); ! const int kB31(0x80000000); ! const int kB31F(0x7fffffff); ! const int kZ(0x00000000); }; *************** *** 58,64 **** MSequenceGeneration::MSequenceGeneration() : x_(kInitialValue) {} ! void MSequenceGeneration::Reset() { ! x_ = kInitialValue; ! } bool MSequenceGeneration::Get(double *output) { --- 58,62 ---- MSequenceGeneration::MSequenceGeneration() : x_(kInitialValue) {} ! void MSequenceGeneration::Reset() { x_ = kInitialValue; } bool MSequenceGeneration::Get(double *output) { Index: lpc.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/lpc.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lpc.cc 8 Oct 2016 15:14:59 -0000 1.2 --- lpc.cc 12 Oct 2016 12:14:38 -0000 1.3 *************** *** 67,70 **** --- 67,71 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " lpc - LPC analysis using Levinson-Durbin recursion" << std::endl; *************** *** 93,96 **** --- 94,98 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 112,117 **** frame_length <= 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -l option must be a positive integer"; sptk::PrintErrorMessage("lpc", error_message); return 1; --- 114,119 ---- frame_length <= 0) { std::ostringstream error_message; ! error_message ! << "The argument for the -l option must be a positive integer"; sptk::PrintErrorMessage("lpc", error_message); return 1; *************** *** 123,128 **** num_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("lpc", error_message); return 1; --- 125,130 ---- num_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("lpc", error_message); return 1; *************** *** 131,139 **** } case 'f': { ! if (!sptk::ConvertStringToDouble(optarg, &epsilon) || ! epsilon < 0.0) { std::ostringstream error_message; ! error_message << ! "The argument for the -f option must be a non-negative number"; sptk::PrintErrorMessage("lpc", error_message); return 1; --- 133,140 ---- } case 'f': { ! if (!sptk::ConvertStringToDouble(optarg, &epsilon) || epsilon < 0.0) { std::ostringstream error_message; ! error_message ! << "The argument for the -f option must be a non-negative number"; sptk::PrintErrorMessage("lpc", error_message); return 1; --- NEW FILE: .clang-format --- BasedOnStyle: Google AllowShortBlocksOnASingleLine: false AllowShortBlocksOnASingleLine: false Index: input_source_preprocessing_for_filter_gain.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_preprocessing_for_filter_gain.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input_source_preprocessing_for_filter_gain.h 12 Oct 2016 11:13:51 -0000 1.3 --- input_source_preprocessing_for_filter_gain.h 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 46,50 **** #define SPTK_SRC_INPUT_SOURCE_PREPROCESSING_FOR_FILTER_GAIN_H_ ! #include <vector> // std::vector #include "input_source_interface.h" --- 46,50 ---- #define SPTK_SRC_INPUT_SOURCE_PREPROCESSING_FOR_FILTER_GAIN_H_ ! #include <vector> // std::vector #include "input_source_interface.h" *************** *** 67,72 **** InputSourceInterface* source) : gain_type_(gain_type), source_(source), is_valid_(true) { ! if (NULL == source || ! !source->IsValid()) { is_valid_ = false; return; --- 67,71 ---- InputSourceInterface* source) : gain_type_(gain_type), source_(source), is_valid_(true) { ! if (NULL == source || !source->IsValid()) { is_valid_ = false; return; *************** *** 78,89 **** // ! FilterGainType GetFilterGainType() const { ! return gain_type_; ! } // ! virtual bool IsValid() const { ! return is_valid_; ! } // --- 77,84 ---- // ! FilterGainType GetFilterGainType() const { return gain_type_; } // ! virtual bool IsValid() const { return is_valid_; } // Index: c2mpir.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/c2mpir.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** c2mpir.cc 12 Oct 2016 04:31:24 -0000 1.3 --- c2mpir.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " c2mpir - cepstrum to minimum phase impulse response" << std::endl; // NOLINT *************** *** 75,78 **** --- 76,80 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 92,97 **** num_input_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; --- 94,99 ---- num_input_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; *************** *** 103,108 **** num_output_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -M option must be a non-negative integer"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; --- 105,110 ---- num_output_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -M option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; *************** *** 114,119 **** num_output_order < 1) { std::ostringstream error_message; ! error_message << ! "The argument for the -M option must be bigger than 0"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; --- 116,121 ---- num_output_order < 1) { std::ostringstream error_message; ! error_message ! << "The argument for the -M option must be bigger than 0"; sptk::PrintErrorMessage("c2mpir", error_message); return 1; *************** *** 149,154 **** // prepare converter sptk::CepstrumToMinimumPhaseImpulseResponse ! cepstrum_to_minimum_phase_impulse_response(num_input_order, ! num_output_order); if (!cepstrum_to_minimum_phase_impulse_response.IsValid()) { std::ostringstream error_message; --- 151,156 ---- // prepare converter sptk::CepstrumToMinimumPhaseImpulseResponse ! cepstrum_to_minimum_phase_impulse_response(num_input_order, ! num_output_order); if (!cepstrum_to_minimum_phase_impulse_response.IsValid()) { std::ostringstream error_message; Index: excite.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/excite.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** excite.cc 12 Oct 2016 07:44:48 -0000 1.3 --- excite.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 64,67 **** --- 64,68 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " excite - generate excitation" << std::endl; *************** *** 86,89 **** --- 87,91 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 106,111 **** frame_period <= 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -p option must be a positive integer"; sptk::PrintErrorMessage("excite", error_message); return 1; --- 108,113 ---- frame_period <= 0) { std::ostringstream error_message; ! error_message ! << "The argument for the -p option must be a positive integer"; sptk::PrintErrorMessage("excite", error_message); return 1; *************** *** 117,122 **** interpolation_period < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -i option must be a non-negative integer"; sptk::PrintErrorMessage("excite", error_message); return 1; --- 119,124 ---- interpolation_period < 0) { std::ostringstream error_message; ! error_message << "The argument for the -i option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("excite", error_message); return 1; *************** *** 150,155 **** if (frame_period / 2 < interpolation_period) { std::ostringstream error_message; ! error_message << ! "Interpolation period should not be greater than half frame period"; sptk::PrintErrorMessage("excite", error_message); return 1; --- 152,157 ---- if (frame_period / 2 < interpolation_period) { std::ostringstream error_message; ! error_message ! << "Interpolation period should not be greater than half frame period"; sptk::PrintErrorMessage("excite", error_message); return 1; *************** *** 174,186 **** sptk::InputSourcePreprocessingForFilterGain input_source_preprocessing_for_filter_gain( ! sptk::InputSourcePreprocessingForFilterGain::FilterGainType::kLinear, ! &input_source_from_stream); sptk::InputSourceInterpolationWithMagicNumber input_source_interpolation_with_magic_number( ! frame_period, ! interpolation_period, ! false, ! kMagicNumberForUnvoicedFrame, ! &input_source_preprocessing_for_filter_gain); if (!input_source_interpolation_with_magic_number.IsValid()) { std::ostringstream error_message; --- 176,186 ---- sptk::InputSourcePreprocessingForFilterGain input_source_preprocessing_for_filter_gain( ! sptk::InputSourcePreprocessingForFilterGain::FilterGainType::kLinear, ! &input_source_from_stream); sptk::InputSourceInterpolationWithMagicNumber input_source_interpolation_with_magic_number( ! frame_period, interpolation_period, false, ! kMagicNumberForUnvoicedFrame, ! &input_source_preprocessing_for_filter_gain); if (!input_source_interpolation_with_magic_number.IsValid()) { std::ostringstream error_message; *************** *** 191,195 **** // Run excitation generation. ! sptk::RandomGenerationInterface *random_generation(NULL); try { if (use_normal_distributed_random_value) { --- 191,195 ---- // Run excitation generation. ! sptk::RandomGenerationInterface* random_generation(NULL); try { if (use_normal_distributed_random_value) { *************** *** 220,224 **** } } ! } catch (std::exception *e) { std::ostringstream error_message; error_message << "Unknown exception"; --- 220,224 ---- } } ! } catch (std::exception* e) { std::ostringstream error_message; error_message << "Unknown exception"; Index: levinson_durbin_recursion.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/levinson_durbin_recursion.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** levinson_durbin_recursion.cc 8 Oct 2016 15:14:59 -0000 1.4 --- levinson_durbin_recursion.cc 12 Oct 2016 12:14:38 -0000 1.5 *************** *** 53,62 **** const std::vector<double>& autocorrelation_sequence, std::vector<double>* linear_predictive_coefficients, ! LevinsonDurbinRecursion::Buffer* buffer, ! bool* is_stable) const { // check inputs if (autocorrelation_sequence.empty() || ! NULL == linear_predictive_coefficients || ! NULL == buffer) { return false; } --- 53,60 ---- const std::vector<double>& autocorrelation_sequence, std::vector<double>* linear_predictive_coefficients, ! LevinsonDurbinRecursion::Buffer* buffer, bool* is_stable) const { // check inputs if (autocorrelation_sequence.empty() || ! NULL == linear_predictive_coefficients || NULL == buffer) { return false; } Index: input_source_interpolation_with_magic_number.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_interpolation_with_magic_number.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input_source_interpolation_with_magic_number.h 12 Oct 2016 11:13:51 -0000 1.3 --- input_source_interpolation_with_magic_number.h 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 57,64 **** // InputSourceInterpolationWithMagicNumber( ! int frame_period, ! int interpolation_period, ! bool use_final_frame_for_exceeded_frame, ! double magic_number, InputSourceInterface* source); --- 57,62 ---- // InputSourceInterpolationWithMagicNumber( ! int frame_period, int interpolation_period, ! bool use_final_frame_for_exceeded_frame, double magic_number, InputSourceInterface* source); *************** *** 67,78 **** // ! int GetFramePeriod() const { ! return frame_period_; ! } // ! int GetInterpolationPeriod() const { ! return interpolation_period_; ! } // --- 65,72 ---- // ! int GetFramePeriod() const { return frame_period_; } // ! int GetInterpolationPeriod() const { return interpolation_period_; } // *************** *** 82,93 **** // ! double GetMagicNumber() const { ! return magic_number_; ! } // ! bool IsValid() const { ! return is_valid_; ! } // --- 76,83 ---- // ! double GetMagicNumber() const { return magic_number_; } // ! bool IsValid() const { return is_valid_; } // Index: sptk_utils.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/sptk_utils.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sptk_utils.h 29 Jul 2016 07:26:20 -0000 1.6 --- sptk_utils.h 12 Oct 2016 12:14:38 -0000 1.7 *************** *** 52,57 **** #ifndef DISALLOW_COPY_AND_ASSIGN ! #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ ! TypeName(const TypeName&); \ void operator=(const TypeName&) #endif --- 52,57 ---- #ifndef DISALLOW_COPY_AND_ASSIGN ! #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ ! TypeName(const TypeName&); \ void operator=(const TypeName&) #endif *************** *** 66,71 **** std::istream* input_stream); bool WriteStream(double data_to_write, std::ostream* output_stream); ! bool WriteStream(int write_size, ! const std::vector<double>& sequence_to_write, std::ostream* output_stream); const char* ConvertBooleanToString(bool input); --- 66,70 ---- std::istream* input_stream); bool WriteStream(double data_to_write, std::ostream* output_stream); ! bool WriteStream(int write_size, const std::vector<double>& sequence_to_write, std::ostream* output_stream); const char* ConvertBooleanToString(bool input); Index: normal_distributed_random_value_generation.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/normal_distributed_random_value_generation.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** normal_distributed_random_value_generation.cc 12 Oct 2016 04:31:24 -0000 1.3 --- normal_distributed_random_value_generation.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 66,70 **** NormalDistributedRandomValueGeneration::NormalDistributedRandomValueGeneration( ! int seed) : seed_(seed), switch_(true) { next_ = static_cast<std::uint64_t>(seed_); } --- 66,71 ---- NormalDistributedRandomValueGeneration::NormalDistributedRandomValueGeneration( ! int seed) ! : seed_(seed), switch_(true) { next_ = static_cast<std::uint64_t>(seed_); } Index: fast_fourier_transform.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/fast_fourier_transform.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fast_fourier_transform.h 8 Feb 2016 11:42:45 -0000 1.5 --- fast_fourier_transform.h 12 Oct 2016 12:14:38 -0000 1.6 *************** *** 64,80 **** // ! void SetInverseFlag(bool inverse) { ! inverse_ = inverse; ! } // ! int GetNumDimension() const { ! return num_dimension_; ! } // ! bool GetInverseFlag() const { ! return inverse_; ! } // --- 64,74 ---- // ! void SetInverseFlag(bool inverse) { inverse_ = inverse; } // ! int GetNumDimension() const { return num_dimension_; } // ! bool GetInverseFlag() const { return inverse_; } // Index: fast_fourier_transform.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/fast_fourier_transform.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fast_fourier_transform.cc 29 Jul 2016 07:26:20 -0000 1.8 --- fast_fourier_transform.cc 12 Oct 2016 12:14:38 -0000 1.9 *************** *** 78,83 **** std::vector<double>* imaginary_part_output) const { // check sine table and input ! if (sine_table_.empty() || ! NULL == real_part_output || NULL == imaginary_part_output) { return false; --- 78,82 ---- std::vector<double>* imaginary_part_output) const { // check sine table and input ! if (sine_table_.empty() || NULL == real_part_output || NULL == imaginary_part_output) { return false; *************** *** 85,90 **** // prepare memories ! if (real_part_output->size() != ! static_cast<std::size_t>(num_dimension_)) { real_part_output->resize(num_dimension_); } --- 84,88 ---- // prepare memories ! if (real_part_output->size() != static_cast<std::size_t>(num_dimension_)) { real_part_output->resize(num_dimension_); } *************** *** 99,114 **** // get values and fill zero ! std::copy(real_part_input.begin(), ! real_part_input.end(), real_part_output->begin()); std::fill(real_part_output->begin() + real_part_input.size(), ! real_part_output->end(), ! 0.0); ! std::copy(imaginary_part_input.begin(), ! imaginary_part_input.end(), imaginary_part_output->begin()); std::fill(imaginary_part_output->begin() + imaginary_part_input.size(), ! imaginary_part_output->end(), ! 0.0); double* x; --- 97,108 ---- // get values and fill zero ! std::copy(real_part_input.begin(), real_part_input.end(), real_part_output->begin()); std::fill(real_part_output->begin() + real_part_input.size(), ! real_part_output->end(), 0.0); ! std::copy(imaginary_part_input.begin(), imaginary_part_input.end(), imaginary_part_output->begin()); std::fill(imaginary_part_output->begin() + imaginary_part_input.size(), ! imaginary_part_output->end(), 0.0); double* x; Index: freqt.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/freqt.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** freqt.cc 1 Apr 2016 09:05:46 -0000 1.5 --- freqt.cc 12 Oct 2016 12:14:38 -0000 1.6 *************** *** 60,63 **** --- 60,64 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " freqt - frequency transform" << std::endl; *************** *** 78,81 **** --- 79,83 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 97,102 **** num_input_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("freqt", error_message); return 1; --- 99,104 ---- num_input_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("freqt", error_message); return 1; *************** *** 108,113 **** num_output_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -M option must be a non-negative integer"; sptk::PrintErrorMessage("freqt", error_message); return 1; --- 110,115 ---- num_output_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -M option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("freqt", error_message); return 1; Index: input_source_interpolation.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_interpolation.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input_source_interpolation.cc 12 Oct 2016 11:13:51 -0000 1.3 --- input_source_interpolation.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 52,59 **** InputSourceInterpolation::InputSourceInterpolation( ! int frame_period, ! int interpolation_period, ! bool use_final_frame_for_exceeded_frame, ! InputSourceInterface* source) : frame_period_(frame_period), interpolation_period_(interpolation_period), --- 52,57 ---- InputSourceInterpolation::InputSourceInterpolation( ! int frame_period, int interpolation_period, ! bool use_final_frame_for_exceeded_frame, InputSourceInterface* source) : frame_period_(frame_period), interpolation_period_(interpolation_period), *************** *** 65,72 **** source_(source), is_valid_(true) { ! if (frame_period <= 0 || ! interpolation_period < 0 || ! frame_period / 2 < interpolation_period || ! NULL == source || !source->IsValid()) { is_valid_ = false; --- 63,68 ---- source_(source), is_valid_(true) { ! if (frame_period <= 0 || interpolation_period < 0 || ! frame_period / 2 < interpolation_period || NULL == source || !source->IsValid()) { is_valid_ = false; *************** *** 84,89 **** if (!source_->Get(&next_data_)) { next_data_.resize(data_length_); ! std::copy(curr_data_.begin(), curr_data_.end(), ! next_data_.begin()); remained_num_samples_ = 1; } --- 80,84 ---- if (!source_->Get(&next_data_)) { next_data_.resize(data_length_); ! std::copy(curr_data_.begin(), curr_data_.end(), next_data_.begin()); remained_num_samples_ = 1; } *************** *** 103,108 **** bool InputSourceInterpolation::Get(std::vector<double>* buffer) { ! if (NULL == buffer || ! !is_valid_) { return false; } --- 98,102 ---- bool InputSourceInterpolation::Get(std::vector<double>* buffer) { ! if (NULL == buffer || !is_valid_) { return false; } *************** *** 116,121 **** } ! std::copy(curr_data_.begin(), curr_data_.end(), ! buffer->begin()); --remained_num_samples_; --- 110,114 ---- } ! std::copy(curr_data_.begin(), curr_data_.end(), buffer->begin()); --remained_num_samples_; *************** *** 133,142 **** if (0 == point_index_in_frame_ % frame_period_) { // Update current and next data. ! std::copy(next_data_.begin(), next_data_.end(), ! curr_data_.begin()); if (!source_->Get(&next_data_)) { // Use the final data until the end of input sequence. ! std::copy(curr_data_.begin(), curr_data_.end(), ! next_data_.begin()); remained_num_samples_ = 1; } else { --- 126,133 ---- if (0 == point_index_in_frame_ % frame_period_) { // Update current and next data. ! std::copy(next_data_.begin(), next_data_.end(), curr_data_.begin()); if (!source_->Get(&next_data_)) { // Use the final data until the end of input sequence. ! std::copy(curr_data_.begin(), curr_data_.end(), next_data_.begin()); remained_num_samples_ = 1; } else { *************** *** 154,164 **** interpolation_period_)) { // Interpolate adjacent data. ! std::transform(curr_data_.begin(), curr_data_.end(), ! increment_.begin(), curr_data_.begin(), ! std::plus<double>()); } else if (0 == interpolation_period_ && frame_period_ / 2 == point_index_in_frame_) { ! std::copy(next_data_.begin(), next_data_.end(), ! curr_data_.begin()); } --- 145,153 ---- interpolation_period_)) { // Interpolate adjacent data. ! std::transform(curr_data_.begin(), curr_data_.end(), increment_.begin(), ! curr_data_.begin(), std::plus<double>()); } else if (0 == interpolation_period_ && frame_period_ / 2 == point_index_in_frame_) { ! std::copy(next_data_.begin(), next_data_.end(), curr_data_.begin()); } Index: input_source_preprocessing_for_filter_gain.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_preprocessing_for_filter_gain.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input_source_preprocessing_for_filter_gain.cc 11 Oct 2016 06:01:29 -0000 1.2 --- input_source_preprocessing_for_filter_gain.cc 12 Oct 2016 12:14:38 -0000 1.3 *************** *** 51,58 **** namespace sptk { ! bool InputSourcePreprocessingForFilterGain::Get( ! std::vector<double>* buffer) { ! if (NULL == buffer || ! !is_valid_) { return false; } --- 51,56 ---- namespace sptk { ! bool InputSourcePreprocessingForFilterGain::Get(std::vector<double>* buffer) { ! if (NULL == buffer || !is_valid_) { return false; } *************** *** 67,71 **** break; } ! case InputSourcePreprocessingForFilterGain::FilterGainType::kUnityForAllZeroFilter: { // NOLINT if (0.0 == buffer->at(0)) return false; const double inverse_of_b0(1.0 / buffer->at(0)); --- 65,70 ---- break; } ! case InputSourcePreprocessingForFilterGain::FilterGainType:: ! kUnityForAllZeroFilter: { if (0.0 == buffer->at(0)) return false; const double inverse_of_b0(1.0 / buffer->at(0)); *************** *** 81,87 **** break; } ! default: { ! return false; ! } } --- 80,84 ---- break; } ! default: { return false; } } Index: frequency_transform.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/frequency_transform.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** frequency_transform.h 25 Mar 2016 06:04:51 -0000 1.7 --- frequency_transform.h 12 Oct 2016 12:14:38 -0000 1.8 *************** *** 58,61 **** --- 58,62 ---- Buffer() {} virtual ~Buffer() {} + private: std::vector<double> d_; *************** *** 79,95 **** // ! void SetAlpha(double alpha) { ! alpha_ = alpha; ! } // ! int GetNumOutputOrder() const { ! return num_output_order_; ! } // ! double GetAlpha() const { ! return alpha_; ! } // --- 80,90 ---- // ! void SetAlpha(double alpha) { alpha_ = alpha; } // ! int GetNumOutputOrder() const { return num_output_order_; } // ! double GetAlpha() const { return alpha_; } // Index: excitation_generation.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/excitation_generation.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** excitation_generation.cc 12 Oct 2016 07:44:48 -0000 1.3 --- excitation_generation.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 53,60 **** InputSourceInterpolationWithMagicNumber *input_source, RandomGenerationInterface *random_generation) ! : input_source_(input_source), random_generation_(random_generation), ! is_valid_(true), phase_(1.0) { ! if (NULL == input_source || ! NULL == random_generation || !input_source->IsValid()) { is_valid_ = false; --- 53,61 ---- InputSourceInterpolationWithMagicNumber *input_source, RandomGenerationInterface *random_generation) ! : input_source_(input_source), ! random_generation_(random_generation), ! is_valid_(true), ! phase_(1.0) { ! if (NULL == input_source || NULL == random_generation || !input_source->IsValid()) { is_valid_ = false; *************** *** 62,67 **** } ! bool ExcitationGeneration::Get(double *excitation, ! double *pulse, double *noise, double *pitch) { if (!is_valid_) { return false; --- 63,68 ---- } ! bool ExcitationGeneration::Get(double *excitation, double *pulse, double *noise, ! double *pitch) { if (!is_valid_) { return false; Index: input_source_interpolation_with_magic_number.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/input_source_interpolation_with_magic_number.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input_source_interpolation_with_magic_number.cc 12 Oct 2016 11:13:51 -0000 1.3 --- input_source_interpolation_with_magic_number.cc 12 Oct 2016 12:14:38 -0000 1.4 *************** *** 60,68 **** InputSourceInterpolationWithMagicNumber:: InputSourceInterpolationWithMagicNumber( ! int frame_period, ! int interpolation_period, ! bool use_final_frame_for_exceeded_frame, ! double magic_number, ! InputSourceInterface* source) : frame_period_(frame_period), interpolation_period_(interpolation_period), --- 60,66 ---- InputSourceInterpolationWithMagicNumber:: InputSourceInterpolationWithMagicNumber( ! int frame_period, int interpolation_period, ! bool use_final_frame_for_exceeded_frame, double magic_number, ! InputSourceInterface* source) : frame_period_(frame_period), interpolation_period_(interpolation_period), *************** *** 75,82 **** source_(source), is_valid_(true) { ! if (frame_period <= 0 || ! interpolation_period < 0 || ! frame_period / 2 < interpolation_period || ! NULL == source || !source->IsValid()) { is_valid_ = false; --- 73,78 ---- source_(source), is_valid_(true) { ! if (frame_period <= 0 || interpolation_period < 0 || ! frame_period / 2 < interpolation_period || NULL == source || !source->IsValid()) { is_valid_ = false; *************** *** 94,99 **** if (!source_->Get(&next_data_)) { next_data_.resize(data_length_); ! std::copy(curr_data_.begin(), curr_data_.end(), ! next_data_.begin()); remained_num_samples_ = 1; } --- 90,94 ---- if (!source_->Get(&next_data_)) { next_data_.resize(data_length_); ! std::copy(curr_data_.begin(), curr_data_.end(), next_data_.begin()); remained_num_samples_ = 1; } *************** *** 117,122 **** bool InputSourceInterpolationWithMagicNumber::Get(std::vector<double>* buffer) { ! if (NULL == buffer || ! !is_valid_) { return false; } --- 112,116 ---- bool InputSourceInterpolationWithMagicNumber::Get(std::vector<double>* buffer) { ! if (NULL == buffer || !is_valid_) { return false; } *************** *** 130,135 **** } ! std::copy(curr_data_.begin(), curr_data_.end(), ! buffer->begin()); --remained_num_samples_; --- 124,128 ---- } ! std::copy(curr_data_.begin(), curr_data_.end(), buffer->begin()); --remained_num_samples_; *************** *** 147,156 **** if (0 == point_index_in_frame_ % frame_period_) { // Update current and next data. ! std::copy(next_data_.begin(), next_data_.end(), ! curr_data_.begin()); if (!source_->Get(&next_data_)) { // Use the final data until the end of input sequence. ! std::copy(curr_data_.begin(), curr_data_.end(), ! next_data_.begin()); remained_num_samples_ = 1; } else { --- 140,147 ---- if (0 == point_index_in_frame_ % frame_period_) { // Update current and next data. ! std::copy(next_data_.begin(), next_data_.end(), curr_data_.begin()); if (!source_->Get(&next_data_)) { // Use the final data until the end of input sequence. ! std::copy(curr_data_.begin(), curr_data_.end(), next_data_.begin()); remained_num_samples_ = 1; } else { *************** *** 177,182 **** } else if (0 == interpolation_period_ && frame_period_ / 2 == point_index_in_frame_) { ! std::copy(next_data_.begin(), next_data_.end(), ! curr_data_.begin()); } --- 168,172 ---- } else if (0 == interpolation_period_ && frame_period_ / 2 == point_index_in_frame_) { ! std::copy(next_data_.begin(), next_data_.end(), curr_data_.begin()); } Index: zerodf.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/zerodf.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zerodf.cc 11 Oct 2016 06:38:27 -0000 1.2 --- zerodf.cc 12 Oct 2016 12:14:38 -0000 1.3 *************** *** 64,67 **** --- 64,68 ---- void PrintUsage(std::ostream* stream) { + // clang-format off *stream << std::endl; *stream << " zerodf - all-zero digital filter for speech synthesis" << std::endl; // NOLINT *************** *** 85,88 **** --- 86,90 ---- *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; + // clang-format on } *************** *** 105,110 **** num_filter_order < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -m option must be a non-negative integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; --- 107,112 ---- num_filter_order < 0) { std::ostringstream error_message; ! error_message << "The argument for the -m option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; *************** *** 116,121 **** frame_period <= 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -p option must be a positive integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; --- 118,123 ---- frame_period <= 0) { std::ostringstream error_message; ! error_message ! << "The argument for the -p option must be a positive integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; *************** *** 127,132 **** interpolation_period < 0) { std::ostringstream error_message; ! error_message << ! "The argument for the -i option must be a non-negative integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; --- 129,134 ---- interpolation_period < 0) { std::ostringstream error_message; ! error_message << "The argument for the -i option must be a " ! << "non-negative integer"; sptk::PrintErrorMessage("zerodf", error_message); return 1; *************** *** 155,160 **** if (frame_period / 2 < interpolation_period) { std::ostringstream error_message; ! error_message << ! "Interpolation period should not be greater than half frame period"; sptk::PrintErrorMessage("zerodf", error_message); return 1; --- 157,162 ---- if (frame_period / 2 < interpolation_period) { std::ostringstream error_message; ! error_message ! << "Interpolation period should not be greater than half frame period"; sptk::PrintErrorMessage("zerodf", error_message); return 1; *************** *** 206,218 **** &stream_for_filter_coefficients); const sptk::InputSourcePreprocessingForFilterGain::FilterGainType gain_type( ! gain_flag ? ! sptk::InputSourcePreprocessingForFilterGain::FilterGainType::kLinear : ! sptk::InputSourcePreprocessingForFilterGain::FilterGainType::kUnityForAllZeroFilter); // NOLINT s... [truncated message content] |