[FFmpeg-devel] [PATCH 3/3] x86/vf_blend: fix warnings about trailing empty parameters

Henrik Gramner henrik at gramner.com
Sat Jul 11 00:54:50 EEST 2020


On Thu, Jul 9, 2020 at 4:54 PM James Almer <jamrial at gmail.com> wrote:
> @@ -38,7 +38,7 @@ pb_255: times 16 db 255
>
>  SECTION .text
>
> -%macro BLEND_INIT 2-3
> +%macro BLEND_INIT 2
>  %if ARCH_X86_64
>  cglobal blend_%1, 6, 9, %2, top, top_linesize, bottom, bottom_linesize, dst, dst_linesize, width, end, x
>      mov    widthd, dword widthm

Wont this change the output? width was previously doubled a few lines
down when called with three args (%0 means "number of arguments").

The existing macro is written in a somewhat obfuscated way using the
number of arguments as an implicit boolean flag, instead of just using
a boolean flag directly.

Maybe it'd be better to change this macro to have 3 fixed arguments
and use %3 instead of %0 == 3 in combination with adding a default 0
value in the other macros with a variable number of arguments, e.g.
"%macro BLEND_SIMPLE 2-3 0"


More information about the ffmpeg-devel mailing list