Commit 9d6eb194 authored by Benjamin Otte's avatar Benjamin Otte
Browse files

[ffmpegcolorspace] Fix NV12 and NV21 with odd width and height

parent 1cf651f8
...@@ -590,13 +590,12 @@ static void glue (RGB_NAME, _to_nv12) (AVPicture * dst, const AVPicture * src, ...@@ -590,13 +590,12 @@ static void glue (RGB_NAME, _to_nv12) (AVPicture * dst, const AVPicture * src,
lum[0] = RGB_TO_Y_CCIR (r, g, b); lum[0] = RGB_TO_Y_CCIR (r, g, b);
c[0] = RGB_TO_U_CCIR (r1, g1, b1, 1); c[0] = RGB_TO_U_CCIR (r1, g1, b1, 1);
c[1] = RGB_TO_V_CCIR (r1, g1, b1, 1); c[1] = RGB_TO_V_CCIR (r1, g1, b1, 1);
c += 2;
p += -wrap3 + BPP; p += -wrap3 + BPP;
lum += -wrap + 1; lum += -wrap + 1;
} }
p += wrap3 + (wrap3 - width * BPP); p += wrap3 + (wrap3 - width * BPP);
lum += wrap + (wrap - width); lum += wrap + (wrap - width);
c += dst->linesize[1] - width; c += dst->linesize[1] - (width & ~1);
} }
/* handle odd height */ /* handle odd height */
if (height) { if (height) {
...@@ -694,13 +693,12 @@ static void glue (RGB_NAME, _to_nv21) (AVPicture * dst, const AVPicture * src, ...@@ -694,13 +693,12 @@ static void glue (RGB_NAME, _to_nv21) (AVPicture * dst, const AVPicture * src,
lum[0] = RGB_TO_Y_CCIR (r, g, b); lum[0] = RGB_TO_Y_CCIR (r, g, b);
c[1] = RGB_TO_U_CCIR (r1, g1, b1, 1); c[1] = RGB_TO_U_CCIR (r1, g1, b1, 1);
c[0] = RGB_TO_V_CCIR (r1, g1, b1, 1); c[0] = RGB_TO_V_CCIR (r1, g1, b1, 1);
c += 2;
p += -wrap3 + BPP; p += -wrap3 + BPP;
lum += -wrap + 1; lum += -wrap + 1;
} }
p += wrap3 + (wrap3 - width * BPP); p += wrap3 + (wrap3 - width * BPP);
lum += wrap + (wrap - width); lum += wrap + (wrap - width);
c += dst->linesize[1] - width; c += dst->linesize[1] - (width & ~1);
} }
/* handle odd height */ /* handle odd height */
if (height) { if (height) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment