[FFmpeg-devel] [PATCH] Make bubblesort() a common function

Benjamin Larsson banan
Mon Nov 23 09:31:48 CET 2009


M?ns Rullg?rd wrote:
> Vitor Sessak <vitor1001 at gmail.com> writes:
>
>   
>> $subj, useful for SIPR, maybe also for WMAVoice.
>>
>> -Vitor
>> Index: libavcodec/lsp.c
>> ===================================================================
>> --- libavcodec/lsp.c	(revision 20569)
>> +++ libavcodec/lsp.c	(working copy)
>> @@ -173,3 +173,14 @@
>>          lpc2[-lp_half_order] = 0.5*(paf-qaf);
>>      }
>>  }
>> +
>> +void ff_bubblesort(float *lsp, int lp_order)
>>     
>
> Whats wrong with qsort?  It's even standard C.
>
>   

There are other issues also, qsort sorts different on different platforms.

r19949 | reimar | 2009-09-21 12:28:31 +0200 (Mon, 21 Sep 2009) | 8 lines

Use a custom radix sort implementation instead of qsort in dnxhd encoder.
This is mainly to avoid test failures due to implementation-defined
behaviour of qsort when elements are equal, giving different results
for each of FreeBSD, Linux/glibc and Solaris.
In addition it is about 35 % faster, effect on overall speed is minimal
though (< 2%).
Regression tests are unchanged (i.e. identical to Linux/glibc).

MvH
Benjamin Larsson





More information about the ffmpeg-devel mailing list