diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-05-07 16:31:02 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-05-09 16:59:42 +0200 |
commit | 570d63eef3f911869672cd20fa9c2abedb11093d (patch) | |
tree | 2b993b08de62362e2e59e8049e28a92e6c2bb0af /libswscale/swscale.c | |
parent | d9cb1e0e15e5cabb0b36f10cba079ea6532ed8e7 (diff) | |
download | ffmpeg-570d63eef3f911869672cd20fa9c2abedb11093d.tar.gz |
lavu: add FF_CEIL_RSHIFT and use it in various places.
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 827837eec7..5cab133378 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -373,8 +373,8 @@ static int swScale(SwsContext *c, const uint8_t *src[], yuv2packed2_fn yuv2packed2 = c->yuv2packed2; yuv2packedX_fn yuv2packedX = c->yuv2packedX; yuv2anyX_fn yuv2anyX = c->yuv2anyX; - const int chrSrcSliceY = srcSliceY >> c->chrSrcVSubSample; - const int chrSrcSliceH = -((-srcSliceH) >> c->chrSrcVSubSample); + const int chrSrcSliceY = srcSliceY >> c->chrSrcVSubSample; + const int chrSrcSliceH = FF_CEIL_RSHIFT(srcSliceH, c->chrSrcVSubSample); int should_dither = is9_OR_10BPS(c->srcFormat) || is16BPS(c->srcFormat); int lastDstY; @@ -491,7 +491,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], // Do we have enough lines in this slice to output the dstY line enough_lines = lastLumSrcY2 < srcSliceY + srcSliceH && - lastChrSrcY < -((-srcSliceY - srcSliceH) >> c->chrSrcVSubSample); + lastChrSrcY < FF_CEIL_RSHIFT(srcSliceY + srcSliceH, c->chrSrcVSubSample); if (!enough_lines) { lastLumSrcY = srcSliceY + srcSliceH - 1; |