|
|
@@ -914,7 +914,17 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, |
|
|
SWS_SINC | |
|
|
SWS_SINC | |
|
|
SWS_SPLINE | |
|
|
SWS_SPLINE | |
|
|
SWS_BICUBLIN); |
|
|
SWS_BICUBLIN); |
|
|
if (!i || (i & (i - 1))) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* provide a default scaler if not set by caller */ |
|
|
|
|
|
if (!i) { |
|
|
|
|
|
if (dstW < srcW && dstH < srcH) |
|
|
|
|
|
flags |= SWS_GAUSS; |
|
|
|
|
|
else if (dstW > srcW && dstH > srcH) |
|
|
|
|
|
flags |= SWS_SINC; |
|
|
|
|
|
else |
|
|
|
|
|
flags |= SWS_LANCZOS; |
|
|
|
|
|
c->flags = flags; |
|
|
|
|
|
} else if (i & (i - 1)) { |
|
|
av_log(c, AV_LOG_ERROR, |
|
|
av_log(c, AV_LOG_ERROR, |
|
|
"Exactly one scaler algorithm must be chosen\n"); |
|
|
"Exactly one scaler algorithm must be chosen\n"); |
|
|
return AVERROR(EINVAL); |
|
|
return AVERROR(EINVAL); |
|
|
|