summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-12 13:19:13 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-12 13:19:13 +0000
commit3684eb98ab743236aabfce4b1efebe4d25df4d3c (patch)
treed9241f1c5cb861c94c403d6e938d5ad880295b03 /remoting/base
parentdd1ae25d386049557ae066fdb4b148c1297c3d1e (diff)
downloadchromium_src-3684eb98ab743236aabfce4b1efebe4d25df4d3c.zip
chromium_src-3684eb98ab743236aabfce4b1efebe4d25df4d3c.tar.gz
chromium_src-3684eb98ab743236aabfce4b1efebe4d25df4d3c.tar.bz2
Implement VP9/I444 encode support in the Chromoting host.
This will be selectable by clients that want to avoid I420 artefacts. BUG=260879,134202 Review URL: https://codereview.chromium.org/261753013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/util.cc22
-rw-r--r--remoting/base/util.h13
-rw-r--r--remoting/base/util_unittest.cc22
3 files changed, 11 insertions, 46 deletions
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index 8102cb9..6ee8548 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -45,28 +45,6 @@ int CalculateUVOffset(int x, int y, int stride) {
return stride * y / 2 + x / 2;
}
-void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane,
- uint8* y_plane,
- uint8* u_plane,
- uint8* v_plane,
- int x,
- int y,
- int width,
- int height,
- int rgb_stride,
- int y_stride,
- int uv_stride) {
- int rgb_offset = CalculateRGBOffset(x, y, rgb_stride);
- int y_offset = CalculateYOffset(x, y, y_stride);
- int uv_offset = CalculateUVOffset(x, y, 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,
const uint8* source_uplane,
diff --git a/remoting/base/util.h b/remoting/base/util.h
index c8c7021..2546221 100644
--- a/remoting/base/util.h
+++ b/remoting/base/util.h
@@ -50,19 +50,6 @@ void ConvertAndScaleYUVToRGB32Rect(
const webrtc::DesktopRect& dest_buffer_rect,
const webrtc::DesktopRect& dest_rect);
-// Convert RGB32 to YUV on a specific rectangle.
-void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane,
- uint8* y_plane,
- uint8* u_plane,
- uint8* v_plane,
- int x,
- int y,
- int width,
- int height,
- int rgb_stride,
- int y_stride,
- int uv_stride);
-
int RoundToTwosMultiple(int x);
// Align the sides of the rectangle to multiples of 2 (expanding outwards).
diff --git a/remoting/base/util_unittest.cc b/remoting/base/util_unittest.cc
index 28fd1a7..42237f7 100644
--- a/remoting/base/util_unittest.cc
+++ b/remoting/base/util_unittest.cc
@@ -6,6 +6,7 @@
#include "remoting/base/util.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/libyuv/include/libyuv/convert_from_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
static const int kWidth = 32 ;
@@ -91,17 +92,16 @@ class YuvToRgbTester {
FillRgbBuffer(rect);
// RGB -> YUV
- ConvertRGB32ToYUVWithRect(rgb_buffer_.get(),
- yplane_,
- uplane_,
- vplane_,
- 0,
- 0,
- kWidth,
- kHeight,
- kRgbStride,
- kYStride,
- kUvStride);
+ libyuv::ARGBToI420(rgb_buffer_.get(),
+ kRgbStride,
+ yplane_,
+ kYStride,
+ uplane_,
+ kUvStride,
+ vplane_,
+ kUvStride,
+ kWidth,
+ kHeight);
// Reset RGB buffer and do opposite conversion.
ResetRgbBuffer();