Mercurial > mplayer.hg
comparison libswscale/swscale.c @ 30424:ef221b7526c5
Use a consistent convention for the names of the internal wrapper
functions. Improve readability.
author | stefano |
---|---|
date | Sat, 30 Jan 2010 21:56:33 +0000 |
parents | db62840d27ae |
children | 00bb44a07dbf |
comparison
equal
deleted
inserted
replaced
30423:d3ba36f72b57 | 30424:ef221b7526c5 |
---|---|
1265 return swScale_C; | 1265 return swScale_C; |
1266 #endif | 1266 #endif |
1267 #endif //!CONFIG_RUNTIME_CPUDETECT | 1267 #endif //!CONFIG_RUNTIME_CPUDETECT |
1268 } | 1268 } |
1269 | 1269 |
1270 static int PlanarToNV12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1270 static int planarToNv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1271 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1271 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1272 { | 1272 { |
1273 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; | 1273 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; |
1274 /* Copy Y plane */ | 1274 /* Copy Y plane */ |
1275 if (dstStride[0]==srcStride[0] && srcStride[0] > 0) | 1275 if (dstStride[0]==srcStride[0] && srcStride[0] > 0) |
1291 interleaveBytes(src[2], src[1], dst, c->srcW/2, srcSliceH/2, srcStride[2], srcStride[1], dstStride[0]); | 1291 interleaveBytes(src[2], src[1], dst, c->srcW/2, srcSliceH/2, srcStride[2], srcStride[1], dstStride[0]); |
1292 | 1292 |
1293 return srcSliceH; | 1293 return srcSliceH; |
1294 } | 1294 } |
1295 | 1295 |
1296 static int PlanarToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1296 static int planarToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1297 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1297 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1298 { | 1298 { |
1299 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; | 1299 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; |
1300 | 1300 |
1301 yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], srcStride[1], dstStride[0]); | 1301 yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], srcStride[1], dstStride[0]); |
1302 | 1302 |
1303 return srcSliceH; | 1303 return srcSliceH; |
1304 } | 1304 } |
1305 | 1305 |
1306 static int PlanarToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1306 static int planarToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1307 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1307 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1308 { | 1308 { |
1309 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; | 1309 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; |
1310 | 1310 |
1311 yv12touyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], srcStride[1], dstStride[0]); | 1311 yv12touyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], srcStride[1], dstStride[0]); |
1312 | 1312 |
1313 return srcSliceH; | 1313 return srcSliceH; |
1314 } | 1314 } |
1315 | 1315 |
1316 static int YUV422PToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1316 static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1317 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1317 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1318 { | 1318 { |
1319 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; | 1319 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; |
1320 | 1320 |
1321 yuv422ptoyuy2(src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0]); | 1321 yuv422ptoyuy2(src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0]); |
1322 | 1322 |
1323 return srcSliceH; | 1323 return srcSliceH; |
1324 } | 1324 } |
1325 | 1325 |
1326 static int YUV422PToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1326 static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1327 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1327 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1328 { | 1328 { |
1329 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; | 1329 uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY; |
1330 | 1330 |
1331 yuv422ptouyvy(src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0]); | 1331 yuv422ptouyvy(src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0]); |
1332 | 1332 |
1333 return srcSliceH; | 1333 return srcSliceH; |
1334 } | 1334 } |
1335 | 1335 |
1336 static int YUYV2YUV420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1336 static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1337 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1337 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1338 { | 1338 { |
1339 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; | 1339 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; |
1340 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2; | 1340 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2; |
1341 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2; | 1341 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2; |
1346 fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); | 1346 fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); |
1347 | 1347 |
1348 return srcSliceH; | 1348 return srcSliceH; |
1349 } | 1349 } |
1350 | 1350 |
1351 static int YUYV2YUV422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1351 static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1352 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1352 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1353 { | 1353 { |
1354 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; | 1354 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; |
1355 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY; | 1355 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY; |
1356 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY; | 1356 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY; |
1358 yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]); | 1358 yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]); |
1359 | 1359 |
1360 return srcSliceH; | 1360 return srcSliceH; |
1361 } | 1361 } |
1362 | 1362 |
1363 static int UYVY2YUV420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1363 static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1364 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1364 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1365 { | 1365 { |
1366 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; | 1366 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; |
1367 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2; | 1367 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2; |
1368 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2; | 1368 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2; |
1373 fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); | 1373 fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); |
1374 | 1374 |
1375 return srcSliceH; | 1375 return srcSliceH; |
1376 } | 1376 } |
1377 | 1377 |
1378 static int UYVY2YUV422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1378 static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1379 int srcSliceH, uint8_t* dstParam[], int dstStride[]) | 1379 int srcSliceH, uint8_t* dstParam[], int dstStride[]) |
1380 { | 1380 { |
1381 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; | 1381 uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY; |
1382 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY; | 1382 uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY; |
1383 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY; | 1383 uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY; |
1385 uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]); | 1385 uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]); |
1386 | 1386 |
1387 return srcSliceH; | 1387 return srcSliceH; |
1388 } | 1388 } |
1389 | 1389 |
1390 static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1390 static int palToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1391 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1391 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1392 { | 1392 { |
1393 const enum PixelFormat srcFormat= c->srcFormat; | 1393 const enum PixelFormat srcFormat= c->srcFormat; |
1394 const enum PixelFormat dstFormat= c->dstFormat; | 1394 const enum PixelFormat dstFormat= c->dstFormat; |
1395 void (*conv)(const uint8_t *src, uint8_t *dst, long num_pixels, | 1395 void (*conv)(const uint8_t *src, uint8_t *dst, long num_pixels, |
1422 | 1422 |
1423 return srcSliceH; | 1423 return srcSliceH; |
1424 } | 1424 } |
1425 | 1425 |
1426 /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */ | 1426 /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */ |
1427 static int rgb2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1427 static int rgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1428 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1428 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1429 { | 1429 { |
1430 const enum PixelFormat srcFormat= c->srcFormat; | 1430 const enum PixelFormat srcFormat= c->srcFormat; |
1431 const enum PixelFormat dstFormat= c->dstFormat; | 1431 const enum PixelFormat dstFormat= c->dstFormat; |
1432 const int srcBpp= (c->srcFormatBpp + 7) >> 3; | 1432 const int srcBpp= (c->srcFormatBpp + 7) >> 3; |
1496 } | 1496 } |
1497 } | 1497 } |
1498 return srcSliceH; | 1498 return srcSliceH; |
1499 } | 1499 } |
1500 | 1500 |
1501 static int bgr24toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1501 static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1502 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1502 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1503 { | 1503 { |
1504 rgb24toyv12( | 1504 rgb24toyv12( |
1505 src[0], | 1505 src[0], |
1506 dst[0]+ srcSliceY *dstStride[0], | 1506 dst[0]+ srcSliceY *dstStride[0], |
1511 if (dst[3]) | 1511 if (dst[3]) |
1512 fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); | 1512 fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); |
1513 return srcSliceH; | 1513 return srcSliceH; |
1514 } | 1514 } |
1515 | 1515 |
1516 static int yvu9toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1516 static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1517 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1517 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1518 { | 1518 { |
1519 int i; | 1519 int i; |
1520 | 1520 |
1521 /* copy Y */ | 1521 /* copy Y */ |
1547 fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); | 1547 fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); |
1548 return srcSliceH; | 1548 return srcSliceH; |
1549 } | 1549 } |
1550 | 1550 |
1551 /* unscaled copy like stuff (assumes nearly identical formats) */ | 1551 /* unscaled copy like stuff (assumes nearly identical formats) */ |
1552 static int packedCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1552 static int packedCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1553 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1553 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1554 { | 1554 { |
1555 if (dstStride[0]==srcStride[0] && srcStride[0] > 0) | 1555 if (dstStride[0]==srcStride[0] && srcStride[0] > 0) |
1556 memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]); | 1556 memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]); |
1557 else { | 1557 else { |
1572 } | 1572 } |
1573 } | 1573 } |
1574 return srcSliceH; | 1574 return srcSliceH; |
1575 } | 1575 } |
1576 | 1576 |
1577 static int planarCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, | 1577 static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, |
1578 int srcSliceH, uint8_t* dst[], int dstStride[]) | 1578 int srcSliceH, uint8_t* dst[], int dstStride[]) |
1579 { | 1579 { |
1580 int plane, i, j; | 1580 int plane, i, j; |
1581 for (plane=0; plane<4; plane++) { | 1581 for (plane=0; plane<4; plane++) { |
1582 int length= (plane==0 || plane==3) ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample); | 1582 int length= (plane==0 || plane==3) ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample); |
1663 && c->dstFormatBpp < 24 | 1663 && c->dstFormatBpp < 24 |
1664 && (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat))); | 1664 && (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat))); |
1665 | 1665 |
1666 /* yv12_to_nv12 */ | 1666 /* yv12_to_nv12 */ |
1667 if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) { | 1667 if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) { |
1668 c->swScale= PlanarToNV12Wrapper; | 1668 c->swScale= planarToNv12Wrapper; |
1669 } | 1669 } |
1670 /* yuv2bgr */ | 1670 /* yuv2bgr */ |
1671 if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) | 1671 if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) |
1672 && !(flags & SWS_ACCURATE_RND) && !(dstH&1)) { | 1672 && !(flags & SWS_ACCURATE_RND) && !(dstH&1)) { |
1673 c->swScale= ff_yuv2rgb_get_func_ptr(c); | 1673 c->swScale= ff_yuv2rgb_get_func_ptr(c); |
1674 } | 1674 } |
1675 | 1675 |
1676 if (srcFormat==PIX_FMT_YUV410P && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_BITEXACT)) { | 1676 if (srcFormat==PIX_FMT_YUV410P && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_BITEXACT)) { |
1677 c->swScale= yvu9toyv12Wrapper; | 1677 c->swScale= yvu9ToYv12Wrapper; |
1678 } | 1678 } |
1679 | 1679 |
1680 /* bgr24toYV12 */ | 1680 /* bgr24toYV12 */ |
1681 if (srcFormat==PIX_FMT_BGR24 && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_ACCURATE_RND)) | 1681 if (srcFormat==PIX_FMT_BGR24 && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_ACCURATE_RND)) |
1682 c->swScale= bgr24toyv12Wrapper; | 1682 c->swScale= bgr24ToYv12Wrapper; |
1683 | 1683 |
1684 /* RGB/BGR -> RGB/BGR (no dither needed forms) */ | 1684 /* RGB/BGR -> RGB/BGR (no dither needed forms) */ |
1685 if ( isAnyRGB(srcFormat) | 1685 if ( isAnyRGB(srcFormat) |
1686 && isAnyRGB(dstFormat) | 1686 && isAnyRGB(dstFormat) |
1687 && srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8 | 1687 && srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8 |
1695 && dstFormat != PIX_FMT_RGB32_1 | 1695 && dstFormat != PIX_FMT_RGB32_1 |
1696 && dstFormat != PIX_FMT_BGR32_1 | 1696 && dstFormat != PIX_FMT_BGR32_1 |
1697 && srcFormat != PIX_FMT_RGB48LE && dstFormat != PIX_FMT_RGB48LE | 1697 && srcFormat != PIX_FMT_RGB48LE && dstFormat != PIX_FMT_RGB48LE |
1698 && srcFormat != PIX_FMT_RGB48BE && dstFormat != PIX_FMT_RGB48BE | 1698 && srcFormat != PIX_FMT_RGB48BE && dstFormat != PIX_FMT_RGB48BE |
1699 && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) | 1699 && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) |
1700 c->swScale= rgb2rgbWrapper; | 1700 c->swScale= rgbToRgbWrapper; |
1701 | 1701 |
1702 if ((usePal(srcFormat) && ( | 1702 if ((usePal(srcFormat) && ( |
1703 dstFormat == PIX_FMT_RGB32 || | 1703 dstFormat == PIX_FMT_RGB32 || |
1704 dstFormat == PIX_FMT_RGB32_1 || | 1704 dstFormat == PIX_FMT_RGB32_1 || |
1705 dstFormat == PIX_FMT_RGB24 || | 1705 dstFormat == PIX_FMT_RGB24 || |
1706 dstFormat == PIX_FMT_BGR32 || | 1706 dstFormat == PIX_FMT_BGR32 || |
1707 dstFormat == PIX_FMT_BGR32_1 || | 1707 dstFormat == PIX_FMT_BGR32_1 || |
1708 dstFormat == PIX_FMT_BGR24))) | 1708 dstFormat == PIX_FMT_BGR24))) |
1709 c->swScale= pal2rgbWrapper; | 1709 c->swScale= palToRgbWrapper; |
1710 | 1710 |
1711 if (srcFormat == PIX_FMT_YUV422P) { | 1711 if (srcFormat == PIX_FMT_YUV422P) { |
1712 if (dstFormat == PIX_FMT_YUYV422) | 1712 if (dstFormat == PIX_FMT_YUYV422) |
1713 c->swScale= YUV422PToYuy2Wrapper; | 1713 c->swScale= yuv422pToYuy2Wrapper; |
1714 else if (dstFormat == PIX_FMT_UYVY422) | 1714 else if (dstFormat == PIX_FMT_UYVY422) |
1715 c->swScale= YUV422PToUyvyWrapper; | 1715 c->swScale= yuv422pToUyvyWrapper; |
1716 } | 1716 } |
1717 | 1717 |
1718 /* LQ converters if -sws 0 or -sws 4*/ | 1718 /* LQ converters if -sws 0 or -sws 4*/ |
1719 if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) { | 1719 if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) { |
1720 /* yv12_to_yuy2 */ | 1720 /* yv12_to_yuy2 */ |
1721 if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) { | 1721 if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) { |
1722 if (dstFormat == PIX_FMT_YUYV422) | 1722 if (dstFormat == PIX_FMT_YUYV422) |
1723 c->swScale= PlanarToYuy2Wrapper; | 1723 c->swScale= planarToYuy2Wrapper; |
1724 else if (dstFormat == PIX_FMT_UYVY422) | 1724 else if (dstFormat == PIX_FMT_UYVY422) |
1725 c->swScale= PlanarToUyvyWrapper; | 1725 c->swScale= planarToUyvyWrapper; |
1726 } | 1726 } |
1727 } | 1727 } |
1728 if(srcFormat == PIX_FMT_YUYV422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) | 1728 if(srcFormat == PIX_FMT_YUYV422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) |
1729 c->swScale= YUYV2YUV420Wrapper; | 1729 c->swScale= yuyvToYuv420Wrapper; |
1730 if(srcFormat == PIX_FMT_UYVY422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) | 1730 if(srcFormat == PIX_FMT_UYVY422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) |
1731 c->swScale= UYVY2YUV420Wrapper; | 1731 c->swScale= uyvyToYuv420Wrapper; |
1732 if(srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P) | 1732 if(srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P) |
1733 c->swScale= YUYV2YUV422Wrapper; | 1733 c->swScale= yuyvToYuv422Wrapper; |
1734 if(srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P) | 1734 if(srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P) |
1735 c->swScale= UYVY2YUV422Wrapper; | 1735 c->swScale= uyvyToYuv422Wrapper; |
1736 | 1736 |
1737 #ifdef COMPILE_ALTIVEC | 1737 #ifdef COMPILE_ALTIVEC |
1738 if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && | 1738 if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && |
1739 !(c->flags & SWS_BITEXACT) && | 1739 !(c->flags & SWS_BITEXACT) && |
1740 srcFormat == PIX_FMT_YUV420P) { | 1740 srcFormat == PIX_FMT_YUV420P) { |
1758 && c->chrDstVSubSample == c->chrSrcVSubSample | 1758 && c->chrDstVSubSample == c->chrSrcVSubSample |
1759 && dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 | 1759 && dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 |
1760 && srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21)) | 1760 && srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21)) |
1761 { | 1761 { |
1762 if (isPacked(c->srcFormat)) | 1762 if (isPacked(c->srcFormat)) |
1763 c->swScale= packedCopy; | 1763 c->swScale= packedCopyWrapper; |
1764 else /* Planar YUV or gray */ | 1764 else /* Planar YUV or gray */ |
1765 c->swScale= planarCopy; | 1765 c->swScale= planarCopyWrapper; |
1766 } | 1766 } |
1767 #if ARCH_BFIN | 1767 #if ARCH_BFIN |
1768 if (flags & SWS_CPU_CAPS_BFIN) | 1768 if (flags & SWS_CPU_CAPS_BFIN) |
1769 ff_bfin_get_unscaled_swscale (c); | 1769 ff_bfin_get_unscaled_swscale (c); |
1770 #endif | 1770 #endif |