[FFmpeg-cvslog] opus_celt: move postfilter taps table to the shared opustab.c file

Rostislav Pehlivanov git at videolan.org
Tue Jul 11 01:52:02 EEST 2017


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Mon Jul 10 23:31:24 2017 +0100| [ba67c2349c15317678441942185500752cae37d1] | committer: Rostislav Pehlivanov

opus_celt: move postfilter taps table to the shared opustab.c file

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba67c2349c15317678441942185500752cae37d1
---

 libavcodec/opus_celt.c | 11 +++--------
 libavcodec/opustab.c   |  6 ++++++
 libavcodec/opustab.h   |  2 ++
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c
index 23749a7d22..3de92f0cb2 100644
--- a/libavcodec/opus_celt.c
+++ b/libavcodec/opus_celt.c
@@ -594,11 +594,6 @@ static void celt_postfilter(CeltFrame *f, CeltBlock *block)
 
 static int parse_postfilter(CeltFrame *f, OpusRangeCoder *rc, int consumed)
 {
-    static const float postfilter_taps[3][3] = {
-        { 0.3066406250f, 0.2170410156f, 0.1296386719f },
-        { 0.4638671875f, 0.2680664062f, 0.0           },
-        { 0.7998046875f, 0.1000976562f, 0.0           }
-    };
     int i;
 
     memset(f->block[0].pf_gains_new, 0, sizeof(f->block[0].pf_gains_new));
@@ -620,9 +615,9 @@ static int parse_postfilter(CeltFrame *f, OpusRangeCoder *rc, int consumed)
                 CeltBlock *block = &f->block[i];
 
                 block->pf_period_new = FFMAX(period, CELT_POSTFILTER_MINPERIOD);
-                block->pf_gains_new[0] = gain * postfilter_taps[tapset][0];
-                block->pf_gains_new[1] = gain * postfilter_taps[tapset][1];
-                block->pf_gains_new[2] = gain * postfilter_taps[tapset][2];
+                block->pf_gains_new[0] = gain * ff_celt_postfilter_taps[tapset][0];
+                block->pf_gains_new[1] = gain * ff_celt_postfilter_taps[tapset][1];
+                block->pf_gains_new[2] = gain * ff_celt_postfilter_taps[tapset][2];
             }
         }
 
diff --git a/libavcodec/opustab.c b/libavcodec/opustab.c
index d0b4bf4bd5..5cb0ad6595 100644
--- a/libavcodec/opustab.c
+++ b/libavcodec/opustab.c
@@ -1085,6 +1085,12 @@ const uint32_t ff_celt_pvq_u[1272] = {
     1409933619
 };
 
+const float ff_celt_postfilter_taps[3][3] = {
+    { 0.3066406250f, 0.2170410156f, 0.1296386719f },
+    { 0.4638671875f, 0.2680664062f, 0.0           },
+    { 0.7998046875f, 0.1000976562f, 0.0           }
+};
+
 DECLARE_ALIGNED(32, const float, ff_celt_window)[120] = {
     6.7286966e-05f, 0.00060551348f, 0.0016815970f, 0.0032947962f, 0.0054439943f,
     0.0081276923f, 0.011344001f, 0.015090633f, 0.019364886f, 0.024163635f,
diff --git a/libavcodec/opustab.h b/libavcodec/opustab.h
index 2701a392fd..b4589869ef 100644
--- a/libavcodec/opustab.h
+++ b/libavcodec/opustab.h
@@ -151,6 +151,8 @@ extern const uint8_t  ff_celt_hadamard_order[];
 extern const uint16_t ff_celt_qn_exp2[];
 extern const uint32_t ff_celt_pvq_u[1272];
 
+extern const float    ff_celt_postfilter_taps[3][3];
+
 extern const float    ff_celt_window2[120];
 
 DECLARE_ALIGNED(32, extern const float, ff_celt_window)[120];



More information about the ffmpeg-cvslog mailing list