Commit cecd07c1 authored by Sreerenj Balachandran's avatar Sreerenj Balachandran Committed by Commit Bot

media/filters: Relax the vp9 colorspace matching restriction

For the Intra only frames in profile0, we assign the default
color_space :BT_601 as per the spec. But there are lazily encoded
streams with UNKNOWN color space information in non-intra-only frames
and that will cause enum comparison mismatch for the current frame header
with the frame in the reference list. So we relax the requirement
a bit to cover more streams similar to the other media stacks like
libvpx, gstreamer etc

BUG=889768
R=dalecurtis@chromium.org, hiroh@chromium.org

Change-Id: I5c343d03a941a3aa1447d4f0d3cd4979b92c4adb
Reviewed-on: https://chromium-review.googlesource.com/c/1342776Reviewed-by: default avatarFredrik Hubinette <hubbe@chromium.org>
Commit-Queue: Fredrik Hubinette <hubbe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609929}
parent 6e171745
...@@ -1028,7 +1028,15 @@ bool Vp9UncompressedHeaderParser::Parse(const uint8_t* stream, ...@@ -1028,7 +1028,15 @@ bool Vp9UncompressedHeaderParser::Parse(const uint8_t* stream,
DVLOG(1) << "bit_depth of referenced frame mismatch"; DVLOG(1) << "bit_depth of referenced frame mismatch";
return false; return false;
} }
if (fhdr->color_space != ref.color_space) { // There are encoded streams with no color_space information
// with in the frame header of an Intra only frame, so we assigned the
// default color_space :BT_601 as per the spec. But reference list
// might have frames with UNKNOWN color space information too. So we
// relax the requirement a bit to cover more video samples and added
// an exception for UNKNOWN colorspace
if (fhdr->color_space != ref.color_space &&
fhdr->color_space != Vp9ColorSpace::UNKNOWN &&
ref.color_space != Vp9ColorSpace::UNKNOWN) {
DVLOG(1) << "color_space of referenced frame mismatch"; DVLOG(1) << "color_space of referenced frame mismatch";
return false; return false;
} }
......
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