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

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c

Issue 1225093005: Split iSAC encoder/decoder: Test more cases (and make sure they work) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 5 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
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 if (framesize == 30 || framesize == 60) 1103 if (framesize == 30 || framesize == 60)
1104 ISAC_inst->ISACenc_obj.new_framelength = (int16_t)((FS/1000) * framesize); 1104 ISAC_inst->ISACenc_obj.new_framelength = (int16_t)((FS/1000) * framesize);
1105 else { 1105 else {
1106 ISAC_inst->errorcode = ISAC_DISALLOWED_FRAME_LENGTH; 1106 ISAC_inst->errorcode = ISAC_DISALLOWED_FRAME_LENGTH;
1107 return -1; 1107 return -1;
1108 } 1108 }
1109 1109
1110 return 0; 1110 return 0;
1111 } 1111 }
1112 1112
1113 void WebRtcIsacfix_SetInitialBweBottleneck(ISACFIX_MainStruct* ISAC_main_inst,
1114 int bottleneck_bits_per_second) {
1115 ISACFIX_SubStruct* inst = (ISACFIX_SubStruct*)ISAC_main_inst;
1116 assert(bottleneck_bits_per_second >= 10000 &&
1117 bottleneck_bits_per_second <= 32000);
1118 inst->bwestimator_obj.sendBwAvg = ((uint32_t)bottleneck_bits_per_second) << 7;
1119 }
1113 1120
1114 /**************************************************************************** 1121 /****************************************************************************
1115 * WebRtcIsacfix_ControlBwe(...) 1122 * WebRtcIsacfix_ControlBwe(...)
1116 * 1123 *
1117 * This function sets the initial values of bottleneck and frame-size if 1124 * This function sets the initial values of bottleneck and frame-size if
1118 * iSAC is used in channel-adaptive mode. Through this API, users can 1125 * iSAC is used in channel-adaptive mode. Through this API, users can
1119 * enforce a frame-size for all values of bottleneck. Then iSAC will not 1126 * enforce a frame-size for all values of bottleneck. Then iSAC will not
1120 * automatically change the frame-size. 1127 * automatically change the frame-size.
1121 * 1128 *
1122 * 1129 *
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 assert(inst->initflag & 1); // Decoder initialized. 1541 assert(inst->initflag & 1); // Decoder initialized.
1535 WebRtcIsacfixBw_GetBandwidthInfo(&inst->bwestimator_obj, bwinfo); 1542 WebRtcIsacfixBw_GetBandwidthInfo(&inst->bwestimator_obj, bwinfo);
1536 } 1543 }
1537 1544
1538 void WebRtcIsacfix_SetBandwidthInfo(ISACFIX_MainStruct* ISAC_main_inst, 1545 void WebRtcIsacfix_SetBandwidthInfo(ISACFIX_MainStruct* ISAC_main_inst,
1539 const IsacBandwidthInfo* bwinfo) { 1546 const IsacBandwidthInfo* bwinfo) {
1540 ISACFIX_SubStruct* inst = (ISACFIX_SubStruct*)ISAC_main_inst; 1547 ISACFIX_SubStruct* inst = (ISACFIX_SubStruct*)ISAC_main_inst;
1541 assert(inst->initflag & 2); // Encoder initialized. 1548 assert(inst->initflag & 2); // Encoder initialized.
1542 WebRtcIsacfixBw_SetBandwidthInfo(&inst->bwestimator_obj, bwinfo); 1549 WebRtcIsacfixBw_SetBandwidthInfo(&inst->bwestimator_obj, bwinfo);
1543 } 1550 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698