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-02-10 01:10:36 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2014-02-10 01:10:36 +0400
commit6738decd32e32ae2755ae40cc16e9ae26c2ae915 (patch)
tree3f8f4a89ec5b919b8169fba46348cf215fc97462 /decoder/LAVVideo/pixconv
parent195c0fc0870c3db395b59e22cfc71a8b8e6de903 (diff)
Fix YUV->RGB with >8 bit formats
Diffstat (limited to 'decoder/LAVVideo/pixconv')
-rw-r--r--decoder/LAVVideo/pixconv/yuv2rgb.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/decoder/LAVVideo/pixconv/yuv2rgb.cpp b/decoder/LAVVideo/pixconv/yuv2rgb.cpp
index 6d2c11f4..454a99c2 100644
--- a/decoder/LAVVideo/pixconv/yuv2rgb.cpp
+++ b/decoder/LAVVideo/pixconv/yuv2rgb.cpp
@@ -506,6 +506,10 @@ DECLARE_CONV_FUNC_IMPL(convert_yuv_rgb)
ditherMode = LAVDither_Ordered;
}
+ // Map the bX formats to their normal counter part, the shift parameter controls this now
+ if (inputFormat == LAVPixFmt_YUV420bX || inputFormat == LAVPixFmt_YUV422bX || inputFormat == LAVPixFmt_YUV444bX)
+ inputFormat = (LAVPixelFormat)(inputFormat - 1);
+
YUVRGBConversionFunc convFn = m_RGBConvFuncs[out32][ditherMode][bYCgCo][inputFormat][shift];
if (convFn == nullptr) {
ASSERT(0);
@@ -536,6 +540,7 @@ template HRESULT CLAVPixFmtConverter::convert_yuv_rgb<1>CONV_FUNC_PARAMS;
CONV_FUNC_INT(1, LAVDither_Random, 1, format, shift)
#define CONV_FUNCX(format) \
+ CONV_FUNC(format, 0) \
CONV_FUNC(format, 1) \
CONV_FUNC(format, 2) \
/* CONV_FUNC(format, 3) */ \
@@ -549,14 +554,11 @@ void CLAVPixFmtConverter::InitRGBConvDispatcher()
{
ZeroMemory(&m_RGBConvFuncs, sizeof(m_RGBConvFuncs));
- CONV_FUNC(LAVPixFmt_YUV420, 0);
CONV_FUNC(LAVPixFmt_NV12, 0);
- CONV_FUNC(LAVPixFmt_YUV422, 0);
- CONV_FUNC(LAVPixFmt_YUV444, 0);
- CONV_FUNCX(LAVPixFmt_YUV420bX);
- CONV_FUNCX(LAVPixFmt_YUV422bX);
- CONV_FUNCX(LAVPixFmt_YUV444bX);
+ CONV_FUNCX(LAVPixFmt_YUV420);
+ CONV_FUNCX(LAVPixFmt_YUV422);
+ CONV_FUNCX(LAVPixFmt_YUV444);
}
RGBCoeffs* CLAVPixFmtConverter::getRGBCoeffs(int width, int height)