Changeset 282
- Timestamp:
- 01/10/07 23:56:56 (2 years ago)
- Files:
-
- trunk/ColorConversions.c (modified) (5 diffs)
- trunk/ColorConversions.h (modified) (1 diff)
- trunk/FFusionCodec.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ColorConversions.c
r280 r282 152 152 } 153 153 154 void SlowY420(UInt8 * o, int outRB, int width, int height, AVFrame * picture)154 void Y420toY422(UInt8 * o, int outRB, int width, int height, AVFrame * picture) 155 155 { 156 156 static void (*y420_function)(UInt8* baseAddr, int outRB, int width, int height, AVFrame * picture) = NULL; … … 170 170 #include <emmintrin.h> 171 171 172 void SlowY420(UInt8 * o, int outRB, int width, int height, AVFrame * picture)172 void Y420toY422(UInt8 * o, int outRB, int width, int height, AVFrame * picture) 173 173 { 174 174 UInt8 *yc = picture->data[0], *uc = picture->data[1], *vc = picture->data[2]; … … 218 218 #endif 219 219 220 void BGR24toRGB24(UInt8 *baseAddr, long rowBytes, long width, longheight, AVFrame *picture)220 void BGR24toRGB24(UInt8 *baseAddr, int rowBytes, int width, int height, AVFrame *picture) 221 221 { 222 222 int i, j; … … 236 236 } 237 237 238 void RGB32toRGB32(UInt8 *baseAddr, long rowBytes, long width, longheight, AVFrame *picture)238 void RGB32toRGB32(UInt8 *baseAddr, int rowBytes, int width, int height, AVFrame *picture) 239 239 { 240 240 int x, y; … … 253 253 } 254 254 } 255 256 void Y422toY422(UInt8* o, int outRB, int width, int height, AVFrame * picture) 257 { 258 UInt8 *yc = picture->data[0], *u = picture->data[1], *v = picture->data[2]; 259 int rY = picture->linesize[0], rU = picture->linesize[1], rV = picture->linesize[2], y = 0, x, x2; 260 261 for (; y < height; y++) { 262 for (x = 0, x2 = 0; x < width; x += 2, x2 += 4) { 263 int hx = x >> 1; 264 o[x2] = u[hx]; 265 o[x2 + 1] = yc[x]; 266 o[x2 + 2] = v[hx]; 267 o[x2 + 3] = yc[x + 1]; 268 } 269 270 o += outRB; 271 yc += rY; 272 u += rU; 273 v += rV; 274 } 275 } trunk/ColorConversions.h
r279 r282 22 22 23 23 extern void FastY420(UInt8 *baseAddr, AVFrame *picture); 24 extern void SlowY420(UInt8* baseAddr, int rowBytes, int width, int height, AVFrame * picture); 25 extern void RGB32toRGB32(UInt8 *baseAddr, long rowBytes, long width, long height, AVFrame *picture); 26 extern void BGR24toRGB24(UInt8 *baseAddr, long rowBytes, long width, long height, AVFrame *picture); 24 extern void Y420toY422(UInt8* baseAddr, int rowBytes, int width, int height, AVFrame * picture); 25 extern void RGB32toRGB32(UInt8 *baseAddr, int rowBytes, int width, int height, AVFrame *picture); 26 extern void BGR24toRGB24(UInt8 *baseAddr, int rowBytes, int width, int height, AVFrame *picture); 27 extern void Y422toY422(UInt8* o, int outRB, int width, int height, AVFrame * picture); trunk/FFusionCodec.c
r279 r282 924 924 else if (myDrp->pixelFormat == k2vuyPixelFormat && glob->avContext->pix_fmt == PIX_FMT_YUV420P) 925 925 { 926 SlowY420((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture);926 Y420toY422((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 927 927 } 928 928 else if (myDrp->pixelFormat == k24RGBPixelFormat && glob->avContext->pix_fmt == PIX_FMT_BGR24) … … 933 933 { 934 934 RGB32toRGB32((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 935 } 936 else if (myDrp->pixelFormat == k2vuyPixelFormat && glob->avContext->pix_fmt == PIX_FMT_YUV422P) 937 { 938 Y422toY422((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 935 939 } 936 940 else
