Merge commit '6b3ff6f91a535d6383f41ca7bdf760165dcb6015'

* commit '6b3ff6f91a535d6383f41ca7bdf760165dcb6015':
  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: Michael Niedermayer <michaelni@gmx.at>
pull/37/merge
Michael Niedermayer 11 years ago
commit 5710f55e49
  1. 15
      libswscale/utils.c

@ -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 */

Loading…
Cancel
Save