summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-19 20:46:38 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-19 20:46:38 +0000
commitdb7ee15d7b5f0c5065b54210d9a42cd8c0fd33a8 (patch)
tree509dc600801dc68abe32aec9b7cbdaec49a1bc8e /remoting/base
parent79affb7effb751deed7336a1828de3cdc1fdde04 (diff)
downloadchromium_src-db7ee15d7b5f0c5065b54210d9a42cd8c0fd33a8.zip
chromium_src-db7ee15d7b5f0c5065b54210d9a42cd8c0fd33a8.tar.gz
chromium_src-db7ee15d7b5f0c5065b54210d9a42cd8c0fd33a8.tar.bz2
Use libyuv for non-scaling RGB<->YUV conversions.
This switches Chromoting hosts to use libyuv for RGB->YUV and clients to use libyuv for non-scaling rendering. TEST=remoting_unittests BUG=145561 Review URL: https://chromiumcodereview.appspot.com/13474013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/util.cc32
1 files changed, 12 insertions, 20 deletions
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index 66a70ea..bd85e6a 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -11,6 +11,7 @@
#include "base/time.h"
#include "media/base/video_frame.h"
#include "media/base/yuv_convert.h"
+#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/skia/include/core/SkRegion.h"
#if defined(OS_POSIX)
@@ -65,15 +66,11 @@ void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane,
int y_offset = CalculateYOffset(x, y, y_stride);
int uv_offset = CalculateUVOffset(x, y, uv_stride);;
- media::ConvertRGB32ToYUV(rgb_plane + rgb_offset,
- y_plane + y_offset,
- u_plane + uv_offset,
- v_plane + uv_offset,
- width,
- height,
- rgb_stride,
- y_stride,
- uv_stride);
+ libyuv::ARGBToI420(rgb_plane + rgb_offset, rgb_stride,
+ y_plane + y_offset, y_stride,
+ u_plane + uv_offset, uv_stride,
+ v_plane + uv_offset, uv_stride,
+ width, height);
}
void ConvertAndScaleYUVToRGB32Rect(const uint8* source_yplane,
@@ -111,7 +108,7 @@ void ConvertAndScaleYUVToRGB32Rect(const uint8* source_yplane,
// See if scaling is needed.
if (source_size == dest_size) {
// Calculate the inner rectangle that can be copied by the optimized
- // ConvertYUVToRGB32().
+ // libyuv::I420ToARGB().
SkIRect inner_rect =
SkIRect::MakeLTRB(RoundToTwosMultiple(dest_rect.left() + 1),
RoundToTwosMultiple(dest_rect.top() + 1),
@@ -126,16 +123,11 @@ void ConvertAndScaleYUVToRGB32Rect(const uint8* source_yplane,
rgb_offset += CalculateRGBOffset(inner_rect.x(), inner_rect.y(),
dest_stride);
- media::ConvertYUVToRGB32(source_yplane + y_offset,
- source_uplane + uv_offset,
- source_vplane + uv_offset,
- dest_buffer + rgb_offset,
- inner_rect.width(),
- inner_rect.height(),
- source_ystride,
- source_uvstride,
- dest_stride,
- media::YV12);
+ libyuv::I420ToARGB(source_yplane + y_offset, source_ystride,
+ source_uplane + uv_offset, source_uvstride,
+ source_vplane + uv_offset, source_uvstride,
+ dest_buffer + rgb_offset, dest_stride,
+ inner_rect.width(), inner_rect.height());
// Now see if some pixels weren't copied due to alignment.
if (dest_rect != inner_rect) {