Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2008-02-02 12:15:51 +0300
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2008-02-02 12:15:51 +0300
commit276e6afc03b93dc6d8e6df1e59502aaa9ff80379 (patch)
treecdf8dcd4733108183399164e836b6105145edfc2
parent69f9dea7c5d67f63b0ad602ee0cf46c2bedb5119 (diff)
Fixed a typo and removed an old warning from speexenc. Also, using more useful
bitrate defaults.
-rw-r--r--tools/celtdec.c2
-rw-r--r--tools/celtenc.c23
-rw-r--r--tools/wav_io.c5
3 files changed, 18 insertions, 12 deletions
diff --git a/tools/celtdec.c b/tools/celtdec.c
index 4160ec6..0806243 100644
--- a/tools/celtdec.c
+++ b/tools/celtdec.c
@@ -585,7 +585,7 @@ int main(int argc, char **argv)
celt_int32_t tmp=40;
char ch=13;
fputc (ch, stderr);
- fprintf (stderr, "Bitrate is use: %d bytes/packet ", tmp);
+ fprintf (stderr, "Bitrate in use: %d bytes/packet ", tmp);
}
/*Convert to short and save to output file*/
if (strlen(outFile)!=0)
diff --git a/tools/celtenc.c b/tools/celtenc.c
index 03bf2e5..cced959 100644
--- a/tools/celtenc.c
+++ b/tools/celtenc.c
@@ -282,7 +282,7 @@ int main(int argc, char **argv)
int comments_length;
int close_in=0, close_out=0;
int eos=0;
- celt_int32_t bitrate=64;
+ celt_int32_t bitrate=-1;
char first_bytes[12];
int wave_input=0;
celt_int32_t lookahead = 0;
@@ -431,19 +431,30 @@ int main(int argc, char **argv)
}
if (chan == 1)
+ {
mode = celt_mono;
+ if (bitrate < 0)
+ bitrate = 64;
+ if (bitrate < 40)
+ bitrate = 40;
+ if (bitrate > 80)
+ bitrate = 80;
+ }
else if (chan == 2)
+ {
mode = celt_stereo;
- else {
+ if (bitrate < 0)
+ bitrate = 128;
+ if (bitrate < 64)
+ bitrate = 64;
+ if (bitrate > 150)
+ bitrate = 150;
+ } else {
fprintf (stderr, "Only mono and stereo are supported\n");
return 1;
}
celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size);
- if (bitrate>250)
- bitrate = 150;
- if (bitrate<40)
- bitrate = 40;
bytes_per_packet = (bitrate*1000*frame_size/rate+4)/8;
celt_header_init(&header, rate, 1, mode);
diff --git a/tools/wav_io.c b/tools/wav_io.c
index a6a9e4b..aea7201 100644
--- a/tools/wav_io.c
+++ b/tools/wav_io.c
@@ -118,11 +118,6 @@ int read_wav_header(FILE *file, int *rate, int *channels, int *format, celt_int3
fread(&itmp, 4, 1, file);
itmp = le_int(itmp);
*rate = itmp;
- if (*rate != 8000 && *rate != 16000 && *rate != 11025 && *rate != 22050 && *rate != 32000 && *rate != 44100 && *rate != 48000)
- {
- fprintf (stderr, "Only 8 kHz (narrowband) and 16 kHz (wideband) supported (plus 11.025 kHz and 22.05 kHz, but your mileage may vary)\n");
- return -1;
- }
fread(&itmp, 4, 1, file);
bpersec = le_int(itmp);