[xiph-cvs] cvs commit: vorbis-tools/oggenc/man oggenc.1
Monty
xiphmont at xiph.org
Tue Dec 30 04:45:20 PST 2003
xiphmont 03/12/30 07:45:20
Modified: oggenc encode.c oggenc.c
oggenc/man oggenc.1
Log:
Update oggenc and manpage to deal with new rate management.
Revision Changes Path
1.31 +34 -38 vorbis-tools/oggenc/encode.c
Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/encode.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- encode.c 3 Sep 2003 07:58:04 -0000 1.30
+++ encode.c 30 Dec 2003 12:45:19 -0000 1.31
@@ -46,46 +46,41 @@
static void set_advanced_encoder_options(adv_opt *opts, int count,
vorbis_info *vi)
{
- int hard = 0;
- int avg = 0;
- struct ovectl_ratemanage_arg ai;
+ int manage = 0;
+ struct ovectl_ratemanage2_arg ai;
int i;
double dval;
long lval;
- vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE_GET, &ai);
+ vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_GET, &ai);
for(i=0; i < count; i++) {
fprintf(stderr, _("Setting advanced encoder option \"%s\" to %s\n"),
opts[i].arg, opts[i].val);
- if(!strcmp(opts[i].arg, "bitrate_average_window")) {
- SETD(ai.bitrate_av_window);
- avg = 1;
- }
- else if(!strcmp(opts[i].arg, "bitrate_average_window_center")) {
- SETD(ai.bitrate_av_window_center);
- avg = 1;
- }
- else if(!strcmp(opts[i].arg, "bitrate_average_low")) {
- SETL(ai.bitrate_av_lo);
- avg = 1;
- }
- else if(!strcmp(opts[i].arg, "bitrate_average_high")) {
- SETL(ai.bitrate_av_hi);
- avg = 1;
+ if(!strcmp(opts[i].arg, "bitrate_average_damping")) {
+ SETD(ai.bitrate_average_damping);
+ manage = 1;
+ }
+ else if(!strcmp(opts[i].arg, "bitrate_average")) {
+ SETL(ai.bitrate_average_kbps);
+ manage = 1;
+ }
+ else if(!strcmp(opts[i].arg, "bit_reservoir_bias")) {
+ SETD(ai.bitrate_limit_reservoir_bias);
+ manage = 1;
+ }
+ else if(!strcmp(opts[i].arg, "bit_reservoir_bits")) {
+ SETL(ai.bitrate_limit_reservoir_bits);
+ manage = 1;
}
else if(!strcmp(opts[i].arg, "bitrate_hard_min")) {
- SETL(ai.bitrate_hard_min);
- hard = 1;
+ SETL(ai.bitrate_limit_min_kbps);
+ manage = 1;
}
else if(!strcmp(opts[i].arg, "bitrate_hard_max")) {
- SETL(ai.bitrate_hard_max);
- hard = 1;
- }
- else if(!strcmp(opts[i].arg, "bitrate_hard_window")) {
- SETD(ai.bitrate_hard_window);
- hard = 1;
+ SETL(ai.bitrate_limit_max_kbps);
+ manage = 1;
}
else if(!strcmp(opts[i].arg, "impulse_noisetune")) {
double val;
@@ -105,10 +100,8 @@
}
}
- if(hard)
- vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE_HARD, &ai);
- if(avg)
- vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE_AVG, &ai);
+ if(manage)
+ vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, &ai);
}
int oe_encode(oe_enc_opt *opt)
@@ -163,14 +156,14 @@
/* do we have optional hard quality restrictions? */
if(opt->max_bitrate > 0 || opt->min_bitrate > 0){
- struct ovectl_ratemanage_arg ai;
- vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_GET, &ai);
+ struct ovectl_ratemanage2_arg ai;
+ vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE2_GET, &ai);
- ai.bitrate_hard_min=opt->min_bitrate;
- ai.bitrate_hard_max=opt->max_bitrate;
+ ai.bitrate_limit_min_kbps=opt->min_bitrate;
+ ai.bitrate_limit_max_kbps=opt->max_bitrate;
ai.management_active=1;
- vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_SET, &ai);
+ vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE2_SET, &ai);
}
@@ -188,12 +181,15 @@
if(opt->managed && opt->bitrate < 0)
{
- vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_AVG, NULL);
+ struct ovectl_ratemanage2_arg ai;
+ vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE2_GET, &ai);
+ ai.bitrate_average_kbps=-1;
+ vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE2_SET, &ai);
}
else if(!opt->managed)
{
/* Turn off management entirely (if it was turned on). */
- vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_SET, NULL);
+ vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE2_SET, NULL);
}
set_advanced_encoder_options(opt->advopt, opt->advopt_count, &vi);
<p><p>1.76 +1 -1 vorbis-tools/oggenc/oggenc.c
Index: oggenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- oggenc.c 15 Sep 2003 22:04:00 -0000 1.75
+++ oggenc.c 30 Dec 2003 12:45:19 -0000 1.76
@@ -79,7 +79,7 @@
oe_options opt = {NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL,
0, NULL, 0, NULL, 0, NULL, 0, 1, 0, 0,16,44100,2, 0, NULL,
DEFAULT_NAMEFMT_REMOVE, DEFAULT_NAMEFMT_REPLACE,
- NULL, 0, -1,-1,-1,.3,-1,0, 0,0.f, 0};
+ NULL, 0, -1,-1,-1,-.3,-1,0, 0,0.f, 0};
int i;
<p><p>1.27 +67 -7 vorbis-tools/oggenc/man/oggenc.1
Index: oggenc.1
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/man/oggenc.1,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- oggenc.1 25 Nov 2003 17:54:50 -0000 1.26
+++ oggenc.1 30 Dec 2003 12:45:20 -0000 1.27
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii oggenc.1
.\"
-.TH oggenc 1 "2003 September 1" "Xiph.org Foundation" "Vorbis Tools"
+.TH oggenc 1 "2003 December 30" "Xiph.org Foundation" "Vorbis Tools"
.SH NAME
oggenc \- encode audio into the Ogg Vorbis format
@@ -203,13 +203,73 @@
approached with caution. They may significantly degrade audio quality
if misused. Not all these options are currently documented.
-.IP "bitrate_average_window=NN"
-Set the managed bitrate window to NN seconds. The bitrate will be forced
-to the specified average over a floating window of this length. May be
-fractional (e.g. 3.5)
-.IP "lowpass_frequency=NN"
-Set the lowpass frequency to NN kHz.
+.IP "lowpass_frequency=N"
+Set the lowpass frequency to N kHz.
+.IP "impulse_noisetune=N"
+Set a noise floor bias N (range from -15. to 0.) for impulse blocks.
+A negative bias instructs the encoder to pay special attention to the
+crispness of transients in the encoded audio. The tradeoff for better
+transient response is a higher bitrate.
+
+.IP "bitrate_hard_max=N"
+Set the allowed bitrate maximum for the encoded file to N bits per
+second. This bitrate may be exceeded only when there is spare bits
+in the bit reservoir; if the bit reservoir is exhausted, frames will
+be held under this value. This setting must be used with --managed
+to have any effect.
+
+.IP "bitrate_hard_min=N"
+Set the allowed bitrate minimum for the encoded file to N bits per
+second. This bitrate may be underrun only when the bit reservoir is
+not full; if the bit reservoir is full, frames will be held over this
+value; if it impossible to add bits constructively, the frame will be
+padded with zeroes. This setting must be used with --managed to have
+any effect.
+
+.IP "bit_reservoir_bits=N"
+Set the total size of the bit reservoir to N bits; the default size of
+the reservoir is equal to the nominal number of bits coded in one
+second (eg, a nominal 128kbps file will have a bit reservoir of 128000
+bits by default). This option must be used with --managed to have any
+effect and affects only minimum and maximum bitrate management.
+Average bitrate encoding with no hard bitrate boundaries does not use
+a bit reservoir.
+
+.IP "bit_reservoir_bias=N"
+Set the behavior bias of the bit reservoir (range: 0. to 1.). When
+set closer to 0, the bitrate manager attempts to hoard bits for future
+use in sudden bitrate increases (biasing toward better transient
+reproduction). When set closer to 1, the bitrate manager neglects
+transients in favor using bits for homogenous passages. In the
+middle, the manager uses a balanced approach. The default setting is \.2,
+thus biasing slightly toward transient reproduction.
+
+.IP "bitrate_average=N"
+Set the average bitrate for the file to N bits per second. When used
+without hard minimum or maximum limits, this option select
+reservoirless Average Bit Rate encoding, where the encoder atempts to
+perfectly track a desired bitrate, but imposes no stict momentary
+fluctuation limits. When used along with a minimum or maximum limit,
+the average bitrate still sets the average overall bitrate of the
+file, but will work within the bounds set by the bit reservoir. When
+the min, max and average bitrates are identical, oggenc produces
+Constant Bit Rate vorbis data.
+
+.IP "bitrate_average_damping=N"
+Set the reaction time for the average bitrate tracker to N seconds.
+This number represents the fastest reaction the bitrate tracker is
+allowed to make to hold the bitrate to the selected average. The
+faster the reaction time, the less momentary fluctuation in the
+bitrate but (generally) the lower quality the audio output. The
+slower the reaction time, the larger the ABR fluctuations, but
+(generally) the better the audio. When used along with min or max
+bitrate limits, this option directly affects how deep and how quickly
+the encoder will dip into its bit reservoir; the higher the number,
+the more demand on the bit reservoir.
+
+The setting must be greater than zero and the useful range is
+approximately \.05 to 10. The default is \.75 seconds.
.SH EXAMPLES
<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