((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]; +((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4); } } break; case IMGFMT_RG4B: case IMGFMT_BG4B: { const uint8_t * const d64= dither_8x8_73 [y&7]; const uint8_t * const d128=dither_8x8_220[y&7]; YSCALE_YUV_2_RGBX_C(uint8_t)
static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,				    int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,				    uint8_t *dest, int dstW, int y){	int i;	switch(c->dstFormat)	{	case IMGFMT_RGB32:	case IMGFMT_BGR32:		YSCALE_YUV_2_RGBX_C(uint32_t)			((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];			((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];		}		break;	case IMGFMT_RGB24:		YSCALE_YUV_2_RGBX_C(uint8_t)			((uint8_t*)dest)[0]= r[Y1];			((uint8_t*)dest)[1]= g[Y1];			((uint8_t*)dest)[2]= b[Y1];			((uint8_t*)dest)[3]= r[Y2];			((uint8_t*)dest)[4]= g[Y2];			((uint8_t*)dest)[5]= b[Y2];			((uint8_t*)dest)+=6;		}		break;	case IMGFMT_BGR24:		YSCALE_YUV_2_RGBX_C(uint8_t)			((uint8_t*)dest)[0]= b[Y1];			((uint8_t*)dest)[1]= g[Y1];			((uint8_t*)dest)[2]= r[Y1];			((uint8_t*)dest)[3]= b[Y2];			((uint8_t*)dest)[4]= g[Y2];			((uint8_t*)dest)[5]= r[Y2];			((uint8_t*)dest)+=6;		}		break;	case IMGFMT_RGB16:	case IMGFMT_BGR16:		{			const int dr1= dither_2x2_8[y&1    ][0];			const int dg1= dither_2x2_4[y&1    ][0];			const int db1= dither_2x2_8[(y&1)^1][0];			const int dr2= dither_2x2_8[y&1    ][1];			const int dg2= dither_2x2_4[y&1    ][1];			const int db2= dither_2x2_8[(y&1)^1][1];			YSCALE_YUV_2_RGBX_C(uint16_t)				((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];				((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];			}		}		break;	case IMGFMT_RGB15:	case IMGFMT_BGR15:		{			const int dr1= dither_2x2_8[y&1    ][0];			const int dg1= dither_2x2_8[y&1    ][1];			const int db1= dither_2x2_8[(y&1)^1][0];			const int dr2= dither_2x2_8[y&1    ][1];			const int dg2= dither_2x2_8[y&1    ][0];			const int db2= dither_2x2_8[(y&1)^1][1];			YSCALE_YUV_2_RGBX_C(uint16_t)				((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];				((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];			}		}		break;	case IMGFMT_RGB8:	case IMGFMT_BGR8:		{			const uint8_t * const d64= dither_8x8_73[y&7];			const uint8_t * const d32= dither_8x8_32[y&7];			YSCALE_YUV_2_RGBX_C(uint8_t)				((uint8_t*)dest)[i2+0]= r[Y1+d32[(i2+0)&7]] + g[Y1+d32[(i2+0)&7]] + b[Y1+d64[(i2+0)&7]];				((uint8_t*)dest)[i2+1]= r[Y2+d32[(i2+1)&7]] + g[Y2+d32[(i2+1)&7]] + b[Y2+d64[(i2+1)&7]];			}		}		break;	case IMGFMT_RGB4:	case IMGFMT_BGR4:		{			const uint8_t * const d64= dither_8x8_73 [y&7];			const uint8_t * const d128=dither_8x8_220[y&7];			YSCALE_YUV_2_RGBX_C(uint8_t)				((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];				((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]];			}		}		break;	case IMGFMT_RGB1:	case IMGFMT_BGR1:		{			const uint8_t * const d128=dither_8x8_220[y&7];			uint8_t *g= c->table_gU[128] + c->table_gV[128];			int acc=0;			for(i=0; i<dstW-1; i+=2){				int j;				int Y1=0;				int Y2=0;				for(j=0; j<lumFilterSize; j++)				{					Y1 += lumSrc[j][i] * lumFilter[j];					Y2 += lumSrc[j][i+1] * lumFilter[j];				}				Y1>>=19;				Y2>>=19;				if((Y1|Y2)&256)				{					if(Y1>255)   Y1=255;					else if(Y1<0)Y1=0;					if(Y2>255)   Y2=255;					else if(Y2<0)Y2=0;				}				acc+= acc + g[Y1+d128[(i+0)&7]];				acc+= acc + g[Y2+d128[(i+1)&7]];				if((i&7)==6){					((uint8_t*)dest)[0]= acc;					((uint8_t*)dest)++;				}			}		}		break;	case IMGFMT_YUY2:		YSCALE_YUV_2_PACKEDX_C(void)			((uint8_t*)dest)[2*i2+0]= Y1;			((uint8_t*)dest)[2*i2+1]= U;			((uint8_t*)dest)[2*i2+2]= Y2;			((uint8_t*)dest)[2*i2+3]= V;		}                break;	}}