[xiph-cvs] cvs commit: speex/libspeex modes.c nb_celp.c vbr.c
Jean-Marc Valin
jm at xiph.org
Tue Jan 14 23:20:40 PST 2003
jm 03/01/15 02:20:40
Modified: libspeex modes.c nb_celp.c vbr.c
Log:
adjusted VBR for the new 4 kbps mode (still early stage)
Revision Changes Path
1.99 +2 -2 speex/libspeex/modes.c
Index: modes.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/modes.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- modes.c 15 Jan 2003 06:47:42 -0000 1.98
+++ modes.c 15 Jan 2003 07:20:39 -0000 1.99
@@ -482,8 +482,8 @@
0.7,
{NULL, &wb_submode1, &wb_submode2, &wb_submode3, &wb_submode4, NULL, NULL, NULL},
3,
- {1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 7},
- {0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4},
+ {1, 8, 2, 3, 4, 5, 5, 6, 6, 7, 7},
+ {1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4},
vbr_hb_thresh,
5
};
<p><p>1.111 +10 -4 speex/libspeex/nb_celp.c
Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- nb_celp.c 15 Jan 2003 06:47:42 -0000 1.110
+++ nb_celp.c 15 Jan 2003 07:20:39 -0000 1.111
@@ -358,7 +358,9 @@
if (st->vbr_enabled)
{
int mode;
- mode = 7;
+ int choice=0;
+ float min_diff=100;
+ mode = 8;
while (mode)
{
int v1;
@@ -368,11 +370,15 @@
thresh = vbr_nb_thresh[mode][v1];
else
thresh = (st->vbr_quality-v1)*vbr_nb_thresh[mode][v1+1] + (1+v1-st->vbr_quality)*vbr_nb_thresh[mode][v1];
- if (st->relative_quality > thresh)
- break;
+ if (st->relative_quality > thresh &&
+ st->relative_quality-thresh<min_diff)
+ {
+ choice = mode;
+ min_diff = st->relative_quality-thresh;
+ }
mode--;
}
-
+ mode=choice;
if (mode==0)
{
if (st->dtx_count==0 || lsp_dist>.05 || st->dtx_count>20)
<p><p>1.19 +3 -2 speex/libspeex/vbr.c
Index: vbr.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/vbr.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- vbr.c 10 Jan 2003 07:27:54 -0000 1.18
+++ vbr.c 15 Jan 2003 07:20:39 -0000 1.19
@@ -45,12 +45,13 @@
float vbr_nb_thresh[8][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 */
- { 8.5, 5.6, 4.7, 4.2, 3.9, 3.5, 3.0, 2.5, 2.0, 1.0, 0.0}, /* 6 kbps */
+ {10.0, 6.6, 5.2, 4.5, 3.9, 3.5, 3.0, 2.5, 2.3, 1.8, 1.0}, /* 6 kbps */
{11.0, 8.5, 7.5, 6.5, 5.0, 3.9, 3.9, 3.9, 3.5, 3.0, 1.0}, /* 8 kbps */
{11.0, 11.0, 9.9, 9.0, 8.0, 7.0, 6.5, 6.0, 5.0, 4.0, 2.0}, /* 11 kbps */
{11.0, 11.0, 11.0, 11.0, 9.5, 9.0, 8.0, 7.0, 6.5, 5.0, 3.0}, /* 15 kbps */
{11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 9.5, 8.5, 8.0, 6.5, 4.0}, /* 18 kbps */
- {11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 9.8, 7.5, 5.5} /* 24 kbps */
+ {11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 9.8, 7.5, 5.5}, /* 24 kbps */
+ { 8.5, 5.3, 3.7, 3.0, 2.5, 2.0, 1.8, 1.5, 1.0, 0.0, 0.0} /* 4 kbps */
};
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list