Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-05-24 20:48:55 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2014-05-24 20:48:55 +0400
commitac6002a0a47a9c60bacda9ef21117f8a49faf9d2 (patch)
treeb8ba26fc71277cb317a7e790e1aed512f63638ef /decoder/LAVVideo/pixconv
parentcfb2c60541714d1110b2a257f835e5d4244a421b (diff)
Move plane_copy to pixconv.cpp
Diffstat (limited to 'decoder/LAVVideo/pixconv')
-rw-r--r--decoder/LAVVideo/pixconv/pixconv.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/decoder/LAVVideo/pixconv/pixconv.cpp b/decoder/LAVVideo/pixconv/pixconv.cpp
index 1e956514..68a5e4a0 100644
--- a/decoder/LAVVideo/pixconv/pixconv.cpp
+++ b/decoder/LAVVideo/pixconv/pixconv.cpp
@@ -32,3 +32,27 @@ DECLARE_ALIGNED(16, const uint16_t, dither_8x8_256)[8][8] = {
{ 40, 232, 24, 216, 36, 228, 20, 212 },
{ 168, 104, 152, 88, 164, 100, 148, 84 }
};
+
+DECLARE_CONV_FUNC_IMPL(plane_copy)
+{
+ LAVOutPixFmtDesc desc = lav_pixfmt_desc[outputFormat];
+
+ int plane, line;
+
+ const int widthBytes = width * desc.codedbytes;
+ const int planes = max(desc.planes, 1);
+
+ for (plane = 0; plane < planes; plane++) {
+ const int planeWidth = widthBytes / desc.planeWidth[plane];
+ const int planeHeight = height / desc.planeHeight[plane];
+ const uint8_t *srcBuf = src[plane];
+ uint8_t *dstBuf = dst[plane];
+ for (line = 0; line < planeHeight; ++line) {
+ memcpy(dstBuf, srcBuf, planeWidth);
+ srcBuf += srcStride[plane];
+ dstBuf += dstStride[plane];
+ }
+ }
+
+ return S_OK;
+}