|
@@ -1175,35 +1175,35 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
/* yv12_to_nv12 */ |
|
|
/* yv12_to_nv12 */ |
|
|
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) && |
|
|
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) && |
|
|
(dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) { |
|
|
(dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) { |
|
|
c->swScale = planarToNv12Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarToNv12Wrapper; |
|
|
} |
|
|
} |
|
|
/* yuv2bgr */ |
|
|
/* yuv2bgr */ |
|
|
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P || |
|
|
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P || |
|
|
srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && |
|
|
srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && |
|
|
!(flags & SWS_ACCURATE_RND) && (c->dither == SWS_DITHER_BAYER || c->dither == SWS_DITHER_AUTO) && !(dstH & 1)) { |
|
|
!(flags & SWS_ACCURATE_RND) && (c->dither == SWS_DITHER_BAYER || c->dither == SWS_DITHER_AUTO) && !(dstH & 1)) { |
|
|
c->swScale = ff_yuv2rgb_get_func_ptr(c); |
|
|
|
|
|
|
|
|
c->swscale = ff_yuv2rgb_get_func_ptr(c); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (srcFormat == AV_PIX_FMT_YUV410P && |
|
|
if (srcFormat == AV_PIX_FMT_YUV410P && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && |
|
|
!(flags & SWS_BITEXACT)) { |
|
|
!(flags & SWS_BITEXACT)) { |
|
|
c->swScale = yvu9ToYv12Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = yvu9ToYv12Wrapper; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* bgr24toYV12 */ |
|
|
/* bgr24toYV12 */ |
|
|
if (srcFormat == AV_PIX_FMT_BGR24 && |
|
|
if (srcFormat == AV_PIX_FMT_BGR24 && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && |
|
|
!(flags & SWS_ACCURATE_RND)) |
|
|
!(flags & SWS_ACCURATE_RND)) |
|
|
c->swScale = bgr24ToYv12Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = bgr24ToYv12Wrapper; |
|
|
|
|
|
|
|
|
/* RGB/BGR -> RGB/BGR (no dither needed forms) */ |
|
|
/* RGB/BGR -> RGB/BGR (no dither needed forms) */ |
|
|
if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) |
|
|
if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) |
|
|
&& (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) |
|
|
&& (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) |
|
|
c->swScale= rgbToRgbWrapper; |
|
|
|
|
|
|
|
|
c->swscale = rgbToRgbWrapper; |
|
|
|
|
|
|
|
|
if ((srcFormat == AV_PIX_FMT_GBRP && dstFormat == AV_PIX_FMT_GBRAP) || |
|
|
if ((srcFormat == AV_PIX_FMT_GBRP && dstFormat == AV_PIX_FMT_GBRAP) || |
|
|
(srcFormat == AV_PIX_FMT_GBRAP && dstFormat == AV_PIX_FMT_GBRP)) |
|
|
(srcFormat == AV_PIX_FMT_GBRAP && dstFormat == AV_PIX_FMT_GBRP)) |
|
|
c->swScale = planarRgbToplanarRgbWrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarRgbToplanarRgbWrapper; |
|
|
|
|
|
|
|
|
#define isByteRGB(f) ( \ |
|
|
#define isByteRGB(f) ( \ |
|
|
f == AV_PIX_FMT_RGB32 || \ |
|
|
f == AV_PIX_FMT_RGB32 || \ |
|
@@ -1214,7 +1214,7 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
f == AV_PIX_FMT_BGR24) |
|
|
f == AV_PIX_FMT_BGR24) |
|
|
|
|
|
|
|
|
if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat)) |
|
|
if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat)) |
|
|
c->swScale = planarRgbToRgbWrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarRgbToRgbWrapper; |
|
|
|
|
|
|
|
|
if ((srcFormat == AV_PIX_FMT_GBRP9LE || srcFormat == AV_PIX_FMT_GBRP9BE || |
|
|
if ((srcFormat == AV_PIX_FMT_GBRP9LE || srcFormat == AV_PIX_FMT_GBRP9BE || |
|
|
srcFormat == AV_PIX_FMT_GBRP16LE || srcFormat == AV_PIX_FMT_GBRP16BE || |
|
|
srcFormat == AV_PIX_FMT_GBRP16LE || srcFormat == AV_PIX_FMT_GBRP16BE || |
|
@@ -1225,11 +1225,11 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE || |
|
|
dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE || |
|
|
dstFormat == AV_PIX_FMT_RGBA64LE || dstFormat == AV_PIX_FMT_RGBA64BE || |
|
|
dstFormat == AV_PIX_FMT_RGBA64LE || dstFormat == AV_PIX_FMT_RGBA64BE || |
|
|
dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE)) |
|
|
dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE)) |
|
|
c->swScale = planarRgb16ToRgb16Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarRgb16ToRgb16Wrapper; |
|
|
|
|
|
|
|
|
if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 && |
|
|
if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 && |
|
|
isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP) |
|
|
isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP) |
|
|
c->swScale = rgbToPlanarRgbWrapper; |
|
|
|
|
|
|
|
|
c->swscale = rgbToPlanarRgbWrapper; |
|
|
|
|
|
|
|
|
/* bswap 16 bits per pixel/component packed formats */ |
|
|
/* bswap 16 bits per pixel/component packed formats */ |
|
|
if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) || |
|
|
if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) || |
|
@@ -1265,16 +1265,16 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P12) || |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P12) || |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P14) || |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P14) || |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P16)) |
|
|
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P16)) |
|
|
c->swScale = packed_16bpc_bswap; |
|
|
|
|
|
|
|
|
c->swscale = packed_16bpc_bswap; |
|
|
|
|
|
|
|
|
if (usePal(srcFormat) && isByteRGB(dstFormat)) |
|
|
if (usePal(srcFormat) && isByteRGB(dstFormat)) |
|
|
c->swScale = palToRgbWrapper; |
|
|
|
|
|
|
|
|
c->swscale = palToRgbWrapper; |
|
|
|
|
|
|
|
|
if (srcFormat == AV_PIX_FMT_YUV422P) { |
|
|
if (srcFormat == AV_PIX_FMT_YUV422P) { |
|
|
if (dstFormat == AV_PIX_FMT_YUYV422) |
|
|
if (dstFormat == AV_PIX_FMT_YUYV422) |
|
|
c->swScale = yuv422pToYuy2Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = yuv422pToYuy2Wrapper; |
|
|
else if (dstFormat == AV_PIX_FMT_UYVY422) |
|
|
else if (dstFormat == AV_PIX_FMT_UYVY422) |
|
|
c->swScale = yuv422pToUyvyWrapper; |
|
|
|
|
|
|
|
|
c->swscale = yuv422pToUyvyWrapper; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* LQ converters if -sws 0 or -sws 4*/ |
|
|
/* LQ converters if -sws 0 or -sws 4*/ |
|
@@ -1282,21 +1282,21 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
/* yv12_to_yuy2 */ |
|
|
/* yv12_to_yuy2 */ |
|
|
if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) { |
|
|
if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) { |
|
|
if (dstFormat == AV_PIX_FMT_YUYV422) |
|
|
if (dstFormat == AV_PIX_FMT_YUYV422) |
|
|
c->swScale = planarToYuy2Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarToYuy2Wrapper; |
|
|
else if (dstFormat == AV_PIX_FMT_UYVY422) |
|
|
else if (dstFormat == AV_PIX_FMT_UYVY422) |
|
|
c->swScale = planarToUyvyWrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarToUyvyWrapper; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (srcFormat == AV_PIX_FMT_YUYV422 && |
|
|
if (srcFormat == AV_PIX_FMT_YUYV422 && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) |
|
|
c->swScale = yuyvToYuv420Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = yuyvToYuv420Wrapper; |
|
|
if (srcFormat == AV_PIX_FMT_UYVY422 && |
|
|
if (srcFormat == AV_PIX_FMT_UYVY422 && |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) |
|
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) |
|
|
c->swScale = uyvyToYuv420Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = uyvyToYuv420Wrapper; |
|
|
if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P) |
|
|
if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P) |
|
|
c->swScale = yuyvToYuv422Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = yuyvToYuv422Wrapper; |
|
|
if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P) |
|
|
if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P) |
|
|
c->swScale = uyvyToYuv422Wrapper; |
|
|
|
|
|
|
|
|
c->swscale = uyvyToYuv422Wrapper; |
|
|
|
|
|
|
|
|
#define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A) |
|
|
#define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A) |
|
|
/* simple copy */ |
|
|
/* simple copy */ |
|
@@ -1313,9 +1313,9 @@ void ff_get_unscaled_swscale(SwsContext *c) |
|
|
srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21)) |
|
|
srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21)) |
|
|
{ |
|
|
{ |
|
|
if (isPacked(c->srcFormat)) |
|
|
if (isPacked(c->srcFormat)) |
|
|
c->swScale = packedCopyWrapper; |
|
|
|
|
|
|
|
|
c->swscale = packedCopyWrapper; |
|
|
else /* Planar YUV or gray */ |
|
|
else /* Planar YUV or gray */ |
|
|
c->swScale = planarCopyWrapper; |
|
|
|
|
|
|
|
|
c->swscale = planarCopyWrapper; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ARCH_BFIN) |
|
|
if (ARCH_BFIN) |
|
|