Give Audio{De,En}coderIsac* an "Impl" suffix, to free up the original names
I want to publish an API for iSAC in webrtc/api/, and I want to use
the class names Audio{De,En}coderIsac{Fix,Float}.
BUG=webrtc:7835, webrtc:7841
Review-Url: https://codereview.webrtc.org/2996593002
Cr-Commit-Position: refs/heads/master@{#19381}
This commit is contained in:
@ -753,9 +753,9 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
|||||||
receive_packet_count_(0),
|
receive_packet_count_(0),
|
||||||
next_insert_packet_time_ms_(0),
|
next_insert_packet_time_ms_(0),
|
||||||
fake_clock_(new SimulatedClock(0)) {
|
fake_clock_(new SimulatedClock(0)) {
|
||||||
AudioEncoderIsac::Config config;
|
AudioEncoderIsacFloatImpl::Config config;
|
||||||
config.payload_type = kPayloadType;
|
config.payload_type = kPayloadType;
|
||||||
isac_encoder_.reset(new AudioEncoderIsac(config));
|
isac_encoder_.reset(new AudioEncoderIsacFloatImpl(config));
|
||||||
clock_ = fake_clock_.get();
|
clock_ = fake_clock_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,7 +882,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
|||||||
bool codec_registered_ GUARDED_BY(crit_sect_);
|
bool codec_registered_ GUARDED_BY(crit_sect_);
|
||||||
int receive_packet_count_ GUARDED_BY(crit_sect_);
|
int receive_packet_count_ GUARDED_BY(crit_sect_);
|
||||||
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
|
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
|
||||||
std::unique_ptr<AudioEncoderIsac> isac_encoder_;
|
std::unique_ptr<AudioEncoderIsacFloatImpl> isac_encoder_;
|
||||||
std::unique_ptr<SimulatedClock> fake_clock_;
|
std::unique_ptr<SimulatedClock> fake_clock_;
|
||||||
test::AudioLoop audio_loop_;
|
test::AudioLoop audio_loop_;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -154,12 +154,12 @@ std::unique_ptr<AudioEncoder> CreateEncoder(
|
|||||||
#if defined(WEBRTC_CODEC_ISACFX)
|
#if defined(WEBRTC_CODEC_ISACFX)
|
||||||
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
||||||
return std::unique_ptr<AudioEncoder>(
|
return std::unique_ptr<AudioEncoder>(
|
||||||
new AudioEncoderIsacFix(speech_inst, bwinfo));
|
new AudioEncoderIsacFixImpl(speech_inst, bwinfo));
|
||||||
#endif
|
#endif
|
||||||
#if defined(WEBRTC_CODEC_ISAC)
|
#if defined(WEBRTC_CODEC_ISAC)
|
||||||
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
||||||
return std::unique_ptr<AudioEncoder>(
|
return std::unique_ptr<AudioEncoder>(
|
||||||
new AudioEncoderIsac(speech_inst, bwinfo));
|
new AudioEncoderIsacFloatImpl(speech_inst, bwinfo));
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
if (STR_CASE_CMP(speech_inst.plname, "opus") == 0)
|
if (STR_CASE_CMP(speech_inst.plname, "opus") == 0)
|
||||||
@ -229,10 +229,10 @@ std::unique_ptr<AudioDecoder> CreateIsacDecoder(
|
|||||||
const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) {
|
const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) {
|
||||||
#if defined(WEBRTC_CODEC_ISACFX)
|
#if defined(WEBRTC_CODEC_ISACFX)
|
||||||
return std::unique_ptr<AudioDecoder>(
|
return std::unique_ptr<AudioDecoder>(
|
||||||
new AudioDecoderIsacFix(sample_rate_hz, bwinfo));
|
new AudioDecoderIsacFixImpl(sample_rate_hz, bwinfo));
|
||||||
#elif defined(WEBRTC_CODEC_ISAC)
|
#elif defined(WEBRTC_CODEC_ISAC)
|
||||||
return std::unique_ptr<AudioDecoder>(
|
return std::unique_ptr<AudioDecoder>(
|
||||||
new AudioDecoderIsac(sample_rate_hz, bwinfo));
|
new AudioDecoderIsacFloatImpl(sample_rate_hz, bwinfo));
|
||||||
#else
|
#else
|
||||||
FATAL() << "iSAC is not supported.";
|
FATAL() << "iSAC is not supported.";
|
||||||
return std::unique_ptr<AudioDecoder>();
|
return std::unique_ptr<AudioDecoder>();
|
||||||
|
|||||||
@ -91,7 +91,7 @@ NamedDecoderConstructor decoder_constructors[] = {
|
|||||||
[](const SdpAudioFormat& format, std::unique_ptr<AudioDecoder>* out) {
|
[](const SdpAudioFormat& format, std::unique_ptr<AudioDecoder>* out) {
|
||||||
if (format.clockrate_hz == 16000 && format.num_channels == 1) {
|
if (format.clockrate_hz == 16000 && format.num_channels == 1) {
|
||||||
if (out) {
|
if (out) {
|
||||||
out->reset(new AudioDecoderIsacFix(format.clockrate_hz));
|
out->reset(new AudioDecoderIsacFixImpl(format.clockrate_hz));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -104,7 +104,7 @@ NamedDecoderConstructor decoder_constructors[] = {
|
|||||||
if ((format.clockrate_hz == 16000 || format.clockrate_hz == 32000) &&
|
if ((format.clockrate_hz == 16000 || format.clockrate_hz == 32000) &&
|
||||||
format.num_channels == 1) {
|
format.num_channels == 1) {
|
||||||
if (out) {
|
if (out) {
|
||||||
out->reset(new AudioDecoderIsac(format.clockrate_hz));
|
out->reset(new AudioDecoderIsacFloatImpl(format.clockrate_hz));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -68,9 +68,9 @@ NamedEncoderFactory encoder_factories[] = {
|
|||||||
NamedEncoderFactory::ForEncoder<AudioEncoderIlbcImpl>(),
|
NamedEncoderFactory::ForEncoder<AudioEncoderIlbcImpl>(),
|
||||||
#endif
|
#endif
|
||||||
#if defined(WEBRTC_CODEC_ISACFX)
|
#if defined(WEBRTC_CODEC_ISACFX)
|
||||||
NamedEncoderFactory::ForEncoder<AudioEncoderIsacFix>(),
|
NamedEncoderFactory::ForEncoder<AudioEncoderIsacFixImpl>(),
|
||||||
#elif defined(WEBRTC_CODEC_ISAC)
|
#elif defined(WEBRTC_CODEC_ISAC)
|
||||||
NamedEncoderFactory::ForEncoder<AudioEncoderIsac>(),
|
NamedEncoderFactory::ForEncoder<AudioEncoderIsacFloatImpl>(),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WEBRTC_CODEC_OPUS
|
#ifdef WEBRTC_CODEC_OPUS
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
using AudioDecoderIsacFix = AudioDecoderIsacT<IsacFix>;
|
using AudioDecoderIsacFixImpl = AudioDecoderIsacT<IsacFix>;
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INCLUDE_AUDIO_DECODER_ISACFIX_H_
|
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INCLUDE_AUDIO_DECODER_ISACFIX_H_
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
using AudioEncoderIsacFix = AudioEncoderIsacT<IsacFix>;
|
using AudioEncoderIsacFixImpl = AudioEncoderIsacT<IsacFix>;
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INCLUDE_AUDIO_ENCODER_ISACFIX_H_
|
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INCLUDE_AUDIO_ENCODER_ISACFIX_H_
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
using AudioDecoderIsac = AudioDecoderIsacT<IsacFloat>;
|
using AudioDecoderIsacFloatImpl = AudioDecoderIsacT<IsacFloat>;
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_AUDIO_ENCODER_ISAC_H_
|
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_AUDIO_ENCODER_ISAC_H_
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
using AudioEncoderIsac = AudioEncoderIsacT<IsacFloat>;
|
using AudioEncoderIsacFloatImpl = AudioEncoderIsacT<IsacFloat>;
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_AUDIO_ENCODER_ISAC_H_
|
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_AUDIO_ENCODER_ISAC_H_
|
||||||
|
|||||||
@ -17,13 +17,13 @@ namespace webrtc {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void TestBadConfig(const AudioEncoderIsac::Config& config) {
|
void TestBadConfig(const AudioEncoderIsacFloatImpl::Config& config) {
|
||||||
EXPECT_FALSE(config.IsOk());
|
EXPECT_FALSE(config.IsOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestGoodConfig(const AudioEncoderIsac::Config& config) {
|
void TestGoodConfig(const AudioEncoderIsacFloatImpl::Config& config) {
|
||||||
EXPECT_TRUE(config.IsOk());
|
EXPECT_TRUE(config.IsOk());
|
||||||
AudioEncoderIsac aei(config);
|
AudioEncoderIsacFloatImpl aei(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrap subroutine calls that test things in this, so that the error messages
|
// Wrap subroutine calls that test things in this, so that the error messages
|
||||||
@ -34,7 +34,7 @@ void TestGoodConfig(const AudioEncoderIsac::Config& config) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST(AudioEncoderIsacTest, TestConfigBitrate) {
|
TEST(AudioEncoderIsacTest, TestConfigBitrate) {
|
||||||
AudioEncoderIsac::Config config;
|
AudioEncoderIsacFloatImpl::Config config;
|
||||||
|
|
||||||
// The default value is some real, positive value.
|
// The default value is some real, positive value.
|
||||||
EXPECT_GT(config.bit_rate, 1);
|
EXPECT_GT(config.bit_rate, 1);
|
||||||
|
|||||||
@ -350,14 +350,14 @@ class AudioDecoderIsacFloatTest : public AudioDecoderTest {
|
|||||||
codec_input_rate_hz_ = 16000;
|
codec_input_rate_hz_ = 16000;
|
||||||
frame_size_ = 480;
|
frame_size_ = 480;
|
||||||
data_length_ = 10 * frame_size_;
|
data_length_ = 10 * frame_size_;
|
||||||
AudioEncoderIsac::Config config;
|
AudioEncoderIsacFloatImpl::Config config;
|
||||||
config.payload_type = payload_type_;
|
config.payload_type = payload_type_;
|
||||||
config.sample_rate_hz = codec_input_rate_hz_;
|
config.sample_rate_hz = codec_input_rate_hz_;
|
||||||
config.adaptive_mode = false;
|
config.adaptive_mode = false;
|
||||||
config.frame_size_ms =
|
config.frame_size_ms =
|
||||||
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
||||||
audio_encoder_.reset(new AudioEncoderIsac(config));
|
audio_encoder_.reset(new AudioEncoderIsacFloatImpl(config));
|
||||||
decoder_ = new AudioDecoderIsac(codec_input_rate_hz_);
|
decoder_ = new AudioDecoderIsacFloatImpl(codec_input_rate_hz_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -367,14 +367,14 @@ class AudioDecoderIsacSwbTest : public AudioDecoderTest {
|
|||||||
codec_input_rate_hz_ = 32000;
|
codec_input_rate_hz_ = 32000;
|
||||||
frame_size_ = 960;
|
frame_size_ = 960;
|
||||||
data_length_ = 10 * frame_size_;
|
data_length_ = 10 * frame_size_;
|
||||||
AudioEncoderIsac::Config config;
|
AudioEncoderIsacFloatImpl::Config config;
|
||||||
config.payload_type = payload_type_;
|
config.payload_type = payload_type_;
|
||||||
config.sample_rate_hz = codec_input_rate_hz_;
|
config.sample_rate_hz = codec_input_rate_hz_;
|
||||||
config.adaptive_mode = false;
|
config.adaptive_mode = false;
|
||||||
config.frame_size_ms =
|
config.frame_size_ms =
|
||||||
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
||||||
audio_encoder_.reset(new AudioEncoderIsac(config));
|
audio_encoder_.reset(new AudioEncoderIsacFloatImpl(config));
|
||||||
decoder_ = new AudioDecoderIsac(codec_input_rate_hz_);
|
decoder_ = new AudioDecoderIsacFloatImpl(codec_input_rate_hz_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -384,14 +384,14 @@ class AudioDecoderIsacFixTest : public AudioDecoderTest {
|
|||||||
codec_input_rate_hz_ = 16000;
|
codec_input_rate_hz_ = 16000;
|
||||||
frame_size_ = 480;
|
frame_size_ = 480;
|
||||||
data_length_ = 10 * frame_size_;
|
data_length_ = 10 * frame_size_;
|
||||||
AudioEncoderIsacFix::Config config;
|
AudioEncoderIsacFixImpl::Config config;
|
||||||
config.payload_type = payload_type_;
|
config.payload_type = payload_type_;
|
||||||
config.sample_rate_hz = codec_input_rate_hz_;
|
config.sample_rate_hz = codec_input_rate_hz_;
|
||||||
config.adaptive_mode = false;
|
config.adaptive_mode = false;
|
||||||
config.frame_size_ms =
|
config.frame_size_ms =
|
||||||
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_;
|
||||||
audio_encoder_.reset(new AudioEncoderIsacFix(config));
|
audio_encoder_.reset(new AudioEncoderIsacFixImpl(config));
|
||||||
decoder_ = new AudioDecoderIsacFix(codec_input_rate_hz_);
|
decoder_ = new AudioDecoderIsacFixImpl(codec_input_rate_hz_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||||||
const int sample_rate_hz = size % 2 == 0 ? 16000 : 32000; // 16 or 32 kHz.
|
const int sample_rate_hz = size % 2 == 0 ? 16000 : 32000; // 16 or 32 kHz.
|
||||||
static const size_t kAllocatedOuputSizeSamples = 32000 / 10; // 100 ms.
|
static const size_t kAllocatedOuputSizeSamples = 32000 / 10; // 100 ms.
|
||||||
int16_t output[kAllocatedOuputSizeSamples];
|
int16_t output[kAllocatedOuputSizeSamples];
|
||||||
AudioDecoderIsac dec(sample_rate_hz);
|
AudioDecoderIsacFloatImpl dec(sample_rate_hz);
|
||||||
FuzzAudioDecoder(DecoderFunctionType::kNormalDecode, data, size, &dec,
|
FuzzAudioDecoder(DecoderFunctionType::kNormalDecode, data, size, &dec,
|
||||||
sample_rate_hz, sizeof(output), output);
|
sample_rate_hz, sizeof(output), output);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
void FuzzOneInput(const uint8_t* data, size_t size) {
|
void FuzzOneInput(const uint8_t* data, size_t size) {
|
||||||
AudioDecoderIsac dec(16000);
|
AudioDecoderIsacFloatImpl dec(16000);
|
||||||
FuzzAudioDecoderIncomingPacket(data, size, &dec);
|
FuzzAudioDecoderIncomingPacket(data, size, &dec);
|
||||||
}
|
}
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -16,7 +16,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||||||
static const int kSampleRateHz = 16000;
|
static const int kSampleRateHz = 16000;
|
||||||
static const size_t kAllocatedOuputSizeSamples = 16000 / 10; // 100 ms.
|
static const size_t kAllocatedOuputSizeSamples = 16000 / 10; // 100 ms.
|
||||||
int16_t output[kAllocatedOuputSizeSamples];
|
int16_t output[kAllocatedOuputSizeSamples];
|
||||||
AudioDecoderIsacFix dec(kSampleRateHz);
|
AudioDecoderIsacFixImpl dec(kSampleRateHz);
|
||||||
FuzzAudioDecoder(DecoderFunctionType::kNormalDecode, data, size, &dec,
|
FuzzAudioDecoder(DecoderFunctionType::kNormalDecode, data, size, &dec,
|
||||||
kSampleRateHz, sizeof(output), output);
|
kSampleRateHz, sizeof(output), output);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user