Commit 6dc0db66 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent fab1562a
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* Motion estimation template. * Motion estimation template.
*/ */
#include "libavutil/qsort.h"
#include "mpegvideo.h" #include "mpegvideo.h"
//Let us hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...) //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, ...@@ -723,7 +724,7 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
j++; j++;
} }
qsort(minima, j, sizeof(Minima), minima_cmp); AV_QSORT(minima, j, Minima, minima_cmp);
for(; j<minima_count; j++){ for(; j<minima_count; j++){
minima[j].height=256*256*256*64; minima[j].height=256*256*256*64;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment