diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-05-09 17:59:38 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-05-10 17:20:06 +0200 |
commit | 50e66726a237e07f6557eaca1da2e9eb18ee7fda (patch) | |
tree | eb080502558818b6e623309776e254d4be88beed /libavfilter/vf_geq.c | |
parent | d751a2526f9be0e8aa72cb2ebf9b8686c8888e89 (diff) | |
download | ffmpeg-50e66726a237e07f6557eaca1da2e9eb18ee7fda.tar.gz |
lavfi: use ceil right shift for chroma width/height.
This should fix several issues with odd dimensions inputs.
lut, vflip, pad and crop video filters also need to be checked for such
issues. It's possible sws is also affected.
Diffstat (limited to 'libavfilter/vf_geq.c')
-rw-r--r-- | libavfilter/vf_geq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c index a5396f8b1e..5ee75d1236 100644 --- a/libavfilter/vf_geq.c +++ b/libavfilter/vf_geq.c @@ -66,8 +66,8 @@ static inline double getpix(void *priv, double x, double y, int plane) AVFrame *picref = geq->picref; const uint8_t *src = picref->data[plane]; const int linesize = picref->linesize[plane]; - const int w = picref->width >> ((plane == 1 || plane == 2) ? geq->hsub : 0); - const int h = picref->height >> ((plane == 1 || plane == 2) ? geq->vsub : 0); + const int w = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(picref->width, geq->hsub) : picref->width; + const int h = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(picref->height, geq->vsub) : picref->height; if (!src) return 0; @@ -209,8 +209,8 @@ static int geq_filter_frame(AVFilterLink *inlink, AVFrame *in) int x, y; uint8_t *dst = out->data[plane]; const int linesize = out->linesize[plane]; - const int w = inlink->w >> ((plane == 1 || plane == 2) ? geq->hsub : 0); - const int h = inlink->h >> ((plane == 1 || plane == 2) ? geq->vsub : 0); + const int w = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(inlink->w, geq->hsub) : inlink->w; + const int h = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(inlink->h, geq->vsub) : inlink->h; values[VAR_W] = w; values[VAR_H] = h; |