Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/test/RTPencode.cc |
| diff --git a/webrtc/modules/audio_coding/neteq/test/RTPencode.cc b/webrtc/modules/audio_coding/neteq/test/RTPencode.cc |
| index 1aacb401b7650e65ce129fa84b799ad352281959..6d474994ada34738f3ae2299231c7aa51e11a0a2 100644 |
| --- a/webrtc/modules/audio_coding/neteq/test/RTPencode.cc |
| +++ b/webrtc/modules/audio_coding/neteq/test/RTPencode.cc |
| @@ -454,7 +454,7 @@ int main(int argc, char* argv[]) { |
| printf("Packet size %d must be positive", packet_size); |
| return -1; |
| } |
| - printf("Packet size: %i\n", packet_size); |
| + printf("Packet size: %d\n", packet_size); |
| // check for stereo |
| if (argv[4][strlen(argv[4]) - 1] == '*') { |
| @@ -1572,29 +1572,31 @@ int NetEQTest_encode(int coder, |
| if (useVAD) { |
| *vad = 0; |
| + int sampleRate_10 = 10 * sampleRate / 1000; |
| + int sampleRate_20 = 20 * sampleRate / 1000; |
| + int sampleRate_30 = 30 * sampleRate / 1000; |
| for (int k = 0; k < numChannels; k++) { |
| tempLen = frameLen; |
| tempdata = &indata[k * frameLen]; |
| int localVad = 0; |
| /* Partition the signal and test each chunk for VAD. |
| All chunks must be VAD=0 to produce a total VAD=0. */ |
| - while (tempLen >= 10 * sampleRate / 1000) { |
| - if ((tempLen % 30 * sampleRate / 1000) == |
| - 0) { // tempLen is multiple of 30ms |
| + while (tempLen >= sampleRate_10) { |
| + if ((tempLen % sampleRate_30) == 0) { // tempLen is multiple of 30ms |
|
kwiberg-webrtc
2015/07/12 18:40:30
I don't think this means the same thing as the old
Peter Kasting
2015/07/13 02:41:24
Yes. Which suggests the test is insufficient, sin
Peter Kasting
2015/07/13 22:25:04
It looks to me as if the behavior of this code wil
kwiberg-webrtc
2015/07/15 01:10:53
OK. As long as it doesn't break the test, it can h
|
| localVad |= WebRtcVad_Process(VAD_inst[k], sampleRate, tempdata, |
| - 30 * sampleRate / 1000); |
| - tempdata += 30 * sampleRate / 1000; |
| - tempLen -= 30 * sampleRate / 1000; |
| - } else if (tempLen >= 20 * sampleRate / 1000) { // tempLen >= 20ms |
| + sampleRate_30); |
| + tempdata += sampleRate_30; |
| + tempLen -= sampleRate_30; |
| + } else if (tempLen >= sampleRate_20) { // tempLen >= 20ms |
| localVad |= WebRtcVad_Process(VAD_inst[k], sampleRate, tempdata, |
| - 20 * sampleRate / 1000); |
| - tempdata += 20 * sampleRate / 1000; |
| - tempLen -= 20 * sampleRate / 1000; |
| + sampleRate_20); |
| + tempdata += sampleRate_20; |
| + tempLen -= sampleRate_20; |
| } else { // use 10ms |
| localVad |= WebRtcVad_Process(VAD_inst[k], sampleRate, tempdata, |
| - 10 * sampleRate / 1000); |
| - tempdata += 10 * sampleRate / 1000; |
| - tempLen -= 10 * sampleRate / 1000; |
| + sampleRate_10); |
| + tempdata += sampleRate_10; |
| + tempLen -= sampleRate_10; |
| } |
| } |