| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 ComfortNoiseEncoder::ComfortNoiseEncoder(int fs, int interval, int quality) | 212 ComfortNoiseEncoder::ComfortNoiseEncoder(int fs, int interval, int quality) |
| 213 : enc_nrOfCoefs_(quality), | 213 : enc_nrOfCoefs_(quality), |
| 214 enc_sampfreq_(fs), | 214 enc_sampfreq_(fs), |
| 215 enc_interval_(interval), | 215 enc_interval_(interval), |
| 216 enc_msSinceSid_(0), | 216 enc_msSinceSid_(0), |
| 217 enc_Energy_(0), | 217 enc_Energy_(0), |
| 218 enc_reflCoefs_{0}, | 218 enc_reflCoefs_{0}, |
| 219 enc_corrVector_{0}, | 219 enc_corrVector_{0}, |
| 220 enc_seed_(7777) /* For debugging only. */ { | 220 enc_seed_(7777) /* For debugging only. */ { |
| 221 RTC_CHECK(quality <= WEBRTC_CNG_MAX_LPC_ORDER && quality > 0); | 221 RTC_CHECK_GT(quality, 0); |
| 222 RTC_CHECK_LE(quality, WEBRTC_CNG_MAX_LPC_ORDER); |
| 222 /* Needed to get the right function pointers in SPLIB. */ | 223 /* Needed to get the right function pointers in SPLIB. */ |
| 223 WebRtcSpl_Init(); | 224 WebRtcSpl_Init(); |
| 224 } | 225 } |
| 225 | 226 |
| 226 void ComfortNoiseEncoder::Reset(int fs, int interval, int quality) { | 227 void ComfortNoiseEncoder::Reset(int fs, int interval, int quality) { |
| 227 RTC_CHECK(quality <= WEBRTC_CNG_MAX_LPC_ORDER && quality > 0); | 228 RTC_CHECK_GT(quality, 0); |
| 229 RTC_CHECK_LE(quality, WEBRTC_CNG_MAX_LPC_ORDER); |
| 228 enc_nrOfCoefs_ = quality; | 230 enc_nrOfCoefs_ = quality; |
| 229 enc_sampfreq_ = fs; | 231 enc_sampfreq_ = fs; |
| 230 enc_interval_ = interval; | 232 enc_interval_ = interval; |
| 231 enc_msSinceSid_ = 0; | 233 enc_msSinceSid_ = 0; |
| 232 enc_Energy_ = 0; | 234 enc_Energy_ = 0; |
| 233 for (auto& c : enc_reflCoefs_) | 235 for (auto& c : enc_reflCoefs_) |
| 234 c = 0; | 236 c = 0; |
| 235 for (auto& c : enc_corrVector_) | 237 for (auto& c : enc_corrVector_) |
| 236 c = 0; | 238 c = 0; |
| 237 enc_seed_ = 7777; /* For debugging only. */ | 239 enc_seed_ = 7777; /* For debugging only. */ |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 anyptr = any; | 435 anyptr = any; |
| 434 for (i = 0; i < (m + 2); i++) { | 436 for (i = 0; i < (m + 2); i++) { |
| 435 *aptr++ = *anyptr++; | 437 *aptr++ = *anyptr++; |
| 436 } | 438 } |
| 437 } | 439 } |
| 438 } | 440 } |
| 439 | 441 |
| 440 } // namespace | 442 } // namespace |
| 441 | 443 |
| 442 } // namespace webrtc | 444 } // namespace webrtc |
| OLD | NEW |