diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-14 01:21:18 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-14 01:21:18 +0000 |
commit | 5a7838c5fdba06e93779ee4045189d02af0be0e7 (patch) | |
tree | 4ea275675630c5da305c53911626c698a1dc6796 /remoting | |
parent | 2afff558196f309cc1f69a2b91b9ff2a200322a6 (diff) | |
download | chromium_src-5a7838c5fdba06e93779ee4045189d02af0be0e7.zip chromium_src-5a7838c5fdba06e93779ee4045189d02af0be0e7.tar.gz chromium_src-5a7838c5fdba06e93779ee4045189d02af0be0e7.tar.bz2 |
Linear sub-rectangle scaler for use in Chromoting.
This implementation re-uses the common row filter procedures, but is currently limited to a C horizontal interpolation procedure.
There's also plenty of scope for optimizing the new sub-rectangle scaler routine.
BUG=93451
TEST=media_unittests, remoting_unittests and manual verification of image quality of Chromoting sessions using fit-to-screen.
Review URL: http://codereview.chromium.org/8954003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/base/decoder_vp8.cc | 26 | ||||
-rw-r--r-- | remoting/base/util.cc | 35 | ||||
-rw-r--r-- | remoting/base/util.h | 10 |
3 files changed, 16 insertions, 55 deletions
diff --git a/remoting/base/decoder_vp8.cc b/remoting/base/decoder_vp8.cc index dbb75c81..9e8faac 100644 --- a/remoting/base/decoder_vp8.cc +++ b/remoting/base/decoder_vp8.cc @@ -222,16 +222,22 @@ void DecoderVp8::ScaleAndConvertRects(const RectVector& input_rects, if (!output_rect.intersect(clip_rect)) continue; - // The scaler will not read outside the input dimensions. - ScaleYUVToRGB32WithRect(last_image_->planes[0], - last_image_->planes[1], - last_image_->planes[2], - output_rgb_buf, - input_rects[i], - output_rect, - last_image_->stride[0], - last_image_->stride[1], - output_stride); + // The scaler will not to read outside the input dimensions. + media::ScaleYUVToRGB32WithRect(last_image_->planes[0], + last_image_->planes[1], + last_image_->planes[2], + output_rgb_buf, + image_size.width(), + image_size.height(), + output_size_.width(), + output_size_.height(), + output_rect.x(), + output_rect.y(), + output_rect.right(), + output_rect.bottom(), + last_image_->stride[0], + last_image_->stride[1], + output_stride); output_rects->push_back(output_rect); } } diff --git a/remoting/base/util.cc b/remoting/base/util.cc index 6ef97f5..4c61c6a 100644 --- a/remoting/base/util.cc +++ b/remoting/base/util.cc @@ -79,41 +79,6 @@ void ConvertYUVToRGB32WithRect(const uint8* y_plane, media::YV12); } -void ScaleYUVToRGB32WithRect(const uint8* y_plane, - const uint8* u_plane, - const uint8* v_plane, - uint8* rgb_plane, - const SkIRect& source_rect, - const SkIRect& dest_rect, - int y_stride, - int uv_stride, - int rgb_stride) { - int rgb_offset = CalculateRGBOffset(dest_rect.left(), - dest_rect.top(), - rgb_stride); - int y_offset = CalculateYOffset(source_rect.left(), - source_rect.top(), - y_stride); - int uv_offset = CalculateUVOffset(source_rect.left(), - source_rect.top(), - uv_stride); - - media::ScaleYUVToRGB32(y_plane + y_offset, - u_plane + uv_offset, - v_plane + uv_offset, - rgb_plane + rgb_offset, - source_rect.width(), - source_rect.height(), - dest_rect.width(), - dest_rect.height(), - y_stride, - uv_stride, - rgb_stride, - media::YV12, - media::ROTATE_0, - media::FILTER_NONE); -} - void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane, uint8* y_plane, uint8* u_plane, diff --git a/remoting/base/util.h b/remoting/base/util.h index 5fca203..c05ef2f 100644 --- a/remoting/base/util.h +++ b/remoting/base/util.h @@ -28,16 +28,6 @@ void ConvertYUVToRGB32WithRect(const uint8* y_plane, int uv_stride, int rgb_stride); -void ScaleYUVToRGB32WithRect(const uint8* y_plane, - const uint8* u_plane, - const uint8* v_plane, - uint8* rgb_plane, - const SkIRect& source_rect, - const SkIRect& dest_rect, - int y_stride, - int uv_stride, - int rgb_stride); - void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane, uint8* y_plane, uint8* u_plane, |