# HG changeset patch # User michael # Date 1101336856 0 # Node ID 270666128b07c979fbbdf7f8f59a631e8c4594bd # Parent b76a4977447a74b3fcf666f59c89fb0ea2f33331 YUV420P to UYVY422 conversion patch by (Luca Abeni < email >< it>) diff -r b76a4977447a -r 270666128b07 imgconvert.c --- a/imgconvert.c Wed Nov 24 22:50:49 2004 +0000 +++ b/imgconvert.c Wed Nov 24 22:54:16 2004 +0000 @@ -955,6 +955,39 @@ } } +static void yuv420p_to_uyvy422(AVPicture *dst, const AVPicture *src, + int width, int height) +{ + int w, h; + uint8_t *line1, *line2, *linesrc = dst->data[0]; + uint8_t *lum1, *lum2, *lumsrc = src->data[0]; + uint8_t *cb1, *cb2 = src->data[1]; + uint8_t *cr1, *cr2 = src->data[2]; + + for(h = height / 2; h--;) { + line1 = linesrc; + line2 = linesrc + dst->linesize[0]; + + lum1 = lumsrc; + lum2 = lumsrc + src->linesize[0]; + + cb1 = cb2; + cr1 = cr2; + + for(w = width / 2; w--;) { + *line1++ = *line2++ = *cb1++; + *line1++ = *lum1++; *line2++ = *lum2++; + *line1++ = *line2++ = *cr1++; + *line1++ = *lum1++; *line2++ = *lum2++; + } + + linesrc += dst->linesize[0] * 2; + lumsrc += src->linesize[0] * 2; + cb2 += src->linesize[1]; + cr2 += src->linesize[2]; + } +} + #define SCALEBITS 10 #define ONE_HALF (1 << (SCALEBITS - 1)) #define FIX(x) ((int) ((x) * (1<