Changeset 92806167 in ffmpeg
- Timestamp:
- Jan 14, 2015, 4:17:24 PM (10 years ago)
- Branches:
- master
- Children:
- 27513846, f86f39cb
- Parents:
- 9a4aaae3
- git-author:
- Paul B Mahol <onemda@gmail.com> (12/17/14 13:54:43)
- git-committer:
- Vittorio Giovara <vittorio.giovara@gmail.com> (01/14/15 16:17:24)
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
libswscale/input.c
r9a4aaae3 r92806167 597 597 } 598 598 599 static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused) 600 { 601 uint16_t *dst = (uint16_t *)_dst; 602 int i; 603 for (i = 0; i < width; i++) 604 dst[i] = src[3][i] << 6; 605 } 606 599 607 static void planar_rgb_to_uv(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], int width) 600 608 { … … 746 754 c->readChrPlanar = planar_rgb10le_to_uv; 747 755 break; 756 case AV_PIX_FMT_GBRAP16LE: 748 757 case AV_PIX_FMT_GBRP16LE: 749 758 c->readChrPlanar = planar_rgb16le_to_uv; … … 755 764 c->readChrPlanar = planar_rgb10be_to_uv; 756 765 break; 766 case AV_PIX_FMT_GBRAP16BE: 757 767 case AV_PIX_FMT_GBRP16BE: 758 768 c->readChrPlanar = planar_rgb16be_to_uv; 759 769 break; 770 case AV_PIX_FMT_GBRAP: 760 771 case AV_PIX_FMT_GBRP: 761 772 c->readChrPlanar = planar_rgb_to_uv; … … 954 965 c->readLumPlanar = planar_rgb10le_to_y; 955 966 break; 967 case AV_PIX_FMT_GBRAP16LE: 956 968 case AV_PIX_FMT_GBRP16LE: 957 969 c->readLumPlanar = planar_rgb16le_to_y; … … 963 975 c->readLumPlanar = planar_rgb10be_to_y; 964 976 break; 977 case AV_PIX_FMT_GBRAP16BE: 965 978 case AV_PIX_FMT_GBRP16BE: 966 979 c->readLumPlanar = planar_rgb16be_to_y; 967 980 break; 981 case AV_PIX_FMT_GBRAP: 982 c->readAlpPlanar = planar_rgb_to_a; 968 983 case AV_PIX_FMT_GBRP: 969 984 c->readLumPlanar = planar_rgb_to_y; -
libswscale/output.c
r9a4aaae3 r92806167 1278 1278 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat); 1279 1279 int i; 1280 int hasAlpha = 0;1280 int hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) && alpSrc; 1281 1281 uint16_t **dest16 = (uint16_t**)dest; 1282 1282 int SH = 22 + 7 - desc->comp[0].depth_minus1; … … 1330 1330 dest16[1][i] = B >> SH; 1331 1331 dest16[2][i] = R >> SH; 1332 if (hasAlpha) 1333 dest16[3][i] = A; 1332 1334 } else { 1333 1335 dest[0][i] = G >> 22; 1334 1336 dest[1][i] = B >> 22; 1335 1337 dest[2][i] = R >> 22; 1338 if (hasAlpha) 1339 dest[3][i] = A; 1336 1340 } 1337 1341 } … … 1341 1345 dest16[1][i] = av_bswap16(dest16[1][i]); 1342 1346 dest16[2][i] = av_bswap16(dest16[2][i]); 1347 if (hasAlpha) 1348 dest16[3][i] = av_bswap16(dest16[3][i]); 1343 1349 } 1344 1350 } … … 1446 1452 case AV_PIX_FMT_GBRP16BE: 1447 1453 case AV_PIX_FMT_GBRP16LE: 1454 case AV_PIX_FMT_GBRAP: 1448 1455 *yuv2anyX = yuv2gbrp_full_X_c; 1449 1456 break; -
libswscale/swscale.c
r9a4aaae3 r92806167 269 269 } else if (c->readLumPlanar && !isAlpha) { 270 270 c->readLumPlanar(formatConvBuffer, src_in, srcW); 271 src = formatConvBuffer; 272 } else if (c->readAlpPlanar && isAlpha) { 273 c->readAlpPlanar(formatConvBuffer, src_in, srcW); 271 274 src = formatConvBuffer; 272 275 } -
libswscale/swscale_internal.h
r9a4aaae3 r92806167 459 459 /** 460 460 * Functions to read planar input, such as planar RGB, and convert 461 * internally to Y/UV .461 * internally to Y/UV/A. 462 462 */ 463 463 /** @{ */ … … 465 465 void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], 466 466 int width); 467 void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width); 467 468 /** @} */ 468 469 -
libswscale/swscale_unscaled.c
r9a4aaae3 r92806167 485 485 av_get_pix_fmt_name(c->dstFormat)); 486 486 } 487 488 return srcSliceH; 489 } 490 491 static int planarRgbToplanarRgbWrapper(SwsContext *c, 492 const uint8_t *src[], int srcStride[], 493 int srcSliceY, int srcSliceH, 494 uint8_t *dst[], int dstStride[]) 495 { 496 copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW, 497 dst[0], dstStride[0]); 498 copyPlane(src[1], srcStride[1], srcSliceY, srcSliceH, c->srcW, 499 dst[1], dstStride[1]); 500 copyPlane(src[2], srcStride[2], srcSliceY, srcSliceH, c->srcW, 501 dst[2], dstStride[2]); 502 if (dst[3]) 503 fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); 487 504 488 505 return srcSliceH; … … 1055 1072 c->swscale = rgbToRgbWrapper; 1056 1073 1074 /* RGB to planar RGB */ 1075 if ((srcFormat == AV_PIX_FMT_GBRP && dstFormat == AV_PIX_FMT_GBRAP) || 1076 (srcFormat == AV_PIX_FMT_GBRAP && dstFormat == AV_PIX_FMT_GBRP)) 1077 c->swscale = planarRgbToplanarRgbWrapper; 1078 1057 1079 #define isByteRGB(f) ( \ 1058 1080 f == AV_PIX_FMT_RGB32 || \ … … 1078 1100 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) || 1079 1101 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YA16) || 1102 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRAP16)|| 1080 1103 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) || 1081 1104 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) || -
libswscale/utils.c
r9a4aaae3 r92806167 181 181 [AV_PIX_FMT_GBRP16LE] = { 1, 0 }, 182 182 [AV_PIX_FMT_GBRP16BE] = { 1, 0 }, 183 [AV_PIX_FMT_GBRAP] = { 1, 1 }, 184 [AV_PIX_FMT_GBRAP16LE] = { 1, 0 }, 185 [AV_PIX_FMT_GBRAP16BE] = { 1, 0 }, 183 186 [AV_PIX_FMT_XYZ12BE] = { 0, 0, 1 }, 184 187 [AV_PIX_FMT_XYZ12LE] = { 0, 0, 1 }, -
tests/ref/fate/filter-pixfmts-copy
r9a4aaae3 r92806167 13 13 bgr8 24bd566170343d06fec6fccfff5abc54 14 14 bgra 76a18a5151242fa137133f604cd624d2 15 gbrap 28d63d5ac84bb33bf3aea48785baa876 15 16 gbrp 76204621e200a3cc633012f6720c7005 16 17 gbrp10be 2ca4a4a589a7dc461ff186913c7a69e5 -
tests/ref/fate/filter-pixfmts-null
r9a4aaae3 r92806167 13 13 bgr8 24bd566170343d06fec6fccfff5abc54 14 14 bgra 76a18a5151242fa137133f604cd624d2 15 gbrap 28d63d5ac84bb33bf3aea48785baa876 15 16 gbrp 76204621e200a3cc633012f6720c7005 16 17 gbrp10be 2ca4a4a589a7dc461ff186913c7a69e5 -
tests/ref/fate/filter-pixfmts-scale
r9a4aaae3 r92806167 13 13 bgr8 7f007fa6c153a16e808a9c51605a4016 14 14 bgra a5e7040f9a80cccd65e5acf2ca09ace5 15 gbrap 08ea11431bc436d788494d678b3edc6f 15 16 gbrp 205c50f8359cb4ba2827a7711dea2cc6 16 17 gbrp10be 30b7f9d5ef5da474fb794743146236aa -
tests/ref/fate/filter-pixfmts-vflip
r9a4aaae3 r92806167 13 13 bgr8 c60f93fd152c6903391d1fe9decd3547 14 14 bgra 7f9b799fb48544e49ce93e91d7f9fca8 15 gbrap cb0d9cb2813c04a19a346c316c1ffbb9 15 16 gbrp 25c1bce192daefab910d51a56b52199e 16 17 gbrp10be 6fe980f9ca94cbcdb9e01f4e906fdf19
Note:
See TracChangeset
for help on using the changeset viewer.