Skip to content

Commit f36b764

Browse files
Synchronize changes from 1.6 master branch [ci skip]
d5f8468 update libspeex, libspeexdsp (Pull in relevant changes)
2 parents fa2fc83 + d5f8468 commit f36b764

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

vendor/libspeex/libspeex/nb_celp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ int nb_encoder_ctl(void *state, int request, void *ptr)
264264
#if !defined(DISABLE_VBR) && !defined(DISABLE_FLOAT_API)
265265
case SPEEX_SET_VBR_QUALITY:
266266
st->vbr_quality = (*(float*)ptr);
267+
if (st->vbr_quality < 0)
268+
st->vbr_quality = 0;
269+
else if (st->vbr_quality > 10)
270+
st->vbr_quality = 10;
267271
break;
268272
case SPEEX_GET_VBR_QUALITY:
269273
(*(float*)ptr) = st->vbr_quality;

vendor/libspeex/libspeexdsp/smallft.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
#include "os_support.h"
3939

4040
static void drfti1(int n, float *wa, int *ifac){
41-
static int ntryh[4] = { 4,2,3,5 };
42-
static float tpi = 6.28318530717958648f;
41+
static const int ntryh[4] = { 4,2,3,5 };
42+
static const float tpi = 6.28318530717958648f;
4343
float arg,argh,argld,fi;
4444
int ntry=0,i,j=-1;
4545
int k1, l1, l2, ib;
@@ -170,7 +170,7 @@ static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
170170

171171
static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
172172
float *wa2,float *wa3){
173-
static float hsqt2 = .70710678118654752f;
173+
static const float hsqt2 = .70710678118654752f;
174174
int i,k,t0,t1,t2,t3,t4,t5,t6;
175175
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
176176
t0=l1*ido;
@@ -273,7 +273,7 @@ static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
273273
static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
274274
float *c2,float *ch,float *ch2,float *wa){
275275

276-
static float tpi=6.283185307179586f;
276+
static const float tpi=6.283185307179586f;
277277
int idij,ipph,i,j,k,l,ic,ik,is;
278278
int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
279279
float dc2,ai1,ai2,ar1,ar2,ds2;
@@ -687,8 +687,8 @@ static void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
687687

688688
static void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
689689
float *wa2){
690-
static float taur = -.5f;
691-
static float taui = .8660254037844386f;
690+
static const float taur = -.5f;
691+
static const float taui = .8660254037844386f;
692692
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
693693
float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
694694
t0=l1*ido;
@@ -750,7 +750,7 @@ static void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
750750

751751
static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
752752
float *wa2,float *wa3){
753-
static float sqrt2=1.414213562373095f;
753+
static const float sqrt2=1.414213562373095f;
754754
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
755755
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
756756
t0=l1*ido;
@@ -841,7 +841,7 @@ static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
841841

842842
static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
843843
float *c2,float *ch,float *ch2,float *wa){
844-
static float tpi=6.283185307179586f;
844+
static const float tpi=6.283185307179586f;
845845
int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
846846
t11,t12;
847847
float dc2,ai1,ai2,ar1,ar2,ds2;

vendor/libspeex/libspeexdsp/testresample2.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@
3030
POSSIBILITY OF SUCH DAMAGE.
3131
*/
3232

33-
#define _USE_MATH_DEFINES
34-
#include <math.h>
35-
3633
#ifdef HAVE_CONFIG_H
3734
#include "config.h"
3835
#endif
3936

4037
#include "speex/speex_resampler.h"
4138
#include <stdio.h>
39+
#include <math.h>
4240
#include <stdlib.h>
4341

42+
#ifndef M_PI
43+
#define M_PI 3.14159265358979323846
44+
#endif
45+
4446
#define PERIOD 32
4547
#define INBLOCK 1024
4648
#define RATE 48000

0 commit comments

Comments
 (0)