Go to the source code of this file.

#define  AV_QSORT(p, num, type, cmp) 
 Quicksort This sort is fast, and fully inplace but not stable and it is possible to construct input that requires O(n^2) time but this is very unlikely to happen with non constructed input. More...


#define  AV_MSORT(p, tmp, num, type, cmp) 
 Merge sort, this sort requires a temporary buffer and is stable, its worst case time is O(n log n) More...


◆ AV_QSORT
#define AV_QSORT 
( 

p, 



num, 



type, 



cmp 

) 
 
Quicksort This sort is fast, and fully inplace but not stable and it is possible to construct input that requires O(n^2) time but this is very unlikely to happen with non constructed input.
Definition at line 33 of file qsort.h.
◆ AV_MSORT
Value: do {\
int idx=
cmp(p+
a[0], p+
a[1]) > 0;\
}\
}\
}\
}\
} while (0)
Merge sort, this sort requires a temporary buffer and is stable, its worst case time is O(n log n)
 Parameters

p  must be a lvalue pointer, this function may exchange it with tmp 
tmp  must be a lvalue pointer, this function may exchange it with p 
Definition at line 103 of file qsort.h.
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags)
compares a block (either a full macroblock or a partition thereof) against a proposed motioncompensa...