echo-cancel: Replace 'algo' prefix with 'method' 53/277053/3
authorJaechul Lee <jcsing.lee@samsung.com>
Thu, 30 Jun 2022 04:10:12 +0000 (13:10 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Fri, 1 Jul 2022 02:11:46 +0000 (11:11 +0900)
[Version] 15.0.23
[Issue Type] Rename

Change-Id: I8eee586036ef0f107f94413285b22a5736284318
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Makefile.am
src/echo-cancel/method_adrian.c [moved from src/echo-cancel/algo_adrian.c with 91% similarity]
src/echo-cancel/method_reference_copy.c [moved from src/echo-cancel/algo_reference_copy.c with 100% similarity]
src/echo-cancel/method_speex.c [moved from src/echo-cancel/algo_speex.c with 95% similarity]
src/echo-cancel/method_webrtc.cpp [moved from src/echo-cancel/algo_webrtc.cpp with 93% similarity]

index b3d0913..cd71bb1 100644 (file)
@@ -98,9 +98,9 @@ module_tizenaudio_source2_la_LIBADD = $(MODULE_LIBADD) libtizenaudio-util.la
 module_tizenaudio_source2_la_CFLAGS = $(MODULE_CFLAGS) -DPA_MODULE_NAME=module_tizenaudio_source2
 
 libprocessor_la_SOURCES = \
-          src/echo-cancel/algo_speex.c \
-          src/echo-cancel/algo_reference_copy.c \
-          src/echo-cancel/algo_adrian.c \
+          src/echo-cancel/method_speex.c \
+          src/echo-cancel/method_reference_copy.c \
+          src/echo-cancel/method_adrian.c \
           src/echo-cancel/adrian-aec.c \
           src/echo-cancel/processor.c \
           src/echo-cancel/processor.h \
@@ -110,7 +110,7 @@ libprocessor_la_LIBADD = $(AM_LIBADD) $(LIBSPEEX_LIBS)
 libprocessor_la_CFLAGS = $(AM_CFLAGS) $(PA_CFLAGS) $(LIBSPEEX_CFLAGS)
 
 if ENABLE_WEBRTC
-libprocessor_la_SOURCES += src/echo-cancel/algo_webrtc.cpp
+libprocessor_la_SOURCES += src/echo-cancel/method_webrtc.cpp
 libprocessor_la_LIBADD += $(WEBRTC_LIBS)
 libprocessor_la_CPPFLAGS = $(WEBRTC_CFLAGS) $(PA_CFLAGS) -DSUPPORT_METHOD_WEBRTC -std=c++17
 endif
similarity index 91%
rename from src/echo-cancel/algo_adrian.c
rename to src/echo-cancel/method_adrian.c
index a5d2e72..d673dcd 100644 (file)
 
 #include "adrian-aec.h"
 
-struct ec_adrian {
+struct method_adrian {
     int blocksize;
     AEC *aec;
 };
 
 void *adrian_create(size_t nframes, pa_sample_spec *ss) {
-    struct ec_adrian *adrian = NULL;
+    struct method_adrian *adrian = NULL;
 
     pa_assert(ss);
 
@@ -47,7 +47,7 @@ void *adrian_create(size_t nframes, pa_sample_spec *ss) {
         return NULL;
     }
 
-    adrian = pa_xnew0(struct ec_adrian, 1);
+    adrian = pa_xnew0(struct method_adrian, 1);
 
     if (!(adrian->aec = AEC_init(ss->rate, 0))) {
         pa_log_error("Failed to init AEC");
@@ -64,7 +64,7 @@ fail:
 }
 
 int32_t adrian_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
-    struct ec_adrian *adrian = priv;
+    struct method_adrian *adrian = priv;
     int i;
 
     assert(rec);
@@ -81,7 +81,7 @@ int32_t adrian_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
 }
 
 int32_t adrian_destroy(void *priv) {
-    struct ec_adrian *adrian = priv;
+    struct method_adrian *adrian = priv;
 
     pa_assert(adrian);
 
similarity index 95%
rename from src/echo-cancel/algo_speex.c
rename to src/echo-cancel/method_speex.c
index 161812a..5dd0b5f 100644 (file)
 
 #include <assert.h>
 
-struct algo_speex {
+struct method_speex {
     SpeexEchoState *echo_state;
     SpeexPreprocessState *preprocess;
 };
 
 void *speex_create(size_t nframes, pa_sample_spec *ss) {
-    struct algo_speex *speex = NULL;
+    struct method_speex *speex = NULL;
     spx_int32_t value = 1;
     int rate;
 
@@ -52,7 +52,7 @@ void *speex_create(size_t nframes, pa_sample_spec *ss) {
         return NULL;
     }
 
-    speex = pa_xnew0(struct algo_speex, 1);
+    speex = pa_xnew0(struct method_speex, 1);
 
     /* TODO: need to check. weird behavior */
     if (ss->channels == 2)
@@ -108,7 +108,7 @@ fail:
 }
 
 int32_t speex_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
-    struct algo_speex *speex = priv;
+    struct method_speex *speex = priv;
 
     assert(rec);
     assert(ref);
@@ -125,7 +125,7 @@ int32_t speex_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
 }
 
 int32_t speex_destroy(void *priv) {
-    struct algo_speex *speex = priv;
+    struct method_speex *speex = priv;
 
     if (speex->echo_state)
         speex_echo_state_destroy(speex->echo_state);
similarity index 93%
rename from src/echo-cancel/algo_webrtc.cpp
rename to src/echo-cancel/method_webrtc.cpp
index 8253820..4b7721c 100644 (file)
@@ -41,8 +41,8 @@ PA_C_DECL_BEGIN
 #include <pulse/timeval.h>
 #include <stdint.h>
 
-static void allocate_stream_buffer(struct algo_webrtc *webrtc, size_t nframes);
-static void deallocate_stream_buffer(struct algo_webrtc *webrtc);
+static void allocate_stream_buffer(struct method_webrtc *webrtc, size_t nframes);
+static void deallocate_stream_buffer(struct method_webrtc *webrtc);
 static void convert_s16_to_float(float *dst, int16_t *src, size_t n);
 static void convert_float_to_s16(int16_t *dst, float *src, size_t n);
 
@@ -51,7 +51,7 @@ int32_t webrtc_audio_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out);
 int32_t webrtc_audio_destroy(void *priv);
 PA_C_DECL_END
 
-struct algo_webrtc {
+struct method_webrtc {
     AudioProcessing *ap;
     Config config;
     StreamConfig *sconfig;
@@ -75,7 +75,7 @@ struct algo_webrtc {
 };
 
 void *webrtc_audio_create(size_t nframes, pa_sample_spec *ss) {
-    struct algo_webrtc *webrtc = NULL;
+    struct method_webrtc *webrtc = NULL;
     size_t fixed_bytes, request_bytes;
     Config config;
 
@@ -101,7 +101,7 @@ void *webrtc_audio_create(size_t nframes, pa_sample_spec *ss) {
         return NULL;
     }
 
-    webrtc = pa_xnew0(struct algo_webrtc, 1);
+    webrtc = pa_xnew0(struct method_webrtc, 1);
     webrtc->ss = *ss;
     webrtc->fixed_bytes = fixed_bytes;
     webrtc->fixed_frames = fixed_bytes / pa_frame_size(ss);
@@ -164,7 +164,7 @@ fail:
 }
 
 int32_t webrtc_audio_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
-    struct algo_webrtc *webrtc = (struct algo_webrtc *)priv;
+    struct method_webrtc *webrtc = (struct method_webrtc *)priv;
     pa_sample_spec ss;
     size_t frames;
 
@@ -225,7 +225,7 @@ int32_t webrtc_audio_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out)
 }
 
 int32_t webrtc_audio_destroy(void *priv) {
-    struct algo_webrtc *webrtc = (struct algo_webrtc *)priv;
+    struct method_webrtc *webrtc = (struct method_webrtc *)priv;
 
     pa_assert(webrtc);
 
@@ -238,7 +238,7 @@ int32_t webrtc_audio_destroy(void *priv) {
     return 0;
 }
 
-static void deallocate_stream_buffer(struct algo_webrtc *webrtc) {
+static void deallocate_stream_buffer(struct method_webrtc *webrtc) {
     pa_assert(webrtc);
 
     for (int i = 0; i < webrtc->ss.channels; i++) {
@@ -252,7 +252,7 @@ static void deallocate_stream_buffer(struct algo_webrtc *webrtc) {
     pa_xfree(webrtc->out_fbuf);
 }
 
-static void allocate_stream_buffer(struct algo_webrtc *webrtc, size_t nframes) {
+static void allocate_stream_buffer(struct method_webrtc *webrtc, size_t nframes) {
     int channels;
 
     pa_assert(webrtc);