# HG changeset patch # User ronw@google.com # Date 1369328198 0 # Node ID 443b522fb593b8f8c4c04e4eab4beb504b452ad7 # Parent 2341bb90adb892ab8d701b4ed9c569f3d8f0ce55 Remove dependency on google logging library in favor of simple asserts. diff -r 2341bb90adb8 -r 443b522fb593 trunk/carfac/agc_coeffs.cc --- a/trunk/carfac/agc_coeffs.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/agc_coeffs.cc Thu May 23 16:56:38 2013 +0000 @@ -20,6 +20,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "agc_coeffs.h" void AGCCoeffs::Design(const AGCParams& agc_params, const int stage, @@ -62,17 +64,12 @@ n_taps = 5; break; case 5: - n_iterations ++; - if (n_iterations > 16){ - // This implies too many iterations, so we shoud indicate and error. - CHECK_GE(16, n_iterations) << - "Too many iterations needed in AGC spatial smoothing."; - } + n_iterations++; + assert(n_iterations < 16 && + "Too many iterations needed in AGC spatial smoothing."); break; default: - // This means a bad n_taps has been provided, so there should again be - // an error. - CHECK_EQ(5, n_taps) << "Bad n_taps; should be 3 or 5."; + assert(true && "Bad n_taps; should be 3 or 5."); break; } // The smoothing function is a space-domain smoothing, but it considered @@ -124,4 +121,4 @@ agc_mix_coeffs_ = stage == 0 ? 0 : mix_coeff / (tau * (fs /decim_)); agc_gain_ = total_dc_gain; detect_scale_ = 1 / total_dc_gain; -} \ No newline at end of file +} diff -r 2341bb90adb8 -r 443b522fb593 trunk/carfac/carfac_common.h --- a/trunk/carfac/carfac_common.h Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/carfac_common.h Thu May 23 16:56:38 2013 +0000 @@ -53,8 +53,6 @@ #include // is used in place of 2d Eigen Arrays for the AGC memory #include -// The Google Logging library is included for error handling. -#include // The Eigen library is used extensively for 1d and 2d floating point arrays. // For more information, see: http://eigen.tuxfamily.org #include @@ -90,4 +88,4 @@ // values. This is here because it is called both in design and run phases. FloatArray CARFACDetect (const FloatArray& x); -#endif \ No newline at end of file +#endif diff -r 2341bb90adb8 -r 443b522fb593 trunk/carfac/ear.cc --- a/trunk/carfac/ear.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/ear.cc Thu May 23 16:56:38 2013 +0000 @@ -20,6 +20,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "ear.h" // The 'InitEar' function takes a set of model parameters and initializes the @@ -275,9 +277,8 @@ (fir_coeffs[2] * (ss_tap2 + ss_tap4)); break; default: + assert(true && "Bad n_taps in AGCSpatialSmooth; should be 3 or 5."); break; - CHECK_EQ(5, n_taps) << - "Bad n_taps in AGCSpatialSmooth; should be 3 or 5."; } } else { stage_state = AGCSmoothDoubleExponential(stage_state, @@ -318,4 +319,4 @@ return (1 - 2 * r * car_coeffs_.a0_coeffs_ + (r * r)) / (1 - 2 * r * car_coeffs_.a0_coeffs_ + car_coeffs_.h_coeffs_ * r * car_coeffs_.c0_coeffs_ + (r * r)); -} \ No newline at end of file +} diff -r 2341bb90adb8 -r 443b522fb593 trunk/carfac/main.cc --- a/trunk/carfac/main.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/main.cc Thu May 23 16:56:38 2013 +0000 @@ -35,8 +35,6 @@ int main(int argc, char **argv) { // This initializes the GoogleTest unit testing framework. ::testing::InitGoogleTest(&argc, argv); - // This initializes Google's logging library. - google::InitGoogleLogging(argv[0]); // This runs all of the tests that we've defined above. return RUN_ALL_TESTS(); -} \ No newline at end of file +}