diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-05-24 20:48:55 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-05-24 20:48:55 +0400 |
commit | ac6002a0a47a9c60bacda9ef21117f8a49faf9d2 (patch) | |
tree | b8ba26fc71277cb317a7e790e1aed512f63638ef | |
parent | cfb2c60541714d1110b2a257f835e5d4244a421b (diff) |
Move plane_copy to pixconv.cpp
-rw-r--r-- | decoder/LAVVideo/LAVPixFmtConverter.cpp | 24 | ||||
-rw-r--r-- | decoder/LAVVideo/pixconv/pixconv.cpp | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/decoder/LAVVideo/LAVPixFmtConverter.cpp b/decoder/LAVVideo/LAVPixFmtConverter.cpp index 43c65697..f3f89cdc 100644 --- a/decoder/LAVVideo/LAVPixFmtConverter.cpp +++ b/decoder/LAVVideo/LAVPixFmtConverter.cpp @@ -440,30 +440,6 @@ HRESULT CLAVPixFmtConverter::Convert(LAVFrame *pFrame, uint8_t *dst, int width, return hr; } -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; -} - void CLAVPixFmtConverter::ChangeStride(const uint8_t* src, int srcStride, uint8_t *dst, int dstStride, int width, int height, int planeHeight, LAVOutPixFmts format) { LAVOutPixFmtDesc desc = lav_pixfmt_desc[format]; 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; +} |