Revert "Upconvert various types to int."
This reverts commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24. BUG=499241 TBR=hlundin Review URL: https://codereview.webrtc.org/1179953003 Cr-Commit-Position: refs/heads/master@{#9418}
This commit is contained in:
@ -198,7 +198,7 @@ AudioEncoder::EncodedInfo AudioEncoderOpus::EncodeInternal(
|
||||
CHECK_EQ(input_buffer_.size(),
|
||||
static_cast<size_t>(num_10ms_frames_per_packet_) *
|
||||
samples_per_10ms_frame_);
|
||||
int status = WebRtcOpus_Encode(
|
||||
int16_t status = WebRtcOpus_Encode(
|
||||
inst_, &input_buffer_[0],
|
||||
rtc::CheckedDivExact(CastInt16(input_buffer_.size()),
|
||||
static_cast<int16_t>(num_channels_)),
|
||||
|
||||
@ -64,11 +64,11 @@ int16_t WebRtcOpus_EncoderFree(OpusEncInst* inst);
|
||||
* Return value : >=0 - Length (in bytes) of coded data
|
||||
* -1 - Error
|
||||
*/
|
||||
int WebRtcOpus_Encode(OpusEncInst* inst,
|
||||
const int16_t* audio_in,
|
||||
int16_t samples,
|
||||
int16_t length_encoded_buffer,
|
||||
uint8_t* encoded);
|
||||
int16_t WebRtcOpus_Encode(OpusEncInst* inst,
|
||||
const int16_t* audio_in,
|
||||
int16_t samples,
|
||||
int16_t length_encoded_buffer,
|
||||
uint8_t* encoded);
|
||||
|
||||
/****************************************************************************
|
||||
* WebRtcOpus_SetBitRate(...)
|
||||
@ -236,9 +236,9 @@ int16_t WebRtcOpus_DecoderInit(OpusDecInst* inst);
|
||||
* Return value : >0 - Samples per channel in decoded vector
|
||||
* -1 - Error
|
||||
*/
|
||||
int WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type);
|
||||
int16_t WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type);
|
||||
|
||||
/****************************************************************************
|
||||
* WebRtcOpus_DecodePlc(...)
|
||||
@ -254,8 +254,8 @@ int WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
* Return value : >0 - number of samples in decoded PLC vector
|
||||
* -1 - Error
|
||||
*/
|
||||
int WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
int number_of_lost_frames);
|
||||
int16_t WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
int16_t number_of_lost_frames);
|
||||
|
||||
/****************************************************************************
|
||||
* WebRtcOpus_DecodeFec(...)
|
||||
@ -275,9 +275,9 @@ int WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
* 0 - No FEC data in the packet
|
||||
* -1 - Error
|
||||
*/
|
||||
int WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type);
|
||||
int16_t WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type);
|
||||
|
||||
/****************************************************************************
|
||||
* WebRtcOpus_DurationEst(...)
|
||||
|
||||
@ -131,10 +131,10 @@ OpusFecTest::OpusFecTest()
|
||||
}
|
||||
|
||||
void OpusFecTest::EncodeABlock() {
|
||||
int value = WebRtcOpus_Encode(opus_encoder_,
|
||||
&in_data_[data_pointer_],
|
||||
block_length_sample_,
|
||||
max_bytes_, &bit_stream_[0]);
|
||||
int16_t value = WebRtcOpus_Encode(opus_encoder_,
|
||||
&in_data_[data_pointer_],
|
||||
block_length_sample_,
|
||||
max_bytes_, &bit_stream_[0]);
|
||||
EXPECT_GT(value, 0);
|
||||
|
||||
encoded_bytes_ = value;
|
||||
@ -142,7 +142,7 @@ void OpusFecTest::EncodeABlock() {
|
||||
|
||||
void OpusFecTest::DecodeABlock(bool lost_previous, bool lost_current) {
|
||||
int16_t audio_type;
|
||||
int value_1 = 0, value_2 = 0;
|
||||
int16_t value_1 = 0, value_2 = 0;
|
||||
|
||||
if (lost_previous) {
|
||||
// Decode previous frame.
|
||||
|
||||
@ -78,11 +78,11 @@ int16_t WebRtcOpus_EncoderFree(OpusEncInst* inst) {
|
||||
}
|
||||
}
|
||||
|
||||
int WebRtcOpus_Encode(OpusEncInst* inst,
|
||||
const int16_t* audio_in,
|
||||
int16_t samples,
|
||||
int16_t length_encoded_buffer,
|
||||
uint8_t* encoded) {
|
||||
int16_t WebRtcOpus_Encode(OpusEncInst* inst,
|
||||
const int16_t* audio_in,
|
||||
int16_t samples,
|
||||
int16_t length_encoded_buffer,
|
||||
uint8_t* encoded) {
|
||||
int res;
|
||||
|
||||
if (samples > 48 * kWebRtcOpusMaxEncodeFrameSizeMs) {
|
||||
@ -291,9 +291,9 @@ static int DecodeNative(OpusDecInst* inst, const uint8_t* encoded,
|
||||
return res;
|
||||
}
|
||||
|
||||
int WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type) {
|
||||
int16_t WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type) {
|
||||
int decoded_samples;
|
||||
|
||||
if (encoded_bytes == 0) {
|
||||
@ -318,8 +318,8 @@ int WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded,
|
||||
return decoded_samples;
|
||||
}
|
||||
|
||||
int WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
int number_of_lost_frames) {
|
||||
int16_t WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
int16_t number_of_lost_frames) {
|
||||
int16_t audio_type = 0;
|
||||
int decoded_samples;
|
||||
int plc_samples;
|
||||
@ -339,9 +339,9 @@ int WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded,
|
||||
return decoded_samples;
|
||||
}
|
||||
|
||||
int WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type) {
|
||||
int16_t WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded,
|
||||
int16_t encoded_bytes, int16_t* decoded,
|
||||
int16_t* audio_type) {
|
||||
int decoded_samples;
|
||||
int fec_samples;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user