Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: media/mp4/aac_unittest.cc

Issue 13648007: Fix channel layout reporting for implicit signalling of AAC parametric stereo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mp4/aac.cc ('k') | media/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/aac_unittest.cc
diff --git a/media/mp4/aac_unittest.cc b/media/mp4/aac_unittest.cc
index c9f888caa4a6b87a3d697b4c96abfcc7108e1ef5..c5b23d1161ee13e6ad5cbd67ac2e475c566943e6 100644
--- a/media/mp4/aac_unittest.cc
+++ b/media/mp4/aac_unittest.cc
@@ -19,7 +19,7 @@ TEST(AACTest, BasicProfileTest) {
EXPECT_TRUE(aac.Parse(data));
EXPECT_EQ(aac.GetOutputSamplesPerSecond(false), 44100);
- EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
+ EXPECT_EQ(aac.GetChannelLayout(false), CHANNEL_LAYOUT_STEREO);
}
TEST(AACTest, ExtensionTest) {
@@ -32,10 +32,33 @@ TEST(AACTest, ExtensionTest) {
EXPECT_TRUE(aac.Parse(data));
EXPECT_EQ(aac.GetOutputSamplesPerSecond(false), 48000);
EXPECT_EQ(aac.GetOutputSamplesPerSecond(true), 48000);
- EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
+ EXPECT_EQ(aac.GetChannelLayout(false), CHANNEL_LAYOUT_STEREO);
}
-TEST(AACTest, TestImplicitSBR) {
+// Test implicit SBR with mono channel config.
+// Mono channel layout should only be reported if SBR is not
+// specified. Otherwise stereo should be reported.
+// See ISO-14496-3 Section 1.6.6.1.2 for details about this special casing.
+TEST(AACTest, TestImplicitSBR_ChannelConfig0) {
+ AAC aac;
+ uint8 buffer[] = {0x13, 0x08};
+ std::vector<uint8> data;
+
+ data.assign(buffer, buffer + sizeof(buffer));
+
+ EXPECT_TRUE(aac.Parse(data));
+
+ // Test w/o implict SBR.
+ EXPECT_EQ(aac.GetOutputSamplesPerSecond(false), 24000);
+ EXPECT_EQ(aac.GetChannelLayout(false), CHANNEL_LAYOUT_MONO);
+
+ // Test implicit SBR.
+ EXPECT_EQ(aac.GetOutputSamplesPerSecond(true), 48000);
+ EXPECT_EQ(aac.GetChannelLayout(true), CHANNEL_LAYOUT_STEREO);
+}
+
+// Tests implicit SBR with a stereo channel config.
+TEST(AACTest, TestImplicitSBR_ChannelConfig1) {
AAC aac;
uint8 buffer[] = {0x13, 0x10};
std::vector<uint8> data;
@@ -43,9 +66,14 @@ TEST(AACTest, TestImplicitSBR) {
data.assign(buffer, buffer + sizeof(buffer));
EXPECT_TRUE(aac.Parse(data));
+
+ // Test w/o implict SBR.
EXPECT_EQ(aac.GetOutputSamplesPerSecond(false), 24000);
+ EXPECT_EQ(aac.GetChannelLayout(false), CHANNEL_LAYOUT_STEREO);
+
+ // Test implicit SBR.
EXPECT_EQ(aac.GetOutputSamplesPerSecond(true), 48000);
- EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
+ EXPECT_EQ(aac.GetChannelLayout(true), CHANNEL_LAYOUT_STEREO);
}
TEST(AACTest, SixChannelTest) {
@@ -57,7 +85,7 @@ TEST(AACTest, SixChannelTest) {
EXPECT_TRUE(aac.Parse(data));
EXPECT_EQ(aac.GetOutputSamplesPerSecond(false), 48000);
- EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_5_1);
+ EXPECT_EQ(aac.GetChannelLayout(false), CHANNEL_LAYOUT_5_1);
}
TEST(AACTest, DataTooShortTest) {
« no previous file with comments | « media/mp4/aac.cc ('k') | media/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698