summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorvigneshv@chromium.org <vigneshv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 23:54:10 +0000
committervigneshv@chromium.org <vigneshv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 23:54:10 +0000
commit4b0cb1b1f741f448f700098aa2235516860f511e (patch)
tree911f5eeec74cc0e4ec450a8835dbc4dd4a7d0588 /media
parent32edb17357e53e22648c4c497c564e4ab21c87bd (diff)
downloadchromium_src-4b0cb1b1f741f448f700098aa2235516860f511e.zip
chromium_src-4b0cb1b1f741f448f700098aa2235516860f511e.tar.gz
chromium_src-4b0cb1b1f741f448f700098aa2235516860f511e.tar.bz2
media: Handling YV12 odd height/width in vpx_video_decoder
vpx_video_decoder does not allow odd videos with odd height/width to playback since it is not valid YV12. But ffmpeg currently supports it by merely rounding up (and so does the libvpx library). Changing vpx_video_decoder to behave the same way as ffmpeg and getting rid of the Checks. BUG=315817 TEST=media_unittests Review URL: https://codereview.chromium.org/92073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/filters/pipeline_integration_test.cc10
-rw-r--r--media/filters/vpx_video_decoder.cc6
2 files changed, 12 insertions, 4 deletions
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc
index afff6a9..06566ec 100644
--- a/media/filters/pipeline_integration_test.cc
+++ b/media/filters/pipeline_integration_test.cc
@@ -1097,6 +1097,16 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) {
EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A);
}
+// Verify that VP8A video with odd width/height can be played back.
+TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_Odd_WebM) {
+ EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber());
+ ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a-odd-dimensions.webm"),
+ PIPELINE_OK));
+ Play();
+ ASSERT_TRUE(WaitUntilOnEnded());
+ EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A);
+}
+
// Verify that VP8 video with inband text track can be played back.
TEST_F(PipelineIntegrationTest,
BasicPlayback_VP8_WebVTT_WebM) {
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index bd9a722..c801726 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -337,8 +337,6 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
const struct vpx_image* vpx_image_alpha,
scoped_refptr<VideoFrame>* video_frame) {
CHECK(vpx_image);
- CHECK_EQ(vpx_image->d_w % 2, 0U);
- CHECK_EQ(vpx_image->d_h % 2, 0U);
CHECK(vpx_image->fmt == VPX_IMG_FMT_I420 ||
vpx_image->fmt == VPX_IMG_FMT_YV12);
@@ -357,11 +355,11 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
video_frame->get());
CopyUPlane(vpx_image->planes[VPX_PLANE_U],
vpx_image->stride[VPX_PLANE_U],
- vpx_image->d_h / 2,
+ (vpx_image->d_h + 1) / 2,
video_frame->get());
CopyVPlane(vpx_image->planes[VPX_PLANE_V],
vpx_image->stride[VPX_PLANE_V],
- vpx_image->d_h / 2,
+ (vpx_image->d_h + 1) / 2,
video_frame->get());
if (!vpx_codec_alpha_)
return;