diff --git a/libavfilter/blend_modes.c b/libavfilter/blend_modes.c index 9b1e78b146..35e365996c 100644 --- a/libavfilter/blend_modes.c +++ b/libavfilter/blend_modes.c @@ -92,22 +92,18 @@ static void fn0(NAME)(const uint8_t *_top, ptrdiff_t top_linesize, \ ptrdiff_t width, ptrdiff_t height, \ FilterParams *param, SliceParams *sliceparam) \ { \ - const PIXEL *top = (const PIXEL *)_top; \ - const PIXEL *bottom = (const PIXEL *)_bottom; \ - PIXEL *dst = (PIXEL *)_dst; \ const float opacity = param->opacity; \ \ - dst_linesize /= sizeof(PIXEL); \ - top_linesize /= sizeof(PIXEL); \ - bottom_linesize /= sizeof(PIXEL); \ - \ for (int i = 0; i < height; i++) { \ + const PIXEL *top = (const PIXEL *)_top; \ + const PIXEL *bottom = (const PIXEL *)_bottom; \ + PIXEL *dst = (PIXEL *)_dst; \ for (int j = 0; j < width; j++) { \ dst[j] = top[j] + ((EXPR)-top[j]) * opacity; \ } \ - dst += dst_linesize; \ - top += top_linesize; \ - bottom += bottom_linesize; \ + _dst += dst_linesize; \ + _top += top_linesize; \ + _bottom += bottom_linesize; \ } \ } diff --git a/libavfilter/vf_blend_init.h b/libavfilter/vf_blend_init.h index 98d440fe67..7f66796e3e 100644 --- a/libavfilter/vf_blend_init.h +++ b/libavfilter/vf_blend_init.h @@ -82,22 +82,18 @@ static void blend_normal_##name(const uint8_t *_top, ptrdiff_t top_linesize, ptrdiff_t width, ptrdiff_t height, \ FilterParams *param, SliceParams *sliceparam) \ { \ - const type *top = (const type*)_top; \ - const type *bottom = (const type*)_bottom; \ - type *dst = (type*)_dst; \ const float opacity = param->opacity; \ \ - dst_linesize /= sizeof(type); \ - top_linesize /= sizeof(type); \ - bottom_linesize /= sizeof(type); \ - \ for (int i = 0; i < height; i++) { \ + const type *top = (const type*)_top; \ + const type *bottom = (const type*)_bottom; \ + type *dst = (type*)_dst; \ for (int j = 0; j < width; j++) { \ dst[j] = top[j] * opacity + bottom[j] * (1.f - opacity); \ } \ - dst += dst_linesize; \ - top += top_linesize; \ - bottom += bottom_linesize; \ + _dst += dst_linesize; \ + _top += top_linesize; \ + _bottom += bottom_linesize; \ } \ }