/* * copyright (c) 2012 Michael Niedermayer <[email protected]> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVUTIL_QSORT_H #define AVUTIL_QSORT_H #include "macros.h" /** * 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. */ #define AV_QSORT(p, num, type, cmp) … /** * Merge sort, this sort requires a temporary buffer and is stable, its worst * case time is O(n log n) * @param p must be a lvalue pointer, this function may exchange it with tmp * @param tmp must be a lvalue pointer, this function may exchange it with p */ #define AV_MSORT(p, tmp, num, type, cmp) … #endif /* AVUTIL_QSORT_H */