WebRtcIsac_Encode and WebRtcIsacfix_Encode: Type encoded stream as uint8_t
We have to fix both at once, since there's a macro that calls one of them or the other. BUG=909 R=andrew@webrtc.org, bjornv@webrtc.org, henrik.lundin@webrtc.org, minyue@webrtc.org Committed: https://code.google.com/p/webrtc/source/detail?r=7266 Review URL: https://webrtc-codereview.appspot.com/19229004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7285 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -348,14 +348,11 @@ class AudioDecoderIsacFloatTest : public AudioDecoderTest {
|
||||
virtual int EncodeFrame(const int16_t* input, size_t input_len_samples,
|
||||
uint8_t* output) {
|
||||
// Insert 3 * 10 ms. Expect non-zero output on third call.
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
int enc_len_bytes =
|
||||
WebRtcIsac_Encode(encoder_, input, reinterpret_cast<int16_t*>(output));
|
||||
int enc_len_bytes = WebRtcIsac_Encode(encoder_, input, output);
|
||||
EXPECT_GT(enc_len_bytes, 0);
|
||||
return enc_len_bytes;
|
||||
}
|
||||
@ -388,14 +385,11 @@ class AudioDecoderIsacSwbTest : public AudioDecoderTest {
|
||||
virtual int EncodeFrame(const int16_t* input, size_t input_len_samples,
|
||||
uint8_t* output) {
|
||||
// Insert 3 * 10 ms. Expect non-zero output on third call.
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsac_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
int enc_len_bytes =
|
||||
WebRtcIsac_Encode(encoder_, input, reinterpret_cast<int16_t*>(output));
|
||||
int enc_len_bytes = WebRtcIsac_Encode(encoder_, input, output);
|
||||
EXPECT_GT(enc_len_bytes, 0);
|
||||
return enc_len_bytes;
|
||||
}
|
||||
@ -441,14 +435,11 @@ class AudioDecoderIsacFixTest : public AudioDecoderTest {
|
||||
virtual int EncodeFrame(const int16_t* input, size_t input_len_samples,
|
||||
uint8_t* output) {
|
||||
// Insert 3 * 10 ms. Expect non-zero output on third call.
|
||||
EXPECT_EQ(0, WebRtcIsacfix_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsacfix_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
EXPECT_EQ(0, WebRtcIsacfix_Encode(encoder_, input,
|
||||
reinterpret_cast<int16_t*>(output)));
|
||||
EXPECT_EQ(0, WebRtcIsacfix_Encode(encoder_, input, output));
|
||||
input += input_size_;
|
||||
int enc_len_bytes = WebRtcIsacfix_Encode(
|
||||
encoder_, input, reinterpret_cast<int16_t*>(output));
|
||||
int enc_len_bytes = WebRtcIsacfix_Encode(encoder_, input, output);
|
||||
EXPECT_GT(enc_len_bytes, 0);
|
||||
return enc_len_bytes;
|
||||
}
|
||||
|
||||
@ -1632,9 +1632,13 @@ int NetEQTest_encode(int coder, int16_t *indata, int frameLen, unsigned char * e
|
||||
cdlen=0;
|
||||
while (cdlen<=0) {
|
||||
#ifdef CODEC_ISAC /* floating point */
|
||||
cdlen=WebRtcIsac_Encode(ISAC_inst[k],&indata[noOfCalls*160],(int16_t*)encoded);
|
||||
cdlen = WebRtcIsac_Encode(ISAC_inst[k],
|
||||
&indata[noOfCalls * 160],
|
||||
encoded);
|
||||
#else /* fixed point */
|
||||
cdlen=WebRtcIsacfix_Encode(ISAC_inst[k],&indata[noOfCalls*160],(int16_t*)encoded);
|
||||
cdlen = WebRtcIsacfix_Encode(ISAC_inst[k],
|
||||
&indata[noOfCalls * 160],
|
||||
encoded);
|
||||
#endif
|
||||
noOfCalls++;
|
||||
}
|
||||
@ -1645,7 +1649,9 @@ int NetEQTest_encode(int coder, int16_t *indata, int frameLen, unsigned char * e
|
||||
int noOfCalls=0;
|
||||
cdlen=0;
|
||||
while (cdlen<=0) {
|
||||
cdlen=WebRtcIsac_Encode(ISACSWB_inst[k],&indata[noOfCalls*320],(int16_t*)encoded);
|
||||
cdlen = WebRtcIsac_Encode(ISACSWB_inst[k],
|
||||
&indata[noOfCalls * 320],
|
||||
encoded);
|
||||
noOfCalls++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,8 +138,7 @@ int NetEqIsacQualityTest::EncodeBlock(int16_t* in_data,
|
||||
// The Isac encoder does not perform encoding (and returns 0) until it
|
||||
// receives a sequence of sub-blocks that amount to the frame duration.
|
||||
EXPECT_EQ(0, value);
|
||||
value = WebRtcIsacfix_Encode(isac_encoder_, &in_data[pointer],
|
||||
reinterpret_cast<int16_t*>(payload));
|
||||
value = WebRtcIsacfix_Encode(isac_encoder_, &in_data[pointer], payload);
|
||||
}
|
||||
EXPECT_GT(value, 0);
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user