pub type aom_codec_enc_cfg_t = aom_codec_enc_cfg;
Expand 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.

Aliased Type§

struct aom_codec_enc_cfg_t {
Show 54 fields pub g_usage: u32, pub g_threads: u32, pub g_profile: u32, pub g_w: u32, pub g_h: u32, pub g_limit: u32, pub g_forced_max_frame_width: u32, pub g_forced_max_frame_height: u32, pub g_bit_depth: u32, pub g_input_bit_depth: u32, pub g_timebase: aom_rational, pub g_error_resilient: u32, pub g_pass: u32, pub g_lag_in_frames: u32, pub rc_dropframe_thresh: u32, pub rc_resize_mode: u32, pub rc_resize_denominator: u32, pub rc_resize_kf_denominator: u32, pub rc_superres_mode: u32, pub rc_superres_denominator: u32, pub rc_superres_kf_denominator: u32, pub rc_superres_qthresh: u32, pub rc_superres_kf_qthresh: u32, pub rc_end_usage: u32, pub rc_twopass_stats_in: aom_fixed_buf, pub rc_firstpass_mb_stats_in: aom_fixed_buf, pub rc_target_bitrate: u32, pub rc_min_quantizer: u32, pub rc_max_quantizer: u32, pub rc_undershoot_pct: u32, pub rc_overshoot_pct: u32, pub rc_buf_sz: u32, pub rc_buf_initial_sz: u32, pub rc_buf_optimal_sz: u32, pub rc_2pass_vbr_bias_pct: u32, pub rc_2pass_vbr_minsection_pct: u32, pub rc_2pass_vbr_maxsection_pct: u32, pub fwd_kf_enabled: i32, pub kf_mode: u32, pub kf_min_dist: u32, pub kf_max_dist: u32, pub sframe_dist: u32, pub sframe_mode: u32, pub large_scale_tile: u32, pub monochrome: u32, pub full_still_picture_hdr: u32, pub save_as_annexb: u32, pub tile_width_count: i32, pub tile_height_count: i32, pub tile_widths: [i32; 64], pub tile_heights: [i32; 64], pub use_fixed_qp_offsets: u32, pub fixed_qp_offsets: [i32; 5], pub encoder_cfg: cfg_options,
}

Fields§

§g_usage: u32

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.

§g_threads: u32

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.

§g_profile: u32

profile of bitstream to use

§g_w: u32

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.

§g_h: u32

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.

§g_limit: u32

Max number of frames to encode

If force video mode is off (the default) and g_limit is 1, the encoder will encode a still picture (still_picture is set to 1 in the sequence header OBU). If in addition full_still_picture_hdr is 0 (the default), the encoder will use a reduced header (reduced_still_picture_header is set to 1 in the sequence header OBU) for the still picture.

§g_forced_max_frame_width: u32

Forced maximum width of the frame

If this value is non-zero then it is used to force the maximum frame width written in write_sequence_header().

§g_forced_max_frame_height: u32

Forced maximum height of the frame

If this value is non-zero then it is used to force the maximum frame height written in write_sequence_header().

§g_bit_depth: u32

Bit-depth of the codec

This value identifies the bit_depth of the codec, Only certain bit-depths are supported as identified in the aom_bit_depth_t enum.

§g_input_bit_depth: u32

Bit-depth of the input frames

This value identifies the bit_depth of the input frames in bits. Note that the frames passed as input to the encoder must have this bit-depth.

§g_timebase: aom_rational

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 \ref 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 \ref RECOMMENDED method is to set the timebase to that of the parent container or multimedia framework (ex: 1/1000 for ms, as in FLV).

§g_error_resilient: u32

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.

§g_pass: u32

Multi-pass Encoding Mode

This value should be set to the current phase for multi-pass encoding. For single pass, set to #AOM_RC_ONE_PASS.

§g_lag_in_frames: u32

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.

§rc_dropframe_thresh: u32

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 aom AVx 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.

§rc_resize_mode: u32

Mode for 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 decoder to the correct presentation resolution. This increases visual quality at low data rates, at the expense of CPU time on the encoder/decoder.

§rc_resize_denominator: u32

Frame resize denominator.

The denominator for resize to use, assuming 8 as the numerator.

Valid denominators are 8 - 16 for now.

§rc_resize_kf_denominator: u32

Keyframe resize denominator.

The denominator for resize to use, assuming 8 as the numerator.

Valid denominators are 8 - 16 for now.

§rc_superres_mode: u32

Frame super-resolution scaling mode.

Similar to spatial resampling, frame super-resolution integrates upscaling after the encode/decode process. Taking control of upscaling and using restoration filters should allow it to outperform normal resizing.

§rc_superres_denominator: u32

Frame super-resolution denominator.

The denominator for superres to use. If fixed it will only change if the cumulative scale change over resizing and superres is greater than 1/2; this forces superres to reduce scaling.

Valid denominators are 8 to 16.

Used only by AOM_SUPERRES_FIXED.

