OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 agc_stat.Reset(); | 285 agc_stat.Reset(); |
286 } | 286 } |
287 true_vad_index++; | 287 true_vad_index++; |
288 | 288 |
289 DitherSilence(&frame); | 289 DitherSilence(&frame); |
290 | 290 |
291 ret_val = agc_stat.AddAudio(frame, p_video, agc_vad); | 291 ret_val = agc_stat.AddAudio(frame, p_video, agc_vad); |
292 ASSERT_GE(ret_val, 0); | 292 ASSERT_GE(ret_val, 0); |
293 | 293 |
294 if (ret_val > 0) { | 294 if (ret_val > 0) { |
295 ASSERT_TRUE(ret_val == true_vad_index); | 295 ASSERT_EQ(true_vad_index, ret_val); |
296 for (int n = 0; n < ret_val; n++) { | 296 for (int n = 0; n < ret_val; n++) { |
297 if (true_vad[n] == 1) { | 297 if (true_vad[n] == 1) { |
298 total_active++; | 298 total_active++; |
299 if (previous_true_vad == 0) { | 299 if (previous_true_vad == 0) { |
300 num_onsets++; | 300 num_onsets++; |
301 onset = true; | 301 onset = true; |
302 } | 302 } |
303 if (agc_vad[n] == 0) { | 303 if (agc_vad[n] == 0) { |
304 total_missed_detection++; | 304 total_missed_detection++; |
305 if (onset) | 305 if (onset) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 " one probability per frame.\n" | 375 " one probability per frame.\n" |
376 "\nUsage:\n\n" | 376 "\nUsage:\n\n" |
377 "activity_metric input_pcm [options]\n" | 377 "activity_metric input_pcm [options]\n" |
378 "where 'input_pcm' is the input audio sampled at 16 kHz in 16 bits " | 378 "where 'input_pcm' is the input audio sampled at 16 kHz in 16 bits " |
379 "format.\n\n"; | 379 "format.\n\n"; |
380 google::SetUsageMessage(kUsage); | 380 google::SetUsageMessage(kUsage); |
381 google::ParseCommandLineFlags(&argc, &argv, true); | 381 google::ParseCommandLineFlags(&argc, &argv, true); |
382 webrtc::void_main(argc, argv); | 382 webrtc::void_main(argc, argv); |
383 return 0; | 383 return 0; |
384 } | 384 } |
OLD | NEW |