aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/imgutils.h
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-20 08:30:42 +0100
committerClément Bœsch <u@pkh.me>2017-03-20 08:34:10 +0100
commit8200b16a9c77e66759a5b992bd1ae93c984702c7 (patch)
tree6f6232122adaee22fd86d97b60b28fd9d1c89b0e /libavutil/imgutils.h
parent5d2354327725348f3ffc96be87e66065a92b499f (diff)
parentd7bc52bf456deba0f32d9fe5c288ec441f1ebef5 (diff)
downloadffmpeg-8200b16a9c77e66759a5b992bd1ae93c984702c7.tar.gz
Merge commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5'
* commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5': imgutils: add a function for copying image data from GPU mapped memory Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavutil/imgutils.h')
-rw-r--r--libavutil/imgutils.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 40aee8b98e..a4a5efcc66 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -121,6 +121,24 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height);
/**
+ * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
+ * available, this function will use special functionality for reading from such
+ * memory, which may result in greatly improved performance compared to plain
+ * av_image_copy().
+ *
+ * The data pointers and the linesizes must be aligned to the maximum required
+ * by the CPU architecture.
+ *
+ * @note The linesize parameters have the type ptrdiff_t here, while they are
+ * int for av_image_copy().
+ * @note On x86, the linesizes currently need to be aligned to the cacheline
+ * size (i.e. 64) to get improved performance.
+ */
+void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
+ const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
+ enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
* Setup the data pointers and linesizes based on the specified image
* parameters and the provided array.
*