§rc_superres_kf_denominator: u32

Keyframe super-resolution denominator.

The denominator for superres to use. If fixed it will only change if the cumulative scale change over resizing and superres is greater than 1/2; this forces superres to reduce scaling.

Valid denominators are 8 - 16 for now.

§rc_superres_qthresh: u32

Frame super-resolution q threshold.

The q level threshold after which superres is used. Valid values are 1 to 63.

Used only by AOM_SUPERRES_QTHRESH

§rc_superres_kf_qthresh: u32

Keyframe super-resolution q threshold.

The q level threshold after which superres is used for key frames. Valid values are 1 to 63.

Used only by AOM_SUPERRES_QTHRESH

§rc_end_usage: u32

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.

§rc_twopass_stats_in: aom_fixed_buf

Two-pass stats buffer.

A buffer containing all of the stats packets produced in the first pass, concatenated.

§rc_firstpass_mb_stats_in: aom_fixed_buf

first pass mb stats buffer.

A buffer containing all of the first pass mb stats packets produced in the first pass, concatenated.

§rc_target_bitrate: u32

Target data rate

Target bitrate to use for this stream, in kilobits per second.

§rc_min_quantizer: u32

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 aom_codec_enc_config_default() with a usage value of 0.

§rc_max_quantizer: u32

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 aom_codec_enc_config_default() with a usage value of 0.

§rc_undershoot_pct: u32

Rate control adaptation undershoot control

This value, controls the tolerance of the VBR algorithm to undershoot and is used as a trigger threshold for more aggressive adaptation of Q.

Valid values in the range 0-100.

§rc_overshoot_pct: u32

Rate control adaptation overshoot control

This value, controls the tolerance of the VBR algorithm to overshoot and is used as a trigger threshold for more aggressive adaptation of Q.

Valid values in the range 0-100.

§rc_buf_sz: u32

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.

§rc_buf_initial_sz: u32

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.

§rc_buf_optimal_sz: u32

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.

§rc_2pass_vbr_bias_pct: u32

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_2pass_vbr_minsection_pct: u32

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

§rc_2pass_vbr_maxsection_pct: u32

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

§fwd_kf_enabled: i32

Option to enable forward reference key frame

§kf_mode: u32

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)

§kf_min_dist: u32

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.

§kf_max_dist: u32

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.

§sframe_dist: u32

sframe interval

This value, expressed as a number of frames, forces the encoder to code an S-Frame every sframe_dist frames.

§sframe_mode: u32

sframe insertion mode

This value must be set to 1 or 2, and tells the encoder how to insert S-Frames. It will only have an effect if sframe_dist != 0.

If altref is enabled:

  • if sframe_mode == 1, the considered frame will be made into an S-Frame only if it is an altref frame
  • if sframe_mode == 2, the next altref frame will be made into an S-Frame.

Otherwise: the considered frame will be made into an S-Frame.

§large_scale_tile: u32

Tile coding mode

This value indicates the tile coding mode. A value of 0 implies a normal non-large-scale tile coding. A value of 1 implies a large-scale tile coding.

§monochrome: u32

Monochrome mode

If this is nonzero, the encoder will generate a monochrome stream with no chroma planes.

§full_still_picture_hdr: u32

full_still_picture_hdr

If this is nonzero, the encoder will generate a full header (reduced_still_picture_header is set to 0 in the sequence header OBU) even for still picture encoding. If this is zero (the default), a reduced header (reduced_still_picture_header is set to 1 in the sequence header OBU) is used for still picture encoding. This flag has no effect when a regular video with more than a single frame is encoded.

§save_as_annexb: u32

Bitstream syntax mode

This value indicates the bitstream syntax mode. A value of 0 indicates bitstream is saved as Section 5 bitstream. A value of 1 indicates the bitstream is saved in Annex-B format

§tile_width_count: i32

Number of explicit tile widths specified

This value indicates the number of tile widths specified A value of 0 implies no tile widths are specified. Tile widths are given in the array tile_widths[]

§tile_height_count: i32

Number of explicit tile heights specified

This value indicates the number of tile heights specified A value of 0 implies no tile heights are specified. Tile heights are given in the array tile_heights[]

§tile_widths: [i32; 64]

Array of specified tile widths

This array specifies tile widths (and may be empty) The number of widths specified is given by tile_width_count

§tile_heights: [i32; 64]

Array of specified tile heights

This array specifies tile heights (and may be empty) The number of heights specified is given by tile_height_count

§use_fixed_qp_offsets: u32

Whether encoder should use fixed QP offsets.

If a value of 1 is provided, encoder will use fixed QP offsets for frames at different levels of the pyramid. If a value of 0 is provided, encoder will NOT use fixed QP offsets. Note: This option is only relevant for –end-usage=q.

§fixed_qp_offsets: [i32; 5]

Deprecated and ignored. DO NOT USE.

TODO(aomedia:3269): Remove fixed_qp_offsets in libaom v4.0.0.

§encoder_cfg: cfg_options

Options defined per config file