Commit a1d1bd0d authored by watk's avatar watk Committed by Commit bot

Support VP9 video in the BT709 color space.

Previously vp9 video was assumed to be in BT601. Now the vp9
color space flag is used to support BT709 as well.

BUG=447716
TEST=media_unittests --gtest_filter='PipelineIntegrationTest*'

Review URL: https://codereview.chromium.org/978483002

Cr-Commit-Position: refs/heads/master@{#319110}
parent e23fcf65
...@@ -465,7 +465,12 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, ...@@ -465,7 +465,12 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
codec_format = VideoFrame::YV24; codec_format = VideoFrame::YV24;
uv_rows = vpx_image->d_h; uv_rows = vpx_image->d_h;
} else if (vpx_codec_alpha_) { } else if (vpx_codec_alpha_) {
// TODO(watk): A limitation of conflating color space with pixel format is
// that it's not possible to have BT709 with alpha.
// Until color space is separated from format, prefer YV12A over YV12HD.
codec_format = VideoFrame::YV12A; codec_format = VideoFrame::YV12A;
} else if (vpx_image->cs == VPX_CS_BT_709) {
codec_format = VideoFrame::YV12HD;
} }
gfx::Size size(vpx_image->d_w, vpx_image->d_h); gfx::Size size(vpx_image->d_w, vpx_image->d_h);
......
...@@ -1651,6 +1651,15 @@ TEST_F(PipelineIntegrationTest, P444_VP9_WebM) { ...@@ -1651,6 +1651,15 @@ TEST_F(PipelineIntegrationTest, P444_VP9_WebM) {
EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV24); EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV24);
} }
// Verify that frames of VP9 video in the BT.709 color space have the YV12HD
// format.
TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) {
ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-bt709.webm"));
Play();
ASSERT_TRUE(WaitUntilOnEnded());
EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV12HD);
}
// Verify that videos with an odd frame size playback successfully. // Verify that videos with an odd frame size playback successfully.
TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) { TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) {
ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm")); ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm"));
......
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