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

Unified Diff: webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc

Issue 12209064: ExternalClearKey: remove row-by-row copy code from libvpx wrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on master. Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc
diff --git a/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc b/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc
index ef12c22e86eb0b162101a7bddd01e16967534b5d..f3acda07beabe74e724abf43c4ca829c1efe5946 100644
--- a/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc
+++ b/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc
@@ -28,28 +28,6 @@ namespace webkit_media {
static const int kDecodeThreads = 2;
-#if defined(USE_COPYPLANE_WITH_LIBVPX)
-static void CopyPlane(const uint8_t* source,
- int32_t source_stride,
- int32_t target_stride,
- int32_t rows,
- int32_t copy_bytes_per_row,
- uint8_t* target) {
- DCHECK(source);
- DCHECK(target);
- DCHECK_LE(copy_bytes_per_row, source_stride);
- DCHECK_LE(copy_bytes_per_row, target_stride);
-
- for (int i = 0; i < rows; ++i) {
- const int source_offset = i * source_stride;
- const int target_offset = i * target_stride;
- memcpy(target + target_offset,
- source + source_offset,
- copy_bytes_per_row);
- }
-}
-#endif // USE_COPYPLANE_WITH_LIBVPX
-
LibvpxCdmVideoDecoder::LibvpxCdmVideoDecoder(cdm::Host* host)
: is_initialized_(false),
host_(host),
@@ -169,58 +147,6 @@ bool LibvpxCdmVideoDecoder::CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame) {
DCHECK_EQ(vpx_image_->d_w % 2, 0U);
DCHECK_EQ(vpx_image_->d_h % 2, 0U);
-#if defined(USE_COPYPLANE_WITH_LIBVPX)
- const int y_size = vpx_image_->d_w * vpx_image_->d_h;
- const int uv_size = y_size / 2;
- const int space_required = y_size + (uv_size * 2);
-
- DCHECK(!cdm_video_frame->FrameBuffer());
- cdm_video_frame->SetFrameBuffer(host_->Allocate(space_required));
- if (!cdm_video_frame->FrameBuffer()) {
- LOG(ERROR) << "CopyVpxImageTo() cdm::Host::Allocate failed.";
- return false;
- }
- cdm_video_frame->FrameBuffer()->SetSize(space_required);
-
- CopyPlane(vpx_image_->planes[VPX_PLANE_Y],
- vpx_image_->stride[VPX_PLANE_Y],
- vpx_image_->d_w,
- vpx_image_->d_h,
- vpx_image_->d_w,
- cdm_video_frame->FrameBuffer()->Data());
-
- const int uv_stride = vpx_image_->d_w / 2;
- const int uv_rows = vpx_image_->d_h / 2;
- CopyPlane(vpx_image_->planes[VPX_PLANE_U],
- vpx_image_->stride[VPX_PLANE_U],
- uv_stride,
- uv_rows,
- uv_stride,
- cdm_video_frame->FrameBuffer()->Data() + y_size);
-
- CopyPlane(vpx_image_->planes[VPX_PLANE_V],
- vpx_image_->stride[VPX_PLANE_V],
- uv_stride,
- uv_rows,
- uv_stride,
- cdm_video_frame->FrameBuffer()->Data() + y_size + uv_size);
-
- cdm_video_frame->SetFormat(cdm::kYv12);
-
- cdm::Size video_frame_size;
- video_frame_size.width = vpx_image_->d_w;
- video_frame_size.height = vpx_image_->d_h;
- cdm_video_frame->SetSize(video_frame_size);
-
- cdm_video_frame->SetPlaneOffset(cdm::VideoFrame::kYPlane, 0);
- cdm_video_frame->SetPlaneOffset(cdm::VideoFrame::kUPlane, y_size);
- cdm_video_frame->SetPlaneOffset(cdm::VideoFrame::kVPlane,
- y_size + uv_size);
-
- cdm_video_frame->SetStride(cdm::VideoFrame::kYPlane, vpx_image_->d_w);
- cdm_video_frame->SetStride(cdm::VideoFrame::kUPlane, uv_stride);
- cdm_video_frame->SetStride(cdm::VideoFrame::kVPlane, uv_stride);
-#else
const int y_size = vpx_image_->stride[VPX_PLANE_Y] * vpx_image_->d_h;
const int uv_rows = vpx_image_->d_h / 2;
const int u_size = vpx_image_->stride[VPX_PLANE_U] * uv_rows;
@@ -263,7 +189,6 @@ bool LibvpxCdmVideoDecoder::CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame) {
vpx_image_->stride[VPX_PLANE_U]);
cdm_video_frame->SetStride(cdm::VideoFrame::kVPlane,
vpx_image_->stride[VPX_PLANE_V]);
-#endif // USE_COPYPLANE_WITH_LIBVPX
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698