diff options
author | Gregory Maxwell <greg@xiph.org> | 2009-06-05 23:01:54 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@octasic.com> | 2009-06-08 17:36:05 +0400 |
commit | 7144200a4713442cafae5089dec1c580e8902a9b (patch) | |
tree | abb50bb1e56bef4bccbec772f8273a75f0a23a90 /tools | |
parent | 682805468cea6ae54f2538ba9e6cb76ad2c47b0b (diff) |
Add support for interframe prediction control in celtenc.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/celtenc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/celtenc.c b/tools/celtenc.c index 580e999..7ed615d 100644 --- a/tools/celtenc.c +++ b/tools/celtenc.c @@ -217,6 +217,8 @@ void usage(void) printf (" --vbr Use variable bitrate encoding\n"); printf (" --comp n Encoding complexity (0-10)\n"); printf (" --framesize n Frame size (Default: 256)\n"); + printf (" --noltp Do not use long-term prediction\n"); + printf (" --independent Encode frames independently (implies noltp)\n"); printf (" --skeleton Outputs ogg skeleton metadata (may cause incompatibilities)\n"); printf (" --comment Add the given string as an extra comment. This may be\n"); printf (" used multiple times\n"); @@ -260,6 +262,8 @@ int main(int argc, char **argv) {"bitrate", required_argument, NULL, 0}, {"vbr",no_argument,NULL, 0}, {"comp", required_argument, NULL, 0}, + {"noltp", no_argument, NULL, 0}, + {"independent", no_argument, NULL, 0}, {"framesize", required_argument, NULL, 0}, {"skeleton",no_argument,NULL, 0}, {"help", no_argument, NULL, 0}, @@ -302,6 +306,7 @@ int main(int argc, char **argv) celt_int32_t lookahead = 0; int bytes_per_packet=48; int complexity=-127; + int prediction=2; int bitstream; @@ -367,6 +372,13 @@ int main(int argc, char **argv) } else if (strcmp(long_options[option_index].name,"framesize")==0) { frame_size=atoi (optarg); + } else if (strcmp(long_options[option_index].name,"noltp")==0) + { + if (prediction>1) + prediction=1; + } else if (strcmp(long_options[option_index].name,"independent")==0) + { + prediction=0; } else if (strcmp(long_options[option_index].name,"comment")==0) { if (!strchr(optarg, '=')) @@ -518,6 +530,12 @@ int main(int argc, char **argv) } } + if (celt_encoder_ctl(st, CELT_SET_PREDICTION(prediction)) != CELT_OK) + { + fprintf (stderr, "Prediction request failed\n"); + return 1; + } + if (complexity!=-127) { if (celt_encoder_ctl(st, CELT_SET_COMPLEXITY(complexity)) != CELT_OK) { |