This CL is to add Opus complexity knob and to test it.

As a by-product, a generic tool for testing and comparing the complexity of codecs is added, and new audio files are added to the resources.

Three complexity tests are included
1. Default Opus complexity
2. Opus complexity knob
3. Default iSAC complexity (to compare with Opus)

The complexity tests are only meant for development reasons
and not to be run at bots.

The .isolate file is only needed for the APK packaging and test execution on Android.

TEST=passes all trybots

BUG=
R=kjellander@webrtc.org, tina.legrand@webrtc.org, turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/8969004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5655 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2014-03-07 08:55:48 +00:00
parent ebdb0e3ad0
commit 04546884bf
15 changed files with 627 additions and 3 deletions

View File

@@ -202,6 +202,27 @@ TEST_F(OpusTest, OpusSetBitRate) {
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_stereo_encoder_));
}
TEST_F(OpusTest, OpusSetComplexity) {
// Test without creating encoder memory.
EXPECT_EQ(-1, WebRtcOpus_SetComplexity(opus_mono_encoder_, 9));
EXPECT_EQ(-1, WebRtcOpus_SetComplexity(opus_stereo_encoder_, 9));
// Create encoder memory, try with different complexities.
EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_mono_encoder_, 1));
EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_stereo_encoder_, 2));
EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, 0));
EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_, 0));
EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_mono_encoder_, 10));
EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_stereo_encoder_, 10));
EXPECT_EQ(-1, WebRtcOpus_SetComplexity(opus_mono_encoder_, 11));
EXPECT_EQ(-1, WebRtcOpus_SetComplexity(opus_stereo_encoder_, 11));
// Free memory.
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_mono_encoder_));
EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_stereo_encoder_));
}
// Encode and decode one frame (stereo), initialize the decoder and
// decode once more.
TEST_F(OpusTest, OpusDecodeInit) {