comparison postproc/swscale.c @ 9171:898e5270a46e

fixing rgb4 & bgr4 (2 pixels per byte) adding bg4b & rg4b (1 pixel per byte)
author michael
date Thu, 30 Jan 2003 09:15:09 +0000
parents 25baacd1c650
children da162a0d9ae9
comparison
equal deleted inserted replaced
9170:bcf4bf10f9c7 9171:898e5270a46e
581 }\ 581 }\
582 }\ 582 }\
583 break;\ 583 break;\
584 case IMGFMT_RGB4:\ 584 case IMGFMT_RGB4:\
585 case IMGFMT_BGR4:\ 585 case IMGFMT_BGR4:\
586 {\
587 const uint8_t * const d64= dither_8x8_73 [y&7];\
588 const uint8_t * const d128=dither_8x8_220[y&7];\
589 func(uint8_t)\
590 ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\
591 + ((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);\
592 }\
593 }\
594 break;\
595 case IMGFMT_RG4B:\
596 case IMGFMT_BG4B:\
586 {\ 597 {\
587 const uint8_t * const d64= dither_8x8_73 [y&7];\ 598 const uint8_t * const d64= dither_8x8_73 [y&7];\
588 const uint8_t * const d128=dither_8x8_220[y&7];\ 599 const uint8_t * const d128=dither_8x8_220[y&7];\
589 func(uint8_t)\ 600 func(uint8_t)\
590 ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\ 601 ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\
749 case IMGFMT_BGR4: 760 case IMGFMT_BGR4:
750 { 761 {
751 const uint8_t * const d64= dither_8x8_73 [y&7]; 762 const uint8_t * const d64= dither_8x8_73 [y&7];
752 const uint8_t * const d128=dither_8x8_220[y&7]; 763 const uint8_t * const d128=dither_8x8_220[y&7];
753 YSCALE_YUV_2_RGBX_C(uint8_t) 764 YSCALE_YUV_2_RGBX_C(uint8_t)
765 ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];
766 +((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);
767 }
768 }
769 break;
770 case IMGFMT_RG4B:
771 case IMGFMT_BG4B:
772 {
773 const uint8_t * const d64= dither_8x8_73 [y&7];
774 const uint8_t * const d128=dither_8x8_220[y&7];
775 YSCALE_YUV_2_RGBX_C(uint8_t)
754 ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]; 776 ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];
755 ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]]; 777 ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]];
756 } 778 }
757 } 779 }
758 break; 780 break;