[xiph-cvs] cvs commit: speex/libspeex nb_celp.c speex.h
Jean-Marc Valin
jm at xiph.org
Fri Dec 13 22:29:09 PST 2002
jm 02/12/14 01:29:08
Modified: libspeex nb_celp.c speex.h
Log:
More ABR work...
Revision Changes Path
1.94 +23 -0 speex/libspeex/nb_celp.c
Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- nb_celp.c 13 Dec 2002 22:59:27 -0000 1.93
+++ nb_celp.c 14 Dec 2002 06:29:08 -0000 1.94
@@ -1452,6 +1452,29 @@
case SPEEX_GET_VAD:
(*(int*)ptr) = st->vad_enabled;
break;
+ case SPEEX_SET_ABR:
+ st->abr_enabled = (*(int*)ptr);
+ {
+ int i=10, rate, target, vbr_qual;
+ target = (*(int*)ptr);
+ while (i>=0)
+ {
+ speex_encoder_ctl(st, SPEEX_SET_QUALITY, &i);
+ speex_encoder_ctl(st, SPEEX_GET_BITRATE, &rate);
+ if (rate <= target)
+ break;
+ i--;
+ }
+ vbr_qual=i;
+ if (vbr_qual<0)
+ vbr_qual=0;
+ speex_encoder_ctl(st, SPEEX_SET_VBR_QUALITY, &vbr_qual);
+ }
+
+ break;
+ case SPEEX_GET_ABR:
+ (*(int*)ptr) = st->abr_enabled;
+ break;
case SPEEX_SET_VBR_QUALITY:
st->vbr_quality = (*(float*)ptr);
break;
<p><p>1.69 +3 -0 speex/libspeex/speex.h
Index: speex.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/speex.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- speex.h 12 Dec 2002 07:51:35 -0000 1.68
+++ speex.h 14 Dec 2002 06:29:08 -0000 1.69
@@ -109,6 +109,9 @@
#define SPEEX_SET_VAD 30
#define SPEEX_GET_VAD 31
+#define SPEEX_SET_ABR 32
+#define SPEEX_GET_ABR 33
+
/* Used internally, not to be used in applications */
#define SPEEX_GET_PI_GAIN 100
<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