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

Michael Niedermayer michaelni
Sun Nov 22 19:23:57 CET 2009


On Sun, Nov 22, 2009 at 06:50:43PM +0100, Vitor Sessak wrote:
> $subj, useful for SIPR, maybe also for WMAVoice.
>
> -Vitor

>  lsp.c    |   11 +++++++++++
>  lsp.h    |    2 ++
>  twinvq.c |   13 +------------
>  3 files changed, 14 insertions(+), 12 deletions(-)
> 042b0e5130e7f816bd560309e46e92eeae8d6a67  bubblesort.diff
> 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)

"float" should be in the function name 
and data & len are better as they are more generic
of course these changes could be done in a seperate patch

also it might be better to choose a function name that describes
the task and not the implementation
like:
sort_nearly_sorted_floats()
btw, iam not even sure if this is not closer to an insertion sort
than a bubble sort

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091122/cdbfccd5/attachment.pgp>



More information about the ffmpeg-devel mailing list