WebM VP8 Codec SDK

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Data Fields

Data Fields
vpx_codec_enc_cfg Struct Reference
Encoder Algorithm Interface

Encoder configuration structure. More...

`#include <vpx_encoder.h>`

## Data Fields
unsigned int | g_usage
| Algorithm specific "usage" value. More...
unsigned int | g_threads
| Maximum number of threads to use. More...
unsigned int | g_profile
| Bitstream profile to use. More...
unsigned int | g_w
| Width of the frame. More...
unsigned int | g_h
| Height of the frame. More...
struct vpx_rational | g_timebase
| Stream timebase units. More...
vpx_codec_er_flags_t | g_error_resilient
| Enable error resilient modes. More...
enum vpx_enc_pass | g_pass
| Multi-pass Encoding Mode. More...
unsigned int | g_lag_in_frames
| Allow lagged encoding. More...
unsigned int | rc_dropframe_thresh
| Temporal resampling configuration, if supported by the codec. More...
unsigned int | rc_resize_allowed
| Enable/disable spatial resampling, if supported by the codec. More...
unsigned int | rc_resize_up_thresh
| Spatial resampling up watermark. More...
unsigned int | rc_resize_down_thresh
| Spatial resampling down watermark. More...
enum vpx_rc_mode | rc_end_usage
| Rate control algorithm to use. More...
struct vpx_fixed_buf | rc_twopass_stats_in
| Two-pass stats buffer. More...
unsigned int | rc_target_bitrate
| Target data rate. More...
unsigned int | rc_min_quantizer
| Minimum (Best Quality) Quantizer. More...
unsigned int | rc_max_quantizer
| Maximum (Worst Quality) Quantizer. More...
unsigned int | rc_undershoot_pct
| Rate control adaptation undershoot control. More...
unsigned int | rc_overshoot_pct
| Rate control adaptation overshoot control. More...
unsigned int | rc_buf_sz
| Decoder Buffer Size. More...
unsigned int | rc_buf_initial_sz
| Decoder Buffer Initial Size. More...
unsigned int | rc_buf_optimal_sz
| Decoder Buffer Optimal Size. More...
unsigned int | rc_2pass_vbr_bias_pct
| Two-pass mode CBR/VBR bias. More...
unsigned int | rc_2pass_vbr_minsection_pct
| Two-pass mode per-GOP minimum bitrate. More...
unsigned int | rc_2pass_vbr_maxsection_pct
| Two-pass mode per-GOP maximum bitrate. More...
enum vpx_kf_mode | kf_mode
| Keyframe placement mode. More...
unsigned int | kf_min_dist
| Keyframe minimum interval. More...
unsigned int | kf_max_dist
| Keyframe maximum interval. More...
unsigned int | ss_number_layers
| Number of coding layers (spatial) More...
unsigned int | ts_number_layers
| Number of coding layers. More...
unsigned int | ts_target_bitrate [5]
| Target bitrate for each layer. More...
unsigned int | ts_rate_decimator [5]
| Frame rate decimation factor for each layer. More...
unsigned int | ts_periodicity
| Length of the sequence defining frame layer membership. More...
unsigned int | ts_layer_id [16]
| Template defining the membership of frames to coding layers. More...

## Detailed Description

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.

## Field Documentation

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.

struct vpx_rational vpx_codec_enc_cfg::g_timebase

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).

vpx_codec_er_flags_t vpx_codec_enc_cfg::g_error_resilient

Enable error resilient modes.

The error resilient bitfield indicates to the encoder which features it should enable to take measures for streaming over lossy or noisy links.

enum vpx_enc_pass vpx_codec_enc_cfg::g_pass

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.

enum vpx_rc_mode vpx_codec_enc_cfg::rc_end_usage

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.

struct vpx_fixed_buf vpx_codec_enc_cfg::rc_twopass_stats_in

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 adaptation undershoot control.

This value, expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be subtracted from the target bitrate in order to compensate for prior overshoot.

Valid values in the range 0-1000.

unsigned int vpx_codec_enc_cfg::rc_overshoot_pct

Rate control adaptation overshoot control.

This value, expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be added to the target bitrate in order to compensate for prior undershoot.

Valid values in the range 0-1000.

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")

enum vpx_kf_mode vpx_codec_enc_cfg::kf_mode

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.

unsigned int vpx_codec_enc_cfg::ss_number_layers

Number of coding layers (spatial)

This value specifies the number of coding layers to be used.

unsigned int vpx_codec_enc_cfg::ts_number_layers

Number of coding layers.

This value specifies the number of coding layers to be used.

unsigned int vpx_codec_enc_cfg::ts_target_bitrate[5]

Target bitrate for each layer.

These values specify the target coding bitrate for each coding layer.

unsigned int vpx_codec_enc_cfg::ts_rate_decimator[5]

Frame rate decimation factor for each layer.

These values specify the frame rate decimation factors to apply to each layer.

unsigned int vpx_codec_enc_cfg::ts_periodicity

Length of the sequence defining frame layer membership.

This value specifies the length of the sequence that defines the membership of frames to layers. For example, if ts_periodicity=8 then frames are assigned to coding layers with a repeated sequence of length 8.

unsigned int vpx_codec_enc_cfg::ts_layer_id[16]

Template defining the membership of frames to coding layers.

This array defines the membership of frames to coding layers. For a 2-layer encoding that assigns even numbered frames to one layer (0) and odd numbered frames to a second layer (1) with ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1).

The documentation for this struct was generated from the following file:

- vpx/vpx_encoder.h