aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lsp.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2009-11-22 22:25:58 +0000
committerVitor Sessak <vitor1001@gmail.com>2009-11-22 22:25:58 +0000
commit419b2be813e3391e046858b7e3d5f07a81f3d263 (patch)
tree54380510fe5ab53072fca9aab7a40f1f63f5f11f /libavcodec/lsp.c
parent6c2289b52e63dcab6d8d729b3a75e02df2c02f3e (diff)
downloadffmpeg-419b2be813e3391e046858b7e3d5f07a81f3d263.tar.gz
Make sorting function used in TwinVQ a shared function
Originally committed as revision 20584 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lsp.c')
-rw-r--r--libavcodec/lsp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index ce0fbc28b8..739e1e0bfa 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -173,3 +173,12 @@ void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
lpc2[-lp_half_order] = 0.5*(paf-qaf);
}
}
+
+void ff_sort_nearly_sorted_floats(float *vals, int len)
+{
+ int i,j;
+
+ for (i = 0; i < len - 1; i++)
+ for (j = i; j >= 0 && vals[j] > vals[j+1]; j--)
+ FFSWAP(float, vals[j], vals[j+1]);
+}