[FFmpeg-devel] [PATCH 2/4] zmbvenc: ensure mx, my, xored are always set together in zmbv_me()
Tomas Härdin
tjoppen at acc.umu.se
Thu Dec 20 18:29:57 EET 2018
ons 2018-12-19 klockan 22:00 +0000 skrev matthew.w.fearnley at gmail.com:
> > From: Matthew Fearnley <matthew.w.fearnley at gmail.com>
>
> Store the value of *xored computed within block_cmp() in a local variable,
> and only update the *xored parameter at the same time as *mx,*my are set.
> This ensures that the value of *xored is accurate for the value of *mx,*my
> whenever the function ends.
>
> Note that the local variable is not needed in the intial block_cmp for (0,0)
> because *mx,*my and *xored are all set there.
>
> The previous logic worked by exiting early if ever !*xored, but put implicit
> requirements on block_cmp() to:
> - always return 0 if !xored
> - never return a negative value
> ---
> libavcodec/zmbvenc.c | 4 +++-
Looks good
/Tomas
More information about the ffmpeg-devel
mailing list