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

Unified Diff: media/base/video_util.cc

Issue 2694113002: Delete media/base/yuv_convert and dependents. Prefer libyuv. (Closed)
Patch Set: Fix media_unittests. Created 3 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 | « media/base/video_frame_unittest.cc ('k') | media/base/yuv_convert.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_util.cc
diff --git a/media/base/video_util.cc b/media/base/video_util.cc
index d77b0084355c37a32c3e77a24b082c4c34e1aa02..1617389f142c1f2f93286cdabc8fab1db10011d0 100644
--- a/media/base/video_util.cc
+++ b/media/base/video_util.cc
@@ -11,7 +11,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h"
#include "media/base/video_frame.h"
-#include "media/base/yuv_convert.h"
#include "third_party/libyuv/include/libyuv.h"
namespace media {
@@ -338,20 +337,15 @@ void CopyRGBToVideoFrame(const uint8_t* source,
LetterboxYUV(frame, region_in_frame);
}
- const int y_offset = region_in_frame.x()
- + (region_in_frame.y() * frame->stride(kY));
- const int uv_offset = region_in_frame.x() / 2
- + (region_in_frame.y() / 2 * uv_stride);
-
- ConvertRGB32ToYUV(source,
- frame->data(kY) + y_offset,
- frame->data(kU) + uv_offset,
- frame->data(kV) + uv_offset,
- region_in_frame.width(),
- region_in_frame.height(),
- stride,
- frame->stride(kY),
- uv_stride);
+ const int y_offset =
+ region_in_frame.x() + (region_in_frame.y() * frame->stride(kY));
+ const int uv_offset =
+ region_in_frame.x() / 2 + (region_in_frame.y() / 2 * uv_stride);
+
+ libyuv::ARGBToI420(source, stride, frame->data(kY) + y_offset,
+ frame->stride(kY), frame->data(kU) + uv_offset, uv_stride,
+ frame->data(kV) + uv_offset, uv_stride,
+ region_in_frame.width(), region_in_frame.height());
}
scoped_refptr<VideoFrame> WrapAsI420VideoFrame(
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/base/yuv_convert.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698