# HG changeset patch # User kostya # Date 1243945811 0 # Node ID 321437b5bde2ae2813948297770f8cd19a2828d4 # Parent 24954ec81529b1793333daf9dd3dffc6824e9b59 YUV into RGB48 BE/LE conversion support diff -r 24954ec81529 -r 321437b5bde2 libswscale/swscale.c --- a/libswscale/swscale.c Tue Jun 02 12:28:49 2009 +0000 +++ b/libswscale/swscale.c Tue Jun 02 12:30:11 2009 +0000 @@ -853,6 +853,24 @@ #define YSCALE_YUV_2_ANYRGB_C(func, func2, func_g16, func_monoblack)\ switch(c->dstFormat)\ {\ + case PIX_FMT_RGB48BE:\ + case PIX_FMT_RGB48LE:\ + func(uint8_t,0)\ + ((uint8_t*)dest)[ 0]= r[Y1];\ + ((uint8_t*)dest)[ 1]= r[Y1];\ + ((uint8_t*)dest)[ 2]= g[Y1];\ + ((uint8_t*)dest)[ 3]= g[Y1];\ + ((uint8_t*)dest)[ 4]= b[Y1];\ + ((uint8_t*)dest)[ 5]= b[Y1];\ + ((uint8_t*)dest)[ 6]= r[Y2];\ + ((uint8_t*)dest)[ 7]= r[Y2];\ + ((uint8_t*)dest)[ 8]= g[Y2];\ + ((uint8_t*)dest)[ 9]= g[Y2];\ + ((uint8_t*)dest)[10]= b[Y2];\ + ((uint8_t*)dest)[11]= b[Y2];\ + dest+=12;\ + }\ + break;\ case PIX_FMT_RGBA:\ case PIX_FMT_BGRA:\ if (CONFIG_SMALL){\ diff -r 24954ec81529 -r 321437b5bde2 libswscale/yuv2rgb.c --- a/libswscale/yuv2rgb.c Tue Jun 02 12:28:49 2009 +0000 +++ b/libswscale/yuv2rgb.c Tue Jun 02 12:30:11 2009 +0000 @@ -80,6 +80,16 @@ Y = ysrc[2*i+1-o]; \ dst[2*i+1] = r[Y] + g[Y] + b[Y] + (asrc[2*i+1]<dstFormat) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: return yuv2rgb_c_48; case PIX_FMT_ARGB: case PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) return yuva2argb_c; case PIX_FMT_RGBA: @@ -664,6 +702,7 @@ fill_gv_table(c->table_gV, 2, cgv); break; case 24: + case 48: c->yuvTable = av_malloc(1024); y_table = c->yuvTable; yb = -(384<<16) - oy;