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

Unified Diff: webrtc/common_video/libyuv/include/webrtc_libyuv.h

Issue 2332213011: Reland of Optimize Android NV12 capture (Closed)
Patch Set: Fix dst vs src width/height bug Created 4 years, 3 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 | « webrtc/api/androidvideotracksource.cc ('k') | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/libyuv/include/webrtc_libyuv.h
diff --git a/webrtc/common_video/libyuv/include/webrtc_libyuv.h b/webrtc/common_video/libyuv/include/webrtc_libyuv.h
index ec3720e442bc9621fb9e7cdb6696c964073051f7..6c7fab19c4fd8936d4f9d0eaf6965e61a3186dbd 100644
--- a/webrtc/common_video/libyuv/include/webrtc_libyuv.h
+++ b/webrtc/common_video/libyuv/include/webrtc_libyuv.h
@@ -16,6 +16,7 @@
#define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_
#include <stdio.h>
+#include <vector>
#include "webrtc/common_types.h" // RawVideoTypes.
#include "webrtc/common_video/rotation.h"
@@ -123,6 +124,22 @@ double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame);
// Compute SSIM for an I420 frame (all planes).
double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame);
+// Helper class for directly converting and scaling NV12 to I420. The Y-plane
+// will be scaled directly to the I420 destination, which makes this faster
+// than separate NV12->I420 + I420->I420 scaling.
+class NV12ToI420Scaler {
+ public:
+ void NV12ToI420Scale(const uint8_t* src_y, int src_stride_y,
+ const uint8_t* src_uv, int src_stride_uv,
+ int src_width, int src_height,
+ uint8_t* dst_y, int dst_stride_y,
+ uint8_t* dst_u, int dst_stride_u,
+ uint8_t* dst_v, int dst_stride_v,
+ int dst_width, int dst_height);
+ private:
+ std::vector<uint8_t> tmp_uv_planes_;
+};
+
} // namespace webrtc
#endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_
« no previous file with comments | « webrtc/api/androidvideotracksource.cc ('k') | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698