Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 308543002: Support for YUV 4:4:4 subsampling in vpx decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/pipeline_integration_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 894f8712c70fbf8c27efdd20f3c82d898ab86910..23a90b2f1c2b4f4d2cd87c27329b5ddbe185c21d 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -450,27 +450,39 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
scoped_refptr<VideoFrame>* video_frame) {
CHECK(vpx_image);
CHECK(vpx_image->fmt == VPX_IMG_FMT_I420 ||
- vpx_image->fmt == VPX_IMG_FMT_YV12);
+ vpx_image->fmt == VPX_IMG_FMT_YV12 ||
+ vpx_image->fmt == VPX_IMG_FMT_I444);
+
+ VideoFrame::Format codec_format = VideoFrame::YV12;
+ int uv_rows = (vpx_image->d_h + 1) / 2;
+
+ if (vpx_image->fmt == VPX_IMG_FMT_I444) {
+ CHECK(!vpx_codec_alpha_);
+ codec_format = VideoFrame::YV24;
+ uv_rows = vpx_image->d_h;
+ } else if (vpx_codec_alpha_) {
+ codec_format = VideoFrame::YV12A;
+ }
gfx::Size size(vpx_image->d_w, vpx_image->d_h);
if (!vpx_codec_alpha_ && memory_pool_) {
*video_frame = VideoFrame::WrapExternalYuvData(
- VideoFrame::YV12,
- size, gfx::Rect(size), config_.natural_size(),
- vpx_image->stride[VPX_PLANE_Y],
- vpx_image->stride[VPX_PLANE_U],
- vpx_image->stride[VPX_PLANE_V],
- vpx_image->planes[VPX_PLANE_Y],
- vpx_image->planes[VPX_PLANE_U],
- vpx_image->planes[VPX_PLANE_V],
- kNoTimestamp(),
- memory_pool_->CreateFrameCallback(vpx_image->fb_priv));
+ codec_format,
+ size, gfx::Rect(size), config_.natural_size(),
+ vpx_image->stride[VPX_PLANE_Y],
+ vpx_image->stride[VPX_PLANE_U],
+ vpx_image->stride[VPX_PLANE_V],
+ vpx_image->planes[VPX_PLANE_Y],
+ vpx_image->planes[VPX_PLANE_U],
+ vpx_image->planes[VPX_PLANE_V],
+ kNoTimestamp(),
+ memory_pool_->CreateFrameCallback(vpx_image->fb_priv));
return;
}
*video_frame = frame_pool_.CreateFrame(
- vpx_codec_alpha_ ? VideoFrame::YV12A : VideoFrame::YV12,
+ codec_format,
size,
gfx::Rect(size),
config_.natural_size(),
@@ -482,11 +494,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 + 1) / 2,
+ uv_rows,
video_frame->get());
CopyVPlane(vpx_image->planes[VPX_PLANE_V],
vpx_image->stride[VPX_PLANE_V],
- (vpx_image->d_h + 1) / 2,
+ uv_rows,
video_frame->get());
if (!vpx_codec_alpha_)
return;
« no previous file with comments | « media/filters/pipeline_integration_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698