Commit 5710f55e authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '6b3ff6f9'

* commit '6b3ff6f9':
  swscale: provide a default scaler if none is set

Conflicts:
	libswscale/utils.c

The default is left at bicubic until someone has compared the scalers
properly speed and quality wise.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7fb12342 6b3ff6f9
......@@ -1155,8 +1155,19 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
SWS_SINC |
SWS_SPLINE |
SWS_BICUBLIN);
if (!i || (i & (i - 1))) {
av_log(c, AV_LOG_ERROR, "Exactly one scaler algorithm must be chosen, got %X\n", i);
/* provide a default scaler if not set by caller */
if (!i) {
if (dstW < srcW && dstH < srcH)
flags |= SWS_BICUBIC;
else if (dstW > srcW && dstH > srcH)
flags |= SWS_BICUBIC;
else
flags |= SWS_BICUBIC;
c->flags = flags;
} else if (i & (i - 1)) {
av_log(c, AV_LOG_ERROR,
"Exactly one scaler algorithm must be chosen, got %X\n", i);
return AVERROR(EINVAL);
}
/* sanity check */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment