diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-04-04 17:48:57 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-04-04 17:48:57 +0400 |
commit | ffcf4e2f89d31e6c4f51ab4217f91e979b9736ea (patch) | |
tree | a0d3a353e212a8e9b3f672d897d9dafd1ff0f78a /decoder/LAVVideo/pixconv | |
parent | 0d138c950c9624d542747526b71cca850add7dbb (diff) |
yuv2rgb: fix last line in odd-height 4:2:2/4:4:4 to RGB conversion
Diffstat (limited to 'decoder/LAVVideo/pixconv')
-rw-r--r-- | decoder/LAVVideo/pixconv/yuv2rgb.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/decoder/LAVVideo/pixconv/yuv2rgb.cpp b/decoder/LAVVideo/pixconv/yuv2rgb.cpp index 1ed662e5..27e04361 100644 --- a/decoder/LAVVideo/pixconv/yuv2rgb.cpp +++ b/decoder/LAVVideo/pixconv/yuv2rgb.cpp @@ -453,8 +453,13 @@ static int __stdcall yuv2rgb_convert(const uint8_t *srcY, const uint8_t *srcU, c if (dithertype == LAVDither_Random) lineDither = dithers + ((height - 2) * 24 * DITHER_STEPS); y = srcY + (height - 1) * srcStrideY; - u = srcU + ((height >> 1) - 1) * srcStrideUV; - v = srcV + ((height >> 1) - 1) * srcStrideUV; + if (inputFormat == LAVPixFmt_YUV420 || inputFormat == LAVPixFmt_NV12) { + u = srcU + ((height >> 1) - 1) * srcStrideUV; + v = srcV + ((height >> 1) - 1) * srcStrideUV; + } else { + u = srcU + (height - 1) * srcStrideUV; + v = srcV + (height - 1) * srcStrideUV; + } rgb = dst + (height - 1) * dstStride; for (ptrdiff_t i = 0; i < endx; i += 4) { |