const char *swscale_license(void)
{
#define LICENSE_PREFIX "libswscale license: "
- return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+ return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1];
}
typedef struct FormatEntry {
uint8_t is_supported_endianness :1;
} FormatEntry;
-static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
+static const FormatEntry format_entries[] = {
[AV_PIX_FMT_YUV420P] = { 1, 1 },
[AV_PIX_FMT_YUYV422] = { 1, 1 },
[AV_PIX_FMT_RGB24] = { 1, 1 },
[AV_PIX_FMT_BGR444LE] = { 1, 1 },
[AV_PIX_FMT_BGR444BE] = { 1, 1 },
[AV_PIX_FMT_YA8] = { 1, 1 },
- [AV_PIX_FMT_YA16BE] = { 1, 0 },
- [AV_PIX_FMT_YA16LE] = { 1, 0 },
+ [AV_PIX_FMT_YA16BE] = { 1, 1 },
+ [AV_PIX_FMT_YA16LE] = { 1, 1 },
[AV_PIX_FMT_BGR48BE] = { 1, 1 },
[AV_PIX_FMT_BGR48LE] = { 1, 1 },
[AV_PIX_FMT_BGRA64BE] = { 1, 1, 1 },
[AV_PIX_FMT_GBRP14BE] = { 1, 1 },
[AV_PIX_FMT_GBRP16LE] = { 1, 1 },
[AV_PIX_FMT_GBRP16BE] = { 1, 1 },
+ [AV_PIX_FMT_GBRPF32LE] = { 1, 1 },
+ [AV_PIX_FMT_GBRPF32BE] = { 1, 1 },
+ [AV_PIX_FMT_GBRAPF32LE] = { 1, 1 },
+ [AV_PIX_FMT_GBRAPF32BE] = { 1, 1 },
[AV_PIX_FMT_GBRAP] = { 1, 1 },
[AV_PIX_FMT_GBRAP16LE] = { 1, 1 },
[AV_PIX_FMT_GBRAP16BE] = { 1, 1 },
[AV_PIX_FMT_P016BE] = { 1, 1 },
[AV_PIX_FMT_GRAYF32LE] = { 1, 1 },
[AV_PIX_FMT_GRAYF32BE] = { 1, 1 },
+ [AV_PIX_FMT_YUVA422P12BE] = { 1, 1 },
+ [AV_PIX_FMT_YUVA422P12LE] = { 1, 1 },
+ [AV_PIX_FMT_YUVA444P12BE] = { 1, 1 },
+ [AV_PIX_FMT_YUVA444P12LE] = { 1, 1 },
+ [AV_PIX_FMT_NV24] = { 1, 1 },
+ [AV_PIX_FMT_NV42] = { 1, 1 },
+ [AV_PIX_FMT_Y210LE] = { 1, 0 },
};
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
{
- return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
+ return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_in : 0;
}
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
{
- return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
+ return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_out : 0;
}
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
{
- return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
+ return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_endianness : 0;
}
(*filterPos)[i] = xx;
// bilinear upscale / linear interpolate / area averaging
for (j = 0; j < filterSize; j++) {
- int64_t coeff= fone - FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16);
+ int64_t coeff = fone - FFABS((int64_t)xx * (1 << 16) - xDstInSrc) * (fone >> 16);
if (coeff < 0)
coeff = 0;
filter[i * filterSize + j] = coeff;
srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE &&
srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE &&
srcFormat != AV_PIX_FMT_GBRAP16BE && srcFormat != AV_PIX_FMT_GBRAP16LE &&
+ srcFormat != AV_PIX_FMT_GBRPF32BE && srcFormat != AV_PIX_FMT_GBRPF32LE &&
+ srcFormat != AV_PIX_FMT_GBRAPF32BE && srcFormat != AV_PIX_FMT_GBRAPF32LE &&
((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||
(flags & SWS_FAST_BILINEAR)))
c->chrSrcHSubSample = 1;
ff_free_filters(c2);
if (ff_init_filters(c2) < 0) {
sws_freeContext(c2);
+ c->cascaded_context[1] = NULL;
return -1;
}
/* unscaled special cases */
if (unscaled && !usesHFilter && !usesVFilter &&
(c->srcRange == c->dstRange || isAnyRGB(dstFormat) ||
- srcFormat == AV_PIX_FMT_GRAYF32 && dstFormat == AV_PIX_FMT_GRAY8 ||
- srcFormat == AV_PIX_FMT_GRAY8 && dstFormat == AV_PIX_FMT_GRAYF32)) {
+ isFloat(srcFormat) || isFloat(dstFormat))){
ff_get_unscaled_swscale(c);
if (c->swscale) {