diff options
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 5f4dabfad7..b372e9698c 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1228,11 +1228,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, (flags & SWS_FAST_BILINEAR))) c->chrSrcHSubSample = 1; - // Note the -((-x)>>y) is so that we always round toward +inf. - c->chrSrcW = -((-srcW) >> c->chrSrcHSubSample); - c->chrSrcH = -((-srcH) >> c->chrSrcVSubSample); - c->chrDstW = -((-dstW) >> c->chrDstHSubSample); - c->chrDstH = -((-dstH) >> c->chrDstVSubSample); + // Note the FF_CEIL_RSHIFT is so that we always round toward +inf. + c->chrSrcW = FF_CEIL_RSHIFT(srcW, c->chrSrcHSubSample); + c->chrSrcH = FF_CEIL_RSHIFT(srcH, c->chrSrcVSubSample); + c->chrDstW = FF_CEIL_RSHIFT(dstW, c->chrDstHSubSample); + c->chrDstH = FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample); FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail); |