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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 RTC_DCHECK_GT(inst->anaLen2, 0); | 1538 RTC_DCHECK_GT(inst->anaLen2, 0); |
1539 RTC_DCHECK_EQ(0, inst->anaLen % 16); | 1539 RTC_DCHECK_EQ(0, inst->anaLen % 16); |
1540 RTC_DCHECK_EQ(0, inst->anaLen2 % 8); | 1540 RTC_DCHECK_EQ(0, inst->anaLen2 % 8); |
1541 RTC_DCHECK_GT(inst->blockLen10ms, 0); | 1541 RTC_DCHECK_GT(inst->blockLen10ms, 0); |
1542 RTC_DCHECK_EQ(0, inst->blockLen10ms % 16); | 1542 RTC_DCHECK_EQ(0, inst->blockLen10ms % 16); |
1543 RTC_DCHECK_EQ(inst->magnLen, inst->anaLen2 + 1); | 1543 RTC_DCHECK_EQ(inst->magnLen, inst->anaLen2 + 1); |
1544 | 1544 |
1545 #ifdef NS_FILEDEBUG | 1545 #ifdef NS_FILEDEBUG |
1546 if (fwrite(spframe, sizeof(short), | 1546 if (fwrite(spframe, sizeof(short), |
1547 inst->blockLen10ms, inst->infile) != inst->blockLen10ms) { | 1547 inst->blockLen10ms, inst->infile) != inst->blockLen10ms) { |
1548 RTC_DCHECK(false); | 1548 RTC_NOTREACHED(); |
1549 } | 1549 } |
1550 #endif | 1550 #endif |
1551 | 1551 |
1552 // Check that initialization has been done | 1552 // Check that initialization has been done |
1553 RTC_DCHECK_EQ(1, inst->initFlag); | 1553 RTC_DCHECK_EQ(1, inst->initFlag); |
1554 RTC_DCHECK_LE(num_bands - 1, NUM_HIGH_BANDS_MAX); | 1554 RTC_DCHECK_LE(num_bands - 1, NUM_HIGH_BANDS_MAX); |
1555 | 1555 |
1556 const short* const* speechFrameHB = NULL; | 1556 const short* const* speechFrameHB = NULL; |
1557 short* const* outFrameHB = NULL; | 1557 short* const* outFrameHB = NULL; |
1558 size_t num_high_bands = 0; | 1558 size_t num_high_bands = 0; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 for (i = 0; i < inst->magnLen; i++) { | 2018 for (i = 0; i < inst->magnLen; i++) { |
2019 inst->prevNoiseU32[i] = noiseU32[i] >> (5 - norm32no1); // Q(qNoise+11) | 2019 inst->prevNoiseU32[i] = noiseU32[i] >> (5 - norm32no1); // Q(qNoise+11) |
2020 inst->prevMagnU16[i] = magnU16[i]; // Q(qMagn) | 2020 inst->prevMagnU16[i] = magnU16[i]; // Q(qMagn) |
2021 } | 2021 } |
2022 } | 2022 } |
2023 | 2023 |
2024 WebRtcNsx_DataSynthesis(inst, outFrame[0]); | 2024 WebRtcNsx_DataSynthesis(inst, outFrame[0]); |
2025 #ifdef NS_FILEDEBUG | 2025 #ifdef NS_FILEDEBUG |
2026 if (fwrite(outframe, sizeof(short), | 2026 if (fwrite(outframe, sizeof(short), |
2027 inst->blockLen10ms, inst->outfile) != inst->blockLen10ms) { | 2027 inst->blockLen10ms, inst->outfile) != inst->blockLen10ms) { |
2028 RTC_DCHECK(false); | 2028 RTC_NOTREACHED(); |
2029 } | 2029 } |
2030 #endif | 2030 #endif |
2031 | 2031 |
2032 //for H band: | 2032 //for H band: |
2033 // only update data buffer, then apply time-domain gain is applied derived fro
m L band | 2033 // only update data buffer, then apply time-domain gain is applied derived fro
m L band |
2034 if (num_bands > 1) { | 2034 if (num_bands > 1) { |
2035 // update analysis buffer for H band | 2035 // update analysis buffer for H band |
2036 // append new data to buffer FX | 2036 // append new data to buffer FX |
2037 for (i = 0; i < num_high_bands; ++i) { | 2037 for (i = 0; i < num_high_bands; ++i) { |
2038 memcpy(inst->dataBufHBFX[i], inst->dataBufHBFX[i] + inst->blockLen10ms, | 2038 memcpy(inst->dataBufHBFX[i], inst->dataBufHBFX[i] + inst->blockLen10ms, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 | 2098 |
2099 //apply gain | 2099 //apply gain |
2100 for (i = 0; i < num_high_bands; ++i) { | 2100 for (i = 0; i < num_high_bands; ++i) { |
2101 for (j = 0; j < inst->blockLen10ms; j++) { | 2101 for (j = 0; j < inst->blockLen10ms; j++) { |
2102 outFrameHB[i][j] = (int16_t)((gainTimeDomainHB * | 2102 outFrameHB[i][j] = (int16_t)((gainTimeDomainHB * |
2103 inst->dataBufHBFX[i][j]) >> 14); // Q0 | 2103 inst->dataBufHBFX[i][j]) >> 14); // Q0 |
2104 } | 2104 } |
2105 } | 2105 } |
2106 } // end of H band gain computation | 2106 } // end of H band gain computation |
2107 } | 2107 } |
OLD | NEW |