Skip to content
Snippets Groups Projects
Commit 265f83fd authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde
Browse files

avutil/common: add FFDIFFSIGN macro


This is of use for defining comparator callbacks. Common approaches like
return x-y are not safe due to the risks of overflow.
Furthermore, the (x > y) - (x < y) trick is optimized to branchless
code.
This also documents this macro accordingly.

Reviewed-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: default avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 03f5bcd9
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment