Commit 66ebf97e authored by Dale Curtis's avatar Dale Curtis Committed by Chromium LUCI CQ

Remove channel layout and bitrate restrictions for MPEG2.

Per discussion on https://crrev.com/c/2527025 no decoder used by
Chrome requires this. Also, our current checks are incorrect while
our test data uses non-compliant streams... so just remove!

https://chromium-review.googlesource.com/c/chromium/src/+/2527025

R=wolenetz

Change-Id: Ie10199182f4dcae18ea221a14623040517605173
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587688
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarMatthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836322}
parent f566ac6a
...@@ -12,28 +12,6 @@ namespace { ...@@ -12,28 +12,6 @@ namespace {
constexpr uint32_t kMPEG1StartCodeMask = 0xffe00000; constexpr uint32_t kMPEG1StartCodeMask = 0xffe00000;
// Map that determines which bitrate_index & channel_mode combinations
// are allowed.
// Derived from: http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html
constexpr bool kIsAllowed[17][4] = {
{true, true, true, true}, // free
{true, false, false, false}, // 32
{true, false, false, false}, // 48
{true, false, false, false}, // 56
{true, true, true, true}, // 64
{true, false, false, false}, // 80
{true, true, true, true}, // 96
{true, true, true, true}, // 112
{true, true, true, true}, // 128
{true, true, true, true}, // 160
{true, true, true, true}, // 192
{false, true, true, true}, // 224
{false, true, true, true}, // 256
{false, true, true, true}, // 320
{false, true, true, true}, // 384
{false, false, false, false} // bad
};
// Maps version and layer information in the frame header // Maps version and layer information in the frame header
// into an index for the |kBitrateMap|. // into an index for the |kBitrateMap|.
// Derived from: http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html // Derived from: http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html
...@@ -125,15 +103,8 @@ bool MPEG1AudioStreamParser::ParseHeader(MediaLog* media_log, ...@@ -125,15 +103,8 @@ bool MPEG1AudioStreamParser::ParseHeader(MediaLog* media_log,
return false; return false;
} }
if (layer == kLayer2 && !kIsAllowed[bitrate_index][channel_mode]) { // Note: For MPEG2 we don't check if a given bitrate or channel layout is
if (media_log) { // allowed per spec since all tested decoders don't seem to care.
LIMITED_MEDIA_LOG(DEBUG, media_log, *media_log_limit, 5)
<< "Invalid MP3 (bitrate_index, channel_mode)"
<< " combination :" << std::hex << " bitrate_index " << bitrate_index
<< " channel_mode " << channel_mode;
}
return false;
}
int bitrate = kBitrateMap[bitrate_index][kVersionLayerMap[version][layer]]; int bitrate = kBitrateMap[bitrate_index][kVersionLayerMap[version][layer]];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment