diff options
author | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 01:09:49 +0000 |
---|---|---|
committer | tomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 01:09:49 +0000 |
commit | 1fc6d1683d19139939ff8159e96781f0b496957a (patch) | |
tree | 7c2d11276bf19133a2605edfef85e33783bbe3fe /webkit/media/crypto | |
parent | eda943f9655cee6acd21e7881c3503b2df61ee26 (diff) | |
download | chromium_src-1fc6d1683d19139939ff8159e96781f0b496957a.zip chromium_src-1fc6d1683d19139939ff8159e96781f0b496957a.tar.gz chromium_src-1fc6d1683d19139939ff8159e96781f0b496957a.tar.bz2 |
ExternalClearKey: remove row-by-row copy code from libvpx wrapper.
Review URL: https://chromiumcodereview.appspot.com/12209064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media/crypto')
-rw-r--r-- | webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc b/webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc index ef12c22..f3acda0 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; } |