mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
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>
This commit is contained in:
commit
5710f55e49
@ -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…
Reference in New Issue
Block a user