diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-10-27 22:46:18 -0400 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-10-28 21:44:24 -0400 |
commit | 6dc0db6634f45cd1a9af5765c7a16ddf9cb0b341 (patch) | |
tree | 3f3a6e512ab19888e6a0c93059390fbecb19f92a /libavcodec/motion_est_template.c | |
parent | fab1562a50684783f5567c5262c942f5cda9656f (diff) |
avcodec/motion_est_template: replace qsort with AV_QSORT
This code is in a performance critical section. AV_QSORT is
substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance is worth the increase in binary size.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r-- | libavcodec/motion_est_template.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index 37ff1102ea..327a24b164 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -24,6 +24,7 @@ * Motion estimation template. */ +#include "libavutil/qsort.h" #include "mpegvideo.h" //Let us hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...) @@ -723,7 +724,7 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin, j++; } - qsort(minima, j, sizeof(Minima), minima_cmp); + AV_QSORT(minima, j, Minima, minima_cmp); for(; j<minima_count; j++){ minima[j].height=256*256*256*64; |