2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
|
|
|
|
|
|
iLBC Speech Coder ANSI-C Source Code
|
|
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
iLBC_test.c
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <time.h>
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/ilbc/ilbc.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
//#define JUNK_DATA
|
|
|
|
|
#ifdef JUNK_DATA
|
2011-07-15 16:06:18 +00:00
|
|
|
#define SEED_FILE "randseed.txt"
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------*
|
2011-07-15 16:06:18 +00:00
|
|
|
* Main program to test iLBC encoding and decoding
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Usage:
|
|
|
|
|
* exefile_name.exe <infile> <bytefile> <outfile>
|
|
|
|
|
*
|
|
|
|
|
*---------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
2011-07-15 16:06:18 +00:00
|
|
|
FILE *ifileid,*efileid,*ofileid, *chfileid;
|
|
|
|
|
short encoded_data[55], data[240], speechType;
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
int len_int, mode;
|
|
|
|
|
short pli;
|
|
|
|
|
size_t len, readlen;
|
2011-07-15 16:06:18 +00:00
|
|
|
int blockcount = 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-12-17 13:43:55 +00:00
|
|
|
IlbcEncoderInstance *Enc_Inst;
|
|
|
|
|
IlbcDecoderInstance *Dec_Inst;
|
2011-07-07 08:21:25 +00:00
|
|
|
#ifdef JUNK_DATA
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
size_t i;
|
2011-07-15 16:06:18 +00:00
|
|
|
FILE *seedfile;
|
|
|
|
|
unsigned int random_seed = (unsigned int) time(NULL);//1196764538
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* Create structs */
|
|
|
|
|
WebRtcIlbcfix_EncoderCreate(&Enc_Inst);
|
|
|
|
|
WebRtcIlbcfix_DecoderCreate(&Dec_Inst);
|
|
|
|
|
|
|
|
|
|
/* get arguments and open files */
|
|
|
|
|
|
|
|
|
|
if (argc != 6 ) {
|
|
|
|
|
fprintf(stderr, "%s mode inputfile bytefile outputfile channelfile\n",
|
|
|
|
|
argv[0]);
|
|
|
|
|
fprintf(stderr, "Example:\n");
|
|
|
|
|
fprintf(stderr, "%s <30,20> in.pcm byte.dat out.pcm T30.0.dat\n", argv[0]);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
mode=atoi(argv[1]);
|
|
|
|
|
if (mode != 20 && mode != 30) {
|
|
|
|
|
fprintf(stderr,"Wrong mode %s, must be 20, or 30\n", argv[1]);
|
|
|
|
|
exit(2);
|
|
|
|
|
}
|
|
|
|
|
if ( (ifileid=fopen(argv[2],"rb")) == NULL) {
|
|
|
|
|
fprintf(stderr,"Cannot open input file %s\n", argv[2]);
|
|
|
|
|
exit(2);}
|
|
|
|
|
if ( (efileid=fopen(argv[3],"wb")) == NULL) {
|
|
|
|
|
fprintf(stderr, "Cannot open channelfile file %s\n",
|
|
|
|
|
argv[3]); exit(3);}
|
|
|
|
|
if( (ofileid=fopen(argv[4],"wb")) == NULL) {
|
|
|
|
|
fprintf(stderr, "Cannot open output file %s\n",
|
|
|
|
|
argv[4]); exit(3);}
|
|
|
|
|
if ( (chfileid=fopen(argv[5],"rb")) == NULL) {
|
|
|
|
|
fprintf(stderr,"Cannot open channel file file %s\n", argv[5]);
|
|
|
|
|
exit(2);
|
|
|
|
|
}
|
|
|
|
|
/* print info */
|
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"*---------------------------------------------------*\n");
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"* *\n");
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"* iLBCtest *\n");
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"* *\n");
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"* *\n");
|
|
|
|
|
fprintf(stderr,
|
2011-07-07 08:21:25 +00:00
|
|
|
"*---------------------------------------------------*\n");
|
|
|
|
|
#ifdef SPLIT_10MS
|
2011-07-15 16:06:18 +00:00
|
|
|
fprintf(stderr,"\n10ms split with raw mode: %2d ms\n", mode);
|
2011-07-07 08:21:25 +00:00
|
|
|
#else
|
2011-07-15 16:06:18 +00:00
|
|
|
fprintf(stderr,"\nMode : %2d ms\n", mode);
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
2011-07-15 16:06:18 +00:00
|
|
|
fprintf(stderr,"\nInput file : %s\n", argv[2]);
|
|
|
|
|
fprintf(stderr,"Coded file : %s\n", argv[3]);
|
|
|
|
|
fprintf(stderr,"Output file : %s\n\n", argv[4]);
|
|
|
|
|
fprintf(stderr,"Channel file : %s\n\n", argv[5]);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#ifdef JUNK_DATA
|
2011-07-15 16:06:18 +00:00
|
|
|
srand(random_seed);
|
|
|
|
|
|
|
|
|
|
if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) {
|
|
|
|
|
fprintf(stderr, "Error: Could not open file %s\n", SEED_FILE);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
fprintf(seedfile, "%u\n", random_seed);
|
|
|
|
|
fclose(seedfile);
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* Initialization */
|
|
|
|
|
WebRtcIlbcfix_EncoderInit(Enc_Inst, mode);
|
|
|
|
|
WebRtcIlbcfix_DecoderInit(Dec_Inst, mode);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* loop over input blocks */
|
2011-07-07 08:21:25 +00:00
|
|
|
#ifdef SPLIT_10MS
|
Reformat existing code. There should be no functional effects.
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)
BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1172163004
Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 14:31:38 -07:00
|
|
|
readlen = 80;
|
2011-07-07 08:21:25 +00:00
|
|
|
#else
|
Reformat existing code. There should be no functional effects.
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)
BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1172163004
Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 14:31:38 -07:00
|
|
|
readlen = (size_t)(mode << 3);
|
2011-07-15 16:06:18 +00:00
|
|
|
#endif
|
Reformat existing code. There should be no functional effects.
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)
BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1172163004
Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 14:31:38 -07:00
|
|
|
while(fread(data, sizeof(short), readlen, ifileid) == readlen) {
|
2011-07-15 16:06:18 +00:00
|
|
|
blockcount++;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* encoding */
|
|
|
|
|
fprintf(stderr, "--- Encoding block %i --- ",blockcount);
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
len_int=WebRtcIlbcfix_Encode(Enc_Inst, data, readlen, encoded_data);
|
|
|
|
|
if (len_int < 0) {
|
2015-06-10 21:15:38 -07:00
|
|
|
fprintf(stderr, "Error encoding\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
len = (size_t)len_int;
|
2011-07-15 16:06:18 +00:00
|
|
|
fprintf(stderr, "\r");
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#ifdef JUNK_DATA
|
2011-07-15 16:06:18 +00:00
|
|
|
for ( i = 0; i < len; i++) {
|
|
|
|
|
encoded_data[i] = (short) (encoded_data[i] + (short) rand());
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
2011-07-15 16:06:18 +00:00
|
|
|
/* write byte file */
|
|
|
|
|
if(len != 0){ //len may be 0 in 10ms split case
|
|
|
|
|
fwrite(encoded_data,1,len,efileid);
|
|
|
|
|
|
|
|
|
|
/* get channel data if provided */
|
|
|
|
|
if (argc==6) {
|
2013-04-09 00:28:06 +00:00
|
|
|
if (fread(&pli, sizeof(int16_t), 1, chfileid)) {
|
2011-07-15 16:06:18 +00:00
|
|
|
if ((pli!=0)&&(pli!=1)) {
|
|
|
|
|
fprintf(stderr, "Error in channel file\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
if (pli==0) {
|
|
|
|
|
/* Packet loss -> remove info from frame */
|
2013-04-09 00:28:06 +00:00
|
|
|
memset(encoded_data, 0, sizeof(int16_t)*25);
|
2011-07-15 16:06:18 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
fprintf(stderr, "Error. Channel file too short\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
pli=1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* decoding */
|
|
|
|
|
fprintf(stderr, "--- Decoding block %i --- ",blockcount);
|
|
|
|
|
if (pli==1) {
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
len_int = WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, len, data,
|
|
|
|
|
&speechType);
|
|
|
|
|
if (len_int < 0) {
|
2015-06-10 21:15:38 -07:00
|
|
|
fprintf(stderr, "Error decoding\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
len = (size_t)len_int;
|
2011-07-15 16:06:18 +00:00
|
|
|
} else {
|
|
|
|
|
len=WebRtcIlbcfix_DecodePlc(Dec_Inst, data, 1);
|
|
|
|
|
}
|
|
|
|
|
fprintf(stderr, "\r");
|
|
|
|
|
|
|
|
|
|
/* write output file */
|
|
|
|
|
fwrite(data,sizeof(short),len,ofileid);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-07-15 16:06:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef JUNK_DATA
|
|
|
|
|
if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) {
|
|
|
|
|
fprintf(stderr, "Error: Could not open file %s\n", SEED_FILE);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
fprintf(seedfile, "ok\n\n");
|
|
|
|
|
fclose(seedfile);
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* free structs */
|
|
|
|
|
WebRtcIlbcfix_EncoderFree(Enc_Inst);
|
|
|
|
|
WebRtcIlbcfix_DecoderFree(Dec_Inst);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
/* close files */
|
|
|
|
|
fclose(ifileid);
|
|
|
|
|
fclose(efileid);
|
|
|
|
|
fclose(ofileid);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-07-15 16:06:18 +00:00
|
|
|
return 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|