shithub: libsamplerate

Download patch

ref: 35d9495320ac69aa73e1feeebc7d67d4c80840e0
parent: 2a4a515dafbfee7e4f83286b3e8f6dd68aecee2a
author: Erik de Castro Lopo <erikd@mingus>
date: Thu Mar 30 21:11:08 EST 2006

util.[ch] : Add new function reverse_data.

--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
     * tests/varispeed_test.c tests/Makefile.am
     Add new test and hook into build.
 
+    * tests/util.[ch]
+    Add new function reverse_data.
+
 2005-12-29  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * examples/sndfile-resample.c
--- a/tests/util.c
+++ b/tests/util.c
@@ -146,6 +146,24 @@
 	return ;
 } /* deinterleave_data */
 
+void
+reverse_data (float *data, int datalen)
+{	int left, right ;
+	float temp ;
+
+	left = 0 ;
+	right = datalen - 1 ;
+
+	while (left < right)
+	{	temp = data [left] ;
+		data [left] = data [right] ;
+		data [right] = temp ;
+		left ++ ;
+		right -- ;
+		} ;
+
+} /* reverse_data */
+
 /*
 ** Do not edit or modify anything in this comment block.
 ** The arch-tag line is a file identity tag for the GNU Arch 
--- a/tests/util.h
+++ b/tests/util.h
@@ -30,6 +30,9 @@
 void interleave_data (const float *in, float *out, int frames, int channels) ;
 
 void deinterleave_data (const float *in, float *out, int frames, int channels) ;
+
+void reverse_data (float *data, int datalen) ;
+
 /*
 ** Do not edit or modify anything in this comment block.
 ** The arch-tag line is a file identity tag for the GNU Arch