Commit 16ac3782 authored by Fredrik Hubinette's avatar Fredrik Hubinette Committed by Commit Bot

AOM: handle HDR 420/444 videos better

Also fix similar problem for VP9 (in a code path we seldom hit)

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I86dc30003f71d5a1b32db7986f95c1c9001667a1
Reviewed-on: https://chromium-review.googlesource.com/1184246Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Fredrik Hubinette <hubbe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585264}
parent ea620eb0
...@@ -325,17 +325,11 @@ scoped_refptr<VideoFrame> AomVideoDecoder::CopyImageToVideoFrame( ...@@ -325,17 +325,11 @@ scoped_refptr<VideoFrame> AomVideoDecoder::CopyImageToVideoFrame(
PackPlane(VideoFrame::kUPlane, img, frame.get()); PackPlane(VideoFrame::kUPlane, img, frame.get());
PackPlane(VideoFrame::kVPlane, img, frame.get()); PackPlane(VideoFrame::kVPlane, img, frame.get());
} else { } else {
// Despite having I420 in the name this will copy any YUV format. for (int plane = 0; plane < 3; plane++) {
libyuv::I420Copy(img->planes[AOM_PLANE_Y], img->stride[AOM_PLANE_Y], libyuv::CopyPlane(img->planes[plane], img->stride[plane],
img->planes[AOM_PLANE_U], img->stride[AOM_PLANE_U], frame->visible_data(plane), frame->stride(plane),
img->planes[AOM_PLANE_V], img->stride[AOM_PLANE_V], frame->row_bytes(plane), frame->rows(plane));
frame->visible_data(VideoFrame::kYPlane), }
frame->stride(VideoFrame::kYPlane),
frame->visible_data(VideoFrame::kUPlane),
frame->stride(VideoFrame::kUPlane),
frame->visible_data(VideoFrame::kVPlane),
frame->stride(VideoFrame::kVPlane), visible_rect.width(),
visible_rect.height());
} }
return frame; return frame;
......
...@@ -597,26 +597,18 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( ...@@ -597,26 +597,18 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame(
return true; return true;
} }
DCHECK(codec_format == PIXEL_FORMAT_I420 ||
codec_format == PIXEL_FORMAT_I420A);
*video_frame = frame_pool_.CreateFrame(codec_format, visible_size, *video_frame = frame_pool_.CreateFrame(codec_format, visible_size,
gfx::Rect(visible_size), gfx::Rect(visible_size),
config_.natural_size(), kNoTimestamp); config_.natural_size(), kNoTimestamp);
if (!(*video_frame)) if (!(*video_frame))
return false; return false;
libyuv::I420Copy( for (int plane = 0; plane < 3; plane++) {
vpx_image->planes[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_Y], libyuv::CopyPlane(
vpx_image->planes[VPX_PLANE_U], vpx_image->stride[VPX_PLANE_U], vpx_image->planes[plane], vpx_image->stride[plane],
vpx_image->planes[VPX_PLANE_V], vpx_image->stride[VPX_PLANE_V], (*video_frame)->visible_data(plane), (*video_frame)->stride(plane),
(*video_frame)->visible_data(VideoFrame::kYPlane), (*video_frame)->row_bytes(plane), (*video_frame)->rows(plane));
(*video_frame)->stride(VideoFrame::kYPlane), }
(*video_frame)->visible_data(VideoFrame::kUPlane),
(*video_frame)->stride(VideoFrame::kUPlane),
(*video_frame)->visible_data(VideoFrame::kVPlane),
(*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(),
coded_size.height());
return true; return true;
} }
......
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