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-04-04 17:48:57 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2014-04-04 17:48:57 +0400
commitffcf4e2f89d31e6c4f51ab4217f91e979b9736ea (patch)
treea0d3a353e212a8e9b3f672d897d9dafd1ff0f78a /decoder/LAVVideo/pixconv
parent0d138c950c9624d542747526b71cca850add7dbb (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.cpp9
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) {