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

Pascal Massimino pascal.massimino
Mon Nov 23 03:16:53 CET 2009


On Sun, Nov 22, 2009 at 2:26 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:

> Michael Niedermayer wrote:
>
>> On Sun, Nov 22, 2009 at 09:05:55PM +0000, 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.
>>>
>>
>> its slow for the case here AFAIK
>>
>
> Exactly.


Any reasonably implemented qsort() switches to insertion sort when the
length to sort goes under MAGIC_LEN
constant (insert your best guess for MAGIC_LEN. I like '11' but that's just
me).

http://portal.acm.org/citation.cfm?id=359631   (1978, mind you)



>
>
>
>>  >  lsp.c    |    9 +++++++++
>>> >  lsp.h    |    7 +++++++
>>> >  twinvq.c |   13 +------------
>>> >  3 files changed, 17 insertions(+), 12 deletions(-)
>>> > c04080c721cb706cf640d6092c08957a3f1d4d4f  bubblesort2.diff
>>>
>>
>> ok
>>
>
> Applied.
>
> -Vitor
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list