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_fieldmatch.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_fieldmatch.c')
-rw-r--r-- | libavfilter/vf_fieldmatch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index 3495895f08..3a6f806a8b 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -153,12 +153,12 @@ AVFILTER_DEFINE_CLASS(fieldmatch); static int get_width(const FieldMatchContext *fm, const AVFrame *f, int plane) { - return plane ? f->width >> fm->hsub : f->width; + return plane ? FF_CEIL_RSHIFT(f->width, fm->hsub) : f->width; } static int get_height(const FieldMatchContext *fm, const AVFrame *f, int plane) { - return plane ? f->height >> fm->vsub : f->height; + return plane ? FF_CEIL_RSHIFT(f->height, fm->vsub) : f->height; } static int64_t luma_abs_diff(const AVFrame *f1, const AVFrame *f2) @@ -270,8 +270,8 @@ static int calc_combed_score(const FieldMatchContext *fm, const AVFrame *src) uint8_t *cmkp = fm->cmask_data[0]; uint8_t *cmkpU = fm->cmask_data[1]; uint8_t *cmkpV = fm->cmask_data[2]; - const int width = src->width >> fm->hsub; - const int height = src->height >> fm->vsub; + const int width = FF_CEIL_RSHIFT(src->width, fm->hsub); + const int height = FF_CEIL_RSHIFT(src->height, fm->vsub); const int cmk_linesize = fm->cmask_linesize[0] << 1; const int cmk_linesizeUV = fm->cmask_linesize[2]; uint8_t *cmkpp = cmkp - (cmk_linesize>>1); |