[FFmpeg-devel] [PATCH] all: simplify qsort comparators, and add const-correctness
george at nsup.org
Sun Oct 25 16:12:55 CET 2015
Le quartidi 4 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit :
> Seems like the (x > y) - (x < y) trick works very well: GCC optimizes
> it to branch-less code, and it is overflow safe:
> Will submit patch to convert all qsort comparators (the ones for
> integers) to this form, yielding two benefits:
Nice. Maybe make it a macro: AV_DIFFSIGN(x, y).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: Digital signature
More information about the ffmpeg-devel