[xiph-commits] r7128 - trunk/speex/libspeex

conrad at dactyl.lonelymoon.com conrad
Wed Jul 14 18:55:53 PDT 2004


Author: conrad
Date: Wed Jul 14 18:55:53 2004
New Revision: 7128

Modified:
trunk/speex/libspeex/modes.h
trunk/speex/libspeex/modes_noglobals.c
trunk/speex/libspeex/vbr.c
trunk/speex/libspeex/vbr.h
Log:
added const in front of vbr_*_thresh tables
(internal change, affects libspeex memory layout only;
no impact on modes.c code). Patch from Colin Ward.


Modified: trunk/speex/libspeex/modes.h
===================================================================
--- trunk/speex/libspeex/modes.h	2004-07-15 01:38:51 UTC (rev 7127)
+++ trunk/speex/libspeex/modes.h	2004-07-15 01:55:52 UTC (rev 7128)
@@ -141,7 +141,7 @@
int     defaultSubmode; /**< Default sub-mode to use when encoding */
int     low_quality_map[11]; /**< Mode corresponding to each quality setting */
int     quality_map[11]; /**< Mode corresponding to each quality setting */
-   float   (*vbr_thresh)[11];
+   const float (*vbr_thresh)[11];
int     nb_modes;
} SpeexSBMode;


Modified: trunk/speex/libspeex/modes_noglobals.c
===================================================================
--- trunk/speex/libspeex/modes_noglobals.c	2004-07-15 01:38:51 UTC (rev 7127)
+++ trunk/speex/libspeex/modes_noglobals.c	2004-07-15 01:55:52 UTC (rev 7128)
@@ -217,7 +217,7 @@
int     defaultSubmode, /**< Default sub-mode to use when encoding */
int     low_quality_map[], /**< Mode corresponding to each quality setting */
int     quality_map[], /**< Mode corresponding to each quality setting */
-   float   (*vbr_thresh)[11],
+   const float (*vbr_thresh)[11],
int     nb_modes
)
{

Modified: trunk/speex/libspeex/vbr.c
===================================================================
--- trunk/speex/libspeex/vbr.c	2004-07-15 01:38:51 UTC (rev 7127)
+++ trunk/speex/libspeex/vbr.c	2004-07-15 01:55:52 UTC (rev 7128)
@@ -42,7 +42,7 @@
#define NOISE_POW .3


-float vbr_nb_thresh[9][11]={
+const float vbr_nb_thresh[9][11]={
{-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}, /*   CNG   */
{ 3.5,  2.5,  2.0,  1.2,  0.5,  0.0, -0.5, -0.7, -0.8, -0.9, -1.0}, /*  2 kbps */
{10.0,  6.5,  5.2,  4.5,  3.9,  3.5,  3.0,  2.5,  2.3,  1.8,  1.0}, /*  6 kbps */
@@ -55,7 +55,7 @@
};


-float vbr_hb_thresh[5][11]={
+const float vbr_hb_thresh[5][11]={
{-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}, /* silence */
{-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}, /*  2 kbps */
{11.0, 11.0,  9.5,  8.5,  7.5,  6.0,  5.0,  3.9,  3.0,  2.0,  1.0}, /*  6 kbps */
@@ -63,7 +63,7 @@
{11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0,  9.8,  7.5,  5.5}  /* 18 kbps */
};

-float vbr_uhb_thresh[2][11]={
+const float vbr_uhb_thresh[2][11]={
{-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0}, /* silence */
{ 3.9,  2.5,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, -1.0}  /*  2 kbps */
};

Modified: trunk/speex/libspeex/vbr.h
===================================================================
--- trunk/speex/libspeex/vbr.h	2004-07-15 01:38:51 UTC (rev 7127)
+++ trunk/speex/libspeex/vbr.h	2004-07-15 01:55:52 UTC (rev 7128)
@@ -40,9 +40,9 @@

#define VBR_MEMORY_SIZE 5

-extern float vbr_nb_thresh[9][11];
-extern float vbr_hb_thresh[5][11];
-extern float vbr_uhb_thresh[2][11];
+extern const float vbr_nb_thresh[9][11];
+extern const float vbr_hb_thresh[5][11];
+extern const float vbr_uhb_thresh[2][11];

typedef struct VBRState {
float energy_alpha;



More information about the commits mailing list