![]() |
AOMedia AV1 Codec
|
![]() |
Functions | |
static int | has_no_stats_stage (const AV1_COMP *const cpi) |
Check if the current stage has statistics. More... | |
In two pass mode, the input file is passed into the encoder for a quick first pass, where statistics are gathered. These statistics and the input file are then passed back into the encoder for a second pass. The statistics help the encoder reach the desired bitrate without as much overshooting or undershooting.
During the first pass, the codec will return "stats" packets that contain information useful for the second pass. The caller should concatenate these packets as they are received. In the second pass, the concatenated packets are passed in, along with the frames to encode. During the second pass, "frame" packets are returned that represent the compressed video.
A complete example can be found in examples/twopass_encoder.c
. Pseudocode is provided below to illustrate the core parts.
During the first pass, the uncompressed frames are passed in and stats information is appended to a byte array.
During the second pass, the uncompressed frames and the stats are passed into the encoder.
|
inlinestatic |
Check if the current stage has statistics.
[in] | cpi | Top - level encoder instance structure |
References AV1_COMP::compressor_stage, AV1_PRIMARY::cpi, AV1_COMP::lap_enabled, AV1_COMP::oxcf, and AV1EncoderConfig::pass.
Referenced by av1_encode_strategy(), calculate_gf_length(), define_gf_group(), encode_frame_to_data_rate(), find_next_key_frame(), rc_pick_q_and_bounds(), rc_pick_q_and_bounds_no_stats(), and rc_pick_q_and_bounds_no_stats_cbr().