audioresample: convert from liboil to orc
[platform/upstream/gstreamer.git] / gst / audioresample / gstaudioresample.c
index 6336db5..6ec4213 100644 (file)
 #include <gst/audio/audio.h>
 #include <gst/base/gstbasetransform.h>
 
-#if defined AUDIORESAMPLE_FORMAT_AUTO
-#define OIL_ENABLE_UNSTABLE_API
-#include <liboil/liboilprofile.h>
-#include <liboil/liboil.h>
-#endif
+#include <orc/orc.h>
+#include <orc-test/orctest.h>
+#include <orc-test/orcprofile.h>
+
 
 GST_DEBUG_CATEGORY (audio_resample_debug);
 #define GST_CAT_DEFAULT audio_resample_debug
@@ -1391,13 +1390,13 @@ _benchmark_int_int (SpeexResamplerState * st)
 static gboolean
 _benchmark_integer_resampling (void)
 {
-  OilProfile a, b;
+  OrcProfile a, b;
   gdouble av, bv;
   SpeexResamplerState *sta, *stb;
   int i;
 
-  oil_profile_init (&a);
-  oil_profile_init (&b);
+  orc_profile_init (&a);
+  orc_profile_init (&b);
 
   sta = resample_float_resampler_init (1, 48000, 24000, 4, NULL);
   if (sta == NULL) {
@@ -1414,23 +1413,23 @@ _benchmark_integer_resampling (void)
 
   /* Benchmark */
   for (i = 0; i < 10; i++) {
-    oil_profile_start (&a);
+    orc_profile_start (&a);
     if (!_benchmark_int_float (sta))
       goto error;
-    oil_profile_stop (&a);
+    orc_profile_stop (&a);
   }
 
   /* Benchmark */
   for (i = 0; i < 10; i++) {
-    oil_profile_start (&b);
+    orc_profile_start (&b);
     if (!_benchmark_int_int (stb))
       goto error;
-    oil_profile_stop (&b);
+    orc_profile_stop (&b);
   }
 
   /* Handle results */
-  oil_profile_get_ave_std (&a, &av, NULL);
-  oil_profile_get_ave_std (&b, &bv, NULL);
+  orc_profile_get_ave_std (&a, &av, NULL);
+  orc_profile_get_ave_std (&b, &bv, NULL);
 
   /* Remember benchmark result in global variable */
   gst_audio_resample_use_int = (av > bv);
@@ -1458,8 +1457,6 @@ plugin_init (GstPlugin * plugin)
   GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0,
       "audio resampling element");
 #if defined AUDIORESAMPLE_FORMAT_AUTO
-  oil_init ();
-
   if (!_benchmark_integer_resampling ())
     return FALSE;
 #endif