[xiph-cvs] cvs commit: speex/src speexenc.c
Jean-Marc Valin
jm at xiph.org
Tue Jan 28 00:48:07 PST 2003
jm 03/01/28 03:48:07
Modified: libspeex filters_sse.h
src speexenc.c
Log:
some rc2 fixes
Revision Changes Path
1.2 +9 -0 speex/libspeex/filters_sse.h
Index: filters_sse.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters_sse.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- filters_sse.h 26 Oct 2002 04:37:15 -0000 1.1
+++ filters_sse.h 28 Jan 2003 08:48:07 -0000 1.2
@@ -40,6 +40,11 @@
num = (float*)(((int)(__num+4))&0xfffffff0)-1;
den = (float*)(((int)(__den+4))&0xfffffff0)-1;
mem = (float*)(((int)(__mem+4))&0xfffffff0)-1;
+ for (i=0;i<=10;i++)
+ num[i]=den[i]=0;
+ for (i=0;i<10;i++)
+ mem[i]=0;
+
for (i=0;i<ord+1;i++)
{
num[i]=_num[i];
@@ -221,6 +226,10 @@
den = (float*)(((int)(__den+4))&0xfffffff0)-1;
mem = (float*)(((int)(__mem+4))&0xfffffff0)-1;
+ for (i=0;i<=10;i++)
+ den[i]=0;
+ for (i=0;i<10;i++)
+ mem[i]=0;
for (i=0;i<ord+1;i++)
{
den[i]=_den[i];
<p><p>1.71 +22 -14 speex/src/speexenc.c
Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- speexenc.c 13 Jan 2003 06:11:05 -0000 1.70
+++ speexenc.c 28 Jan 2003 08:48:07 -0000 1.71
@@ -401,7 +401,7 @@
srand(time(NULL));
if (ogg_stream_init(&os, rand())==-1)
{
- fprintf(stderr,"Stream init failed\n");
+ fprintf(stderr,"Error: stream init failed\n");
exit(1);
}
@@ -447,35 +447,35 @@
{
if (rate>48000)
{
- fprintf (stderr, "Sampling rate too high: %d Hz, try down-sampling\n", rate);
+ fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate);
exit(1);
} else if (rate>25000)
{
if (mode!=&speex_uwb_mode)
{
- fprintf (stderr, "WARNING: Trying to encode in %s at %d Hz. I'll do it but I suggest you try ultra-wideband instead\n", mode->modeName , rate);
+ fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try ultra-wideband instead\n", mode->modeName , rate);
}
} else if (rate>12500)
{
if (mode!=&speex_wb_mode)
{
- fprintf (stderr, "WARNING: Trying to encode in %s at %d Hz. I'll do it but I suggest you try wideband instead\n", mode->modeName , rate);
+ fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try wideband instead\n", mode->modeName , rate);
}
- } else if (rate>6000)
+ } else if (rate>=6000)
{
if (mode!=&speex_nb_mode)
{
- fprintf (stderr, "WARNING: Trying to encode in %s at %d Hz. I'll do it but I suggest you try narrowband instead\n", mode->modeName , rate);
+ fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try narrowband instead\n", mode->modeName , rate);
}
} else {
- fprintf (stderr, "Sampling rate too low: %d Hz\n", rate);
+ fprintf (stderr, "Error: sampling rate too low: %d Hz\n", rate);
exit(1);
}
} else if (!mode)
{
if (rate>48000)
{
- fprintf (stderr, "Bit-rate too high: %d Hz, try down-sampling\n", rate);
+ fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate);
exit(1);
} else if (rate>25000)
{
@@ -483,11 +483,11 @@
} else if (rate>12500)
{
mode=&speex_wb_mode;
- } else if (rate>6000)
+ } else if (rate>=6000)
{
mode=&speex_nb_mode;
} else {
- fprintf (stderr, "Bit-rate too low: %d Hz\n", rate);
+ fprintf (stderr, "Error: Sampling rate too low: %d Hz\n", rate);
exit(1);
}
} else if (!rate)
@@ -569,7 +569,7 @@
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
- fprintf (stderr,"Failed writing header to output stream\n");
+ fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
@@ -593,7 +593,7 @@
if (bitrate)
{
if (quality >= 0 && vbr_enabled)
- fprintf (stderr, "--bitrate option is overriding --quality\n");
+ fprintf (stderr, "Warning: --bitrate option is overriding --quality\n");
speex_encoder_ctl(st, SPEEX_SET_BITRATE, &bitrate);
}
if (vbr_enabled)
@@ -609,6 +609,14 @@
if (dtx_enabled)
speex_encoder_ctl(st, SPEEX_SET_DTX, &tmp);
}
+ if (dtx_enabled && !(vbr_enabled || abr_enabled || vad_enabled))
+ {
+ fprintf (stderr, "Warning: --dtx is useless without --vad\n");
+ } else if ((vbr_enabled || abr_enabled) && (vad_enabled || dtx_enabled))
+ {
+ fprintf (stderr, "Warning: --vad and --dtx are already implied by --vbr or --abr\n");
+ }
+
if (abr_enabled)
{
speex_encoder_ctl(st, SPEEX_SET_ABR, &abr_enabled);
@@ -683,7 +691,7 @@
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
- fprintf (stderr,"Failed writing header to output stream\n");
+ fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
@@ -712,7 +720,7 @@
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
- fprintf (stderr,"Failed writing header to output stream\n");
+ fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
<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