![]() |
AOMedia AV1 Codec
|
Modules | |
Speed vs Quality Trade Off | |
Source Frame Processing | |
Rate Control | |
Temporal Dependency Modelling | |
Two Pass Mode | |
The Look-Ahead Buffer | |
Golden Frame Group | |
Functions | |
int | av1_pack_bitstream (struct AV1_COMP *const cpi, uint8_t *dst, size_t *size, int *const largest_tile_id) |
Pack the bitstream for one frame. | |
int | av1_encode_strategy (AV1_COMP *const cpi, size_t *const size, uint8_t *const dest, unsigned int *frame_flags, int64_t *const time_stamp, int64_t *const time_end, const aom_rational64_t *const timestamp_ratio, int *const pop_lookahead, int flush) |
Implement high-level encode strategy. More... | |
static void | encode_frame_internal (AV1_COMP *cpi) |
Encoder setup(only for the current frame), encoding, and recontruction for a single frame. | |
void | av1_encode_frame (AV1_COMP *cpi) |
Setup reference frame buffers and encode a frame. More... | |
static void | cdef_restoration_frame (AV1_COMP *cpi, AV1_COMMON *cm, MACROBLOCKD *xd, int use_restoration, int use_cdef) |
Select and apply cdef filters and switchable restoration filters. | |
static void | loopfilter_frame (AV1_COMP *cpi, AV1_COMMON *cm) |
Select and apply in-loop deblocking filters, cdef filters, and restoration filters. | |
static int | encode_without_recode (AV1_COMP *cpi) |
Encode a frame without the recode loop, usually used in one-pass encoding and realtime coding. More... | |
static int | encode_with_recode_loop (AV1_COMP *cpi, size_t *size, uint8_t *dest) |
Recode loop for encoding one frame. the purpose of encoding one frame for multiple times can be approaching a target bitrate or adjusting the usage of global motions. More... | |
static int | encode_with_recode_loop_and_filter (AV1_COMP *cpi, size_t *size, uint8_t *dest, int64_t *sse, int64_t *rate, int *largest_tile_id) |
Recode loop or a single loop for encoding one frame, followed by in-loop deblocking filters, CDEF filters, and restoration filters. More... | |
static int | encode_frame_to_data_rate (AV1_COMP *cpi, size_t *size, uint8_t *dest) |
Run the final pass encoding for 1-pass/2-pass encoding mode, and pack the bitstream. More... | |
This module describes sequence level/frame level algorithm in AV1. More details will be added.
int av1_encode_strategy | ( | AV1_COMP *const | cpi, |
size_t *const | size, | ||
uint8_t *const | dest, | ||
unsigned int * | frame_flags, | ||
int64_t *const | time_stamp, | ||
int64_t *const | time_end, | ||
const aom_rational64_t *const | timestamp_ratio, | ||
int *const | pop_lookahead, | ||
int | flush | ||
) |
Implement high-level encode strategy.
This function will implement high-level encode strategy, choosing frame type, frame placement, etc. It populates an EncodeFrameParams struct with the results of these decisions and then encodes the frame. The caller should use the output parameters *time_stamp and *time_end only when this function returns AOM_CODEC_OK.
[in] | cpi | Top-level encoder structure |
[in] | size | Bitstream size |
[in] | dest | Bitstream output |
[in] | frame_flags | Flags to decide how to encoding the frame |
[out] | time_stamp | Time stamp of the frame |
[out] | time_end | Time end |
[in] | timestamp_ratio | Time base |
[in] | pop_lookahead | Decide to pop the source frame from queue |
[in] | flush | Decide to encode one frame or the rest of frames |
AOM_CODEC_OK | |
-1 | |
AOM_CODEC_ERROR |
void av1_encode_frame | ( | AV1_COMP * | cpi | ) |
Setup reference frame buffers and encode a frame.
[in] | cpi | Top-level encoder structure |
References AV1Common::cur_frame, AV1Common::current_frame, encode_frame_internal(), AV1Common::features, FeatureFlags::interp_filter, CommonTileParams::large_scale, CommonModeInfoParams::mi_cols, AV1Common::mi_params, CommonModeInfoParams::mi_rows, FeatureFlags::reduced_tx_set_used, AV1Common::seg, FeatureFlags::switchable_motion_mode, AV1Common::tiles, and FeatureFlags::tx_mode.
|
static |
Encode a frame without the recode loop, usually used in one-pass encoding and realtime coding.
[in] | cpi | Top-level encoder structure |
AOM_CODEC_OK | |
AOM_CODEC_ERROR |
References AV1Common::current_frame, SVC::downsample_filter_phase, SVC::downsample_filter_type, AV1Common::height, SPEED_FEATURES::inter_sf, SPEED_FEATURES::part_sf, and AV1Common::width.
Referenced by encode_with_recode_loop_and_filter().
|
static |
Recode loop for encoding one frame. the purpose of encoding one frame for multiple times can be approaching a target bitrate or adjusting the usage of global motions.
[in] | cpi | Top-level encoder structure |
[in] | size | Bitstream size |
[in] | dest | Bitstream output |
AOM_CODEC_OK | |
-1 | |
AOM_CODEC_ERROR |
References AOM_SUPERRES_NONE, AV1Common::current_frame, and AV1Common::superres_scale_denominator.
Referenced by encode_with_recode_loop_and_filter().
|
static |
Recode loop or a single loop for encoding one frame, followed by in-loop deblocking filters, CDEF filters, and restoration filters.
[in] | cpi | Top-level encoder structure |
[in] | size | Bitstream size |
[in] | dest | Bitstream output |
[in] | sse | Total distortion of the frame |
[in] | rate | Total rate of the frame |
[in] | largest_tile_id | Tile id of the last tile |
AOM_CODEC_OK | |
AOM_CODEC_ERROR |
References FeatureFlags::allow_intrabc, AOM_CODEC_OK, CdefInfo::cdef_bits, AV1Common::cdef_info, CdefInfo::cdef_strengths, CdefInfo::cdef_uv_strengths, AV1Common::cur_frame, encode_with_recode_loop(), encode_without_recode(), AV1Common::features, RestorationInfo::frame_restoration_type, AV1Common::lf, loopfilter_frame(), CdefInfo::nb_cdef_strengths, AV1Common::render_height, AV1Common::render_width, RESTORE_NONE, AV1Common::rst_info, and AV1Common::seq_params.
|
static |
Run the final pass encoding for 1-pass/2-pass encoding mode, and pack the bitstream.
[in] | cpi | Top-level encoder structure |
[in] | size | Bitstream size |
[in] | dest | Bitstream output |
AOM_CODEC_OK | |
AOM_CODEC_ERROR |
References FeatureFlags::allow_ref_frame_mvs, FeatureFlags::allow_warped_motion, AOM_CBR, AOM_CODEC_ERROR, AOM_CODEC_OK, AOM_RC_THIRD_PASS, av1_pack_bitstream(), AV1Common::cur_frame, FeatureFlags::cur_frame_force_integer_mv, AV1Common::current_frame, AV1Common::features, AV1Common::height, CommonTileParams::large_scale, AV1Common::lf, AV1Common::ref_frame_id, AV1Common::seg, AV1Common::seq_params, AV1Common::show_frame, CommonTileParams::single_tile_decoding, AV1Common::tiles, and AV1Common::width.