Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: webrtc/modules/audio_coding/codecs/cng/cng_helpfuns.c

Issue 1868143002: Convert CNG into C++ and remove it from AudioDecoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "cng_helpfuns.h"
12
13 #include "signal_processing_library.h"
14 #include "webrtc/typedefs.h"
15 #include "webrtc_cng.h"
16
17 /* Values in |k| are Q15, and |a| Q12. */
18 void WebRtcCng_K2a16(int16_t* k, int useOrder, int16_t* a) {
19 int16_t any[WEBRTC_SPL_MAX_LPC_ORDER + 1];
20 int16_t *aptr, *aptr2, *anyptr;
21 const int16_t *kptr;
22 int m, i;
23
24 kptr = k;
25 *a = 4096; /* i.e., (Word16_MAX >> 3) + 1 */
26 *any = *a;
27 a[1] = (*k + 4) >> 3;
28 for (m = 1; m < useOrder; m++) {
29 kptr++;
30 aptr = a;
31 aptr++;
32 aptr2 = &a[m];
33 anyptr = any;
34 anyptr++;
35
36 any[m + 1] = (*kptr + 4) >> 3;
37 for (i = 0; i < m; i++) {
38 *anyptr++ = (*aptr++) +
39 (int16_t)((((int32_t)(*aptr2--) * (int32_t) * kptr) + 16384) >> 15);
40 }
41
42 aptr = a;
43 anyptr = any;
44 for (i = 0; i < (m + 2); i++) {
45 *aptr++ = *anyptr++;
46 }
47 }
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698