WebM VP8 Codec SDK
|
Encoder configuration structure. More...
#include <vpx_encoder.h>
Data Fields | |
unsigned int | g_usage |
Algorithm specific "usage" value. | |
unsigned int | g_threads |
Maximum number of threads to use. | |
unsigned int | g_profile |
Bitstream profile to use. | |
unsigned int | g_w |
Width of the frame. | |
unsigned int | g_h |
Height of the frame. | |
struct vpx_rational | g_timebase |
Stream timebase units. | |
unsigned int | g_error_resilient |
Enable error resilient mode. | |
enum vpx_enc_pass | g_pass |
Multi-pass Encoding Mode. | |
unsigned int | g_lag_in_frames |
Allow lagged encoding. | |
unsigned int | rc_dropframe_thresh |
Temporal resampling configuration, if supported by the codec. | |
unsigned int | rc_resize_allowed |
Enable/disable spatial resampling, if supported by the codec. | |
unsigned int | rc_resize_up_thresh |
Spatial resampling up watermark. | |
unsigned int | rc_resize_down_thresh |
Spatial resampling down watermark. | |
enum vpx_rc_mode | rc_end_usage |
Rate control algorithm to use. | |
struct vpx_fixed_buf | rc_twopass_stats_in |
Two-pass stats buffer. | |
unsigned int | rc_target_bitrate |
Target data rate. | |
unsigned int | rc_min_quantizer |
Minimum (Best Quality) Quantizer. | |
unsigned int | rc_max_quantizer |
Maximum (Worst Quality) Quantizer. | |
unsigned int | rc_undershoot_pct |
Rate control undershoot tolerance. | |
unsigned int | rc_overshoot_pct |
Rate control overshoot tolerance. | |
unsigned int | rc_buf_sz |
Decoder Buffer Size. | |
unsigned int | rc_buf_initial_sz |
Decoder Buffer Initial Size. | |
unsigned int | rc_buf_optimal_sz |
Decoder Buffer Optimal Size. | |
unsigned int | rc_2pass_vbr_bias_pct |
Two-pass mode CBR/VBR bias. | |
unsigned int | rc_2pass_vbr_minsection_pct |
Two-pass mode per-GOP minimum bitrate. | |
unsigned int | rc_2pass_vbr_maxsection_pct |
Two-pass mode per-GOP maximum bitrate. | |
enum vpx_kf_mode | kf_mode |
Keyframe placement mode. | |
unsigned int | kf_min_dist |
Keyframe minimum interval. | |
unsigned int | kf_max_dist |
Keyframe maximum interval. |
Encoder configuration structure.
This structure contains the encoder settings that have common representations across all codecs. This doesn't imply that all codecs support all features, however.
unsigned int vpx_codec_enc_cfg::g_usage |
Algorithm specific "usage" value.
Algorithms may define multiple values for usage, which may convey the intent of how the application intends to use the stream. If this value is non-zero, consult the documentation for the codec to determine its meaning.
unsigned int vpx_codec_enc_cfg::g_threads |
Maximum number of threads to use.
For multi-threaded implementations, use no more than this number of threads. The codec may use fewer threads than allowed. The value 0 is equivalent to the value 1.
unsigned int vpx_codec_enc_cfg::g_profile |
Bitstream profile to use.
Some codecs support a notion of multiple bitstream profiles. Typically this maps to a set of features that are turned on or off. Often the profile to use is determined by the features of the intended decoder. Consult the documentation for the codec to determine the valid values for this parameter, or set to zero for a sane default. profile of bitstream to use
unsigned int vpx_codec_enc_cfg::g_w |
Width of the frame.
This value identifies the presentation resolution of the frame, in pixels. Note that the frames passed as input to the encoder must have this resolution. Frames will be presented by the decoder in this resolution, independent of any spatial resampling the encoder may do.
unsigned int vpx_codec_enc_cfg::g_h |
Height of the frame.
This value identifies the presentation resolution of the frame, in pixels. Note that the frames passed as input to the encoder must have this resolution. Frames will be presented by the decoder in this resolution, independent of any spatial resampling the encoder may do.
Stream timebase units.
Indicates the smallest interval of time, in seconds, used by the stream. For fixed frame rate material, or variable frame rate material where frames are timed at a multiple of a given clock (ex: video capture), the RECOMMENDED method is to set the timebase to the reciprocal of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the pts to correspond to the frame number, which can be handy. For re-encoding video from containers with absolute time timestamps, the RECOMMENDED method is to set the timebase to that of the parent container or multimedia framework (ex: 1/1000 for ms, as in FLV).
unsigned int vpx_codec_enc_cfg::g_error_resilient |
Enable error resilient mode.
Error resilient mode indicates to the encoder that it should take measures appropriate for streaming over lossy or noisy links, if possible. Set to 1 to enable this feature, 0 to disable it.
Multi-pass Encoding Mode.
This value should be set to the current phase for multi-pass encoding. For single pass, set to VPX_RC_ONE_PASS.
unsigned int vpx_codec_enc_cfg::g_lag_in_frames |
Allow lagged encoding.
If set, this value allows the encoder to consume a number of input frames before producing output frames. This allows the encoder to base decisions for the current frame on future frames. This does increase the latency of the encoding pipeline, so it is not appropriate in all situations (ex: realtime encoding).
Note that this is a maximum value -- the encoder may produce frames sooner than the given limit. Set this value to 0 to disable this feature.
unsigned int vpx_codec_enc_cfg::rc_dropframe_thresh |
Temporal resampling configuration, if supported by the codec.
Temporal resampling allows the codec to "drop" frames as a strategy to meet its target data rate. This can cause temporal discontinuities in the encoded video, which may appear as stuttering during playback. This trade-off is often acceptable, but for many applications is not. It can be disabled in these cases.
Note that not all codecs support this feature. All vpx VPx codecs do. For other codecs, consult the documentation for that algorithm.
This threshold is described as a percentage of the target data buffer. When the data buffer falls below this percentage of fullness, a dropped frame is indicated. Set the threshold to zero (0) to disable this feature.
unsigned int vpx_codec_enc_cfg::rc_resize_allowed |
Enable/disable spatial resampling, if supported by the codec.
Spatial resampling allows the codec to compress a lower resolution version of the frame, which is then upscaled by the encoder to the correct presentation resolution. This increases visual quality at low data rates, at the expense of CPU time on the encoder/decoder.
unsigned int vpx_codec_enc_cfg::rc_resize_up_thresh |
Spatial resampling up watermark.
This threshold is described as a percentage of the target data buffer. When the data buffer rises above this percentage of fullness, the encoder will step up to a higher resolution version of the frame.
unsigned int vpx_codec_enc_cfg::rc_resize_down_thresh |
Spatial resampling down watermark.
This threshold is described as a percentage of the target data buffer. When the data buffer falls below this percentage of fullness, the encoder will step down to a lower resolution version of the frame.
Rate control algorithm to use.
Indicates whether the end usage of this stream is to be streamed over a bandwidth constrained link, indicating that Constant Bit Rate (CBR) mode should be used, or whether it will be played back on a high bandwidth link, as from a local disk, where higher variations in bitrate are acceptable.
Two-pass stats buffer.
A buffer containing all of the stats packets produced in the first pass, concatenated.
unsigned int vpx_codec_enc_cfg::rc_target_bitrate |
Target data rate.
Target bandwidth to use for this stream, in kilobits per second.
unsigned int vpx_codec_enc_cfg::rc_min_quantizer |
Minimum (Best Quality) Quantizer.
The quantizer is the most direct control over the quality of the encoded image. The range of valid values for the quantizer is codec specific. Consult the documentation for the codec to determine the values to use. To determine the range programmatically, call vpx_codec_enc_config_default() with a usage value of 0.
unsigned int vpx_codec_enc_cfg::rc_max_quantizer |
Maximum (Worst Quality) Quantizer.
The quantizer is the most direct control over the quality of the encoded image. The range of valid values for the quantizer is codec specific. Consult the documentation for the codec to determine the values to use. To determine the range programmatically, call vpx_codec_enc_config_default() with a usage value of 0.
unsigned int vpx_codec_enc_cfg::rc_undershoot_pct |
Rate control undershoot tolerance.
This value, expressed as a percentage of the target bitrate, describes the target bitrate for easier frames, allowing bits to be saved for harder frames. Set to zero to use the codec default.
unsigned int vpx_codec_enc_cfg::rc_overshoot_pct |
Rate control overshoot tolerance.
This value, expressed as a percentage of the target bitrate, describes the maximum allowed bitrate for a given frame. Set to zero to use the codec default.
unsigned int vpx_codec_enc_cfg::rc_buf_sz |
Decoder Buffer Size.
This value indicates the amount of data that may be buffered by the decoding application. Note that this value is expressed in units of time (milliseconds). For example, a value of 5000 indicates that the client will buffer (at least) 5000ms worth of encoded data. Use the target bitrate (rc_target_bitrate) to convert to bits/bytes, if necessary.
unsigned int vpx_codec_enc_cfg::rc_buf_initial_sz |
Decoder Buffer Initial Size.
This value indicates the amount of data that will be buffered by the decoding application prior to beginning playback. This value is expressed in units of time (milliseconds). Use the target bitrate (rc_target_bitrate) to convert to bits/bytes, if necessary.
unsigned int vpx_codec_enc_cfg::rc_buf_optimal_sz |
Decoder Buffer Optimal Size.
This value indicates the amount of data that the encoder should try to maintain in the decoder's buffer. This value is expressed in units of time (milliseconds). Use the target bitrate (rc_target_bitrate) to convert to bits/bytes, if necessary.
unsigned int vpx_codec_enc_cfg::rc_2pass_vbr_bias_pct |
Two-pass mode CBR/VBR bias.
Bias, expressed on a scale of 0 to 100, for determining target size for the current frame. The value 0 indicates the optimal CBR mode value should be used. The value 100 indicates the optimal VBR mode value should be used. Values in between indicate which way the encoder should "lean." RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR)
unsigned int vpx_codec_enc_cfg::rc_2pass_vbr_minsection_pct |
Two-pass mode per-GOP minimum bitrate.
This value, expressed as a percentage of the target bitrate, indicates the minimum bitrate to be used for a single GOP (aka "section")
unsigned int vpx_codec_enc_cfg::rc_2pass_vbr_maxsection_pct |
Two-pass mode per-GOP maximum bitrate.
This value, expressed as a percentage of the target bitrate, indicates the maximum bitrate to be used for a single GOP (aka "section")
Keyframe placement mode.
This value indicates whether the encoder should place keyframes at a fixed interval, or determine the optimal placement automatically (as governed by the kf_min_dist and kf_max_dist parameters)
unsigned int vpx_codec_enc_cfg::kf_min_dist |
Keyframe minimum interval.
This value, expressed as a number of frames, prevents the encoder from placing a keyframe nearer than kf_min_dist to the previous keyframe. At least kf_min_dist frames non-keyframes will be coded before the next keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval.
unsigned int vpx_codec_enc_cfg::kf_max_dist |
Keyframe maximum interval.
This value, expressed as a number of frames, forces the encoder to code a keyframe if one has not been coded in the last kf_max_dist frames. A value of 0 implies all frames will be keyframes. Set kf_min_dist equal to kf_max_dist for a fixed interval.