Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-06-22 10:31:33 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-06-22 10:31:33 +0300
commit42a0972a111a4d93d5a8ef2dbb8fb2aa97be9986 (patch)
tree8a6e8a90724b1a99960cdddb17df6a92cfc3a409
parentdb48088e9f075f581fb87f03b1f7c7b74787a2f6 (diff)
Remove more useless code
-rw-r--r--dnn/common.c65
-rw-r--r--dnn/lpcnet_private.h9
-rw-r--r--lpcnet_sources.mk1
3 files changed, 0 insertions, 75 deletions
diff --git a/dnn/common.c b/dnn/common.c
deleted file mode 100644
index 9fae8b3b..00000000
--- a/dnn/common.c
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/* Copyright (c) 2017-2019 Mozilla */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include "freq.h"
-#include "lpcnet_private.h"
-
-
-static void single_interp(float *x, const float *left, const float *right, int id)
-{
- int i;
- float ref[NB_BANDS];
- float pred[3*NB_BANDS];
- RNN_COPY(ref, x, NB_BANDS);
- for (i=0;i<NB_BANDS;i++) pred[i] = .5f*(left[i] + right[i]);
- for (i=0;i<NB_BANDS;i++) pred[NB_BANDS+i] = left[i];
- for (i=0;i<NB_BANDS;i++) pred[2*NB_BANDS+i] = right[i];
- for (i=0;i<NB_BANDS;i++) {
- x[i] = pred[id*NB_BANDS + i];
- }
- if (0) {
- float err = 0;
- for (i=0;i<NB_BANDS;i++) {
- err += (x[i]-ref[i])*(x[i]-ref[i]);
- }
- printf("%f\n", sqrt(err/NB_BANDS));
- }
-}
-
-void perform_double_interp(float features[4][NB_TOTAL_FEATURES], const float *mem, int best_id) {
- int id0, id1;
- best_id += (best_id >= FORBIDDEN_INTERP);
- id0 = best_id / 3;
- id1 = best_id % 3;
- single_interp(features[0], mem, features[1], id0);
- single_interp(features[2], features[1], features[3], id1);
-}
diff --git a/dnn/lpcnet_private.h b/dnn/lpcnet_private.h
index a3eea0a6..3cead7a9 100644
--- a/dnn/lpcnet_private.h
+++ b/dnn/lpcnet_private.h
@@ -9,19 +9,12 @@
#include "plc_data.h"
#include "kiss99.h"
-#define BITS_PER_CHAR 8
-
#define PITCH_MIN_PERIOD 32
#define PITCH_MAX_PERIOD 256
#define PITCH_FRAME_SIZE 320
#define PITCH_BUF_SIZE (PITCH_MAX_PERIOD+PITCH_FRAME_SIZE)
-#define MULTI 4
-#define MULTI_MASK (MULTI-1)
-
-#define FORBIDDEN_INTERP 7
-
#define PLC_MAX_FEC 100
#define MAX_FEATURE_BUFFER_SIZE 4
@@ -99,8 +92,6 @@ struct LPCNetPLCState {
void preemphasis(float *y, float *mem, const float *x, float coef, int N);
-void perform_double_interp(float features[4][NB_TOTAL_FEATURES], const float *mem, int best_id);
-
void compute_frame_features(LPCNetEncState *st, const float *in);
void decode_packet(float features[4][NB_TOTAL_FEATURES], float *vq_mem, const unsigned char buf[8]);
diff --git a/lpcnet_sources.mk b/lpcnet_sources.mk
index f029d5a7..adad6dec 100644
--- a/lpcnet_sources.mk
+++ b/lpcnet_sources.mk
@@ -1,6 +1,5 @@
LPCNET_SOURCES = \
dnn/burg.c \
-dnn/common.c \
dnn/freq.c \
dnn/kiss99.c \
dnn/lpcnet.c \