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

Unified Diff: media/mp4/aac.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.h ('k') | media/mp4/aac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/aac.cc
diff --git a/media/mp4/aac.cc b/media/mp4/aac.cc
index f7826363b80d8b0f92631676ecfbee1a83e67da7..f92dd2feb928b9fc69cf1e9c6337c1bb19f513dd 100644
--- a/media/mp4/aac.cc
+++ b/media/mp4/aac.cc
@@ -19,7 +19,7 @@ static const int kFrequencyMap[] = {
namespace media {
-static ChannelLayout GetChannelLayout(uint8 channel_config) {
+static ChannelLayout ConvertChannelConfigToLayout(uint8 channel_config) {
switch (channel_config) {
case 1:
return CHANNEL_LAYOUT_MONO;
@@ -130,9 +130,9 @@ bool AAC::Parse(const std::vector<uint8>& data) {
// When Parametric Stereo is on, mono will be played as stereo.
if (ps_present && channel_config_ == 1)
- channel_layout_ = GetChannelLayout(2);
+ channel_layout_ = CHANNEL_LAYOUT_STEREO;
else
- channel_layout_ = GetChannelLayout(channel_config_);
+ channel_layout_ = ConvertChannelConfigToLayout(channel_config_);
return frequency_ != 0 && channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED &&
profile_ >= 1 && profile_ <= 4 && frequency_index_ != 0xf &&
@@ -154,7 +154,13 @@ int AAC::GetOutputSamplesPerSecond(bool sbr_in_mimetype) const {
return std::min(2 * frequency_, 48000);
}
-ChannelLayout AAC::channel_layout() const {
+ChannelLayout AAC::GetChannelLayout(bool sbr_in_mimetype) const {
+ // Check for implicit signalling of HE-AAC and indicate stereo output
+ // if the mono channel configuration is signalled.
+ // See ISO-14496-3 Section 1.6.6.1.2 for details about this special casing.
+ if (sbr_in_mimetype && channel_config_ == 1)
+ return CHANNEL_LAYOUT_STEREO;
+
return channel_layout_;
}
« no previous file with comments | « media/mp4/aac.h ('k') | media/mp4/aac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698