OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 | 446 |
447 | 447 |
448 | 448 |
449 /* | 449 /* |
450 * function to decode the complex spectrum from the bitstream | 450 * function to decode the complex spectrum from the bitstream |
451 * returns the total number of bytes in the stream | 451 * returns the total number of bytes in the stream |
452 */ | 452 */ |
453 int16_t WebRtcIsacfix_DecodeSpec(Bitstr_dec *streamdata, | 453 int WebRtcIsacfix_DecodeSpec(Bitstr_dec *streamdata, |
454 int16_t *frQ7, | 454 int16_t *frQ7, |
455 int16_t *fiQ7, | 455 int16_t *fiQ7, |
456 int16_t AvgPitchGain_Q12) | 456 int16_t AvgPitchGain_Q12) |
457 { | 457 { |
458 int16_t data[FRAMESAMPLES]; | 458 int16_t data[FRAMESAMPLES]; |
459 int32_t invARSpec2_Q16[FRAMESAMPLES/4]; | 459 int32_t invARSpec2_Q16[FRAMESAMPLES/4]; |
460 int16_t ARCoefQ12[AR_ORDER+1]; | 460 int16_t ARCoefQ12[AR_ORDER+1]; |
461 int16_t RCQ15[AR_ORDER]; | 461 int16_t RCQ15[AR_ORDER]; |
462 int16_t gainQ10; | 462 int16_t gainQ10; |
463 int32_t gain2_Q10; | 463 int32_t gain2_Q10; |
464 int16_t len; | 464 int len; |
465 int k; | 465 int k; |
466 | 466 |
467 /* create dither signal */ | 467 /* create dither signal */ |
468 GenerateDitherQ7(data, streamdata->W_upper, FRAMESAMPLES, AvgPitchGain_Q12); /
* Dither is output in vector 'Data' */ | 468 GenerateDitherQ7(data, streamdata->W_upper, FRAMESAMPLES, AvgPitchGain_Q12); /
* Dither is output in vector 'Data' */ |
469 | 469 |
470 /* decode model parameters */ | 470 /* decode model parameters */ |
471 if (WebRtcIsacfix_DecodeRcCoef(streamdata, RCQ15) < 0) | 471 if (WebRtcIsacfix_DecodeRcCoef(streamdata, RCQ15) < 0) |
472 return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; | 472 return -ISAC_RANGE_ERROR_DECODE_SPECTRUM; |
473 | 473 |
474 | 474 |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 | 2025 |
2026 index_gQQ[k] = pos2QQ + WebRtcIsacfix_kQuantMinGain[k]; //ATTN: ok? | 2026 index_gQQ[k] = pos2QQ + WebRtcIsacfix_kQuantMinGain[k]; //ATTN: ok? |
2027 if (index_gQQ[k] < 0) { | 2027 if (index_gQQ[k] < 0) { |
2028 index_gQQ[k] = 0; | 2028 index_gQQ[k] = 0; |
2029 } | 2029 } |
2030 else if (index_gQQ[k] > WebRtcIsacfix_kMaxIndGain[k]) { | 2030 else if (index_gQQ[k] > WebRtcIsacfix_kMaxIndGain[k]) { |
2031 index_gQQ[k] = WebRtcIsacfix_kMaxIndGain[k]; | 2031 index_gQQ[k] = WebRtcIsacfix_kMaxIndGain[k]; |
2032 } | 2032 } |
2033 } | 2033 } |
2034 } | 2034 } |
OLD | NEW |