AOMedia AV1 Codec
Collaboration diagram for Golden Frame Group:

Functions

static void calculate_gf_length (AV1_COMP *cpi, int max_gop_length, int max_intervals)
 Determine the length of future GF groups.
 
static void define_gf_group_pass0 (AV1_COMP *cpi)
 Define a GF group in one pass mode when no look ahead stats are available.
 
static void define_gf_group (AV1_COMP *cpi, FIRSTPASS_STATS *this_frame, EncodeFrameParams *frame_params, int max_gop_length, int is_final_pass)
 Define a GF group.
 
static int define_kf_interval (AV1_COMP *cpi, FIRSTPASS_STATS *this_frame, double *kf_group_err, int num_frames_to_detect_scenecut)
 Determine the location of the next key frame.
 
static void find_next_key_frame (AV1_COMP *cpi, FIRSTPASS_STATS *this_frame)
 Determine the next key frame group.
 

Detailed Description

Algorithms regarding determining the length of GF groups and defining GF group structures.

Function Documentation

◆ calculate_gf_length()

static void calculate_gf_length ( AV1_COMP * cpi,
int max_gop_length,
int max_intervals )
static

Determine the length of future GF groups.

This function decides the gf group length of future frames in batch

Parameters
[in]cpiTop-level encoder structure
[in]max_gop_lengthMaximum length of the GF group
[in]max_intervalsMaximum number of intervals to decide
Returns
Nothing is returned. Instead, cpi->rc.gf_intervals is changed to store the decided GF group lengths.

References RATE_CONTROL::cur_gf_index, RATE_CONTROL::frames_to_key, RATE_CONTROL::gf_intervals, and RATE_CONTROL::intervals_till_gf_calculate_due.

Referenced by av1_get_second_pass_params().

◆ define_gf_group_pass0()

static void define_gf_group_pass0 ( AV1_COMP * cpi)
static

Define a GF group in one pass mode when no look ahead stats are available.

This function defines the structure of a GF group, along with various parameters regarding bit-allocation and quality setup in the special case of one pass encoding where no lookahead stats are avialable.

Parameters
[in]cpiTop-level encoder structure
Returns
Nothing is returned. Instead, cpi->gf_group is changed.

References AOM_CBR, av1_cyclic_refresh_set_golden_update(), av1_gop_setup_structure(), RATE_CONTROL::cur_gf_index, RATE_CONTROL::frames_to_key, RATE_CONTROL::gf_intervals, RATE_CONTROL::gfu_boost, and RATE_CONTROL::intervals_till_gf_calculate_due.

Referenced by define_gf_group().

◆ define_gf_group()

static void define_gf_group ( AV1_COMP * cpi,
FIRSTPASS_STATS * this_frame,
EncodeFrameParams * frame_params,
int max_gop_length,
int is_final_pass )
static

Define a GF group.

This function defines the structure of a GF group, along with various parameters regarding bit-allocation and quality setup.

Parameters
[in]cpiTop-level encoder structure
[in]this_frameFirst pass statistics structure
[in]frame_paramsStructure with frame parameters
[in]max_gop_lengthMaximum length of the GF group
[in]is_final_passWhether this is the final pass for the GF group, or a trial (non-zero)
Returns
Nothing is returned. Instead, cpi->gf_group is changed.

References RATE_CONTROL::active_worst_quality, AOM_Q, av1_gop_bit_allocation(), av1_gop_setup_structure(), calculate_total_gf_group_bits(), FIRSTPASS_STATS::coded_error, RATE_CONTROL::cur_gf_index, define_gf_group_pass0(), RATE_CONTROL::frames_till_gf_update_due, RATE_CONTROL::frames_to_key, get_twopass_worst_quality(), RATE_CONTROL::gf_group_bits, RATE_CONTROL::gf_intervals, RATE_CONTROL::gfu_boost, RATE_CONTROL::intervals_till_gf_calculate_due, CommonModeInfoParams::mb_rows, CommonModeInfoParams::MBs, AV1Common::mi_params, FIRSTPASS_STATS::sr_coded_error, and FIRSTPASS_STATS::tr_coded_error.

Referenced by av1_get_second_pass_params().

◆ define_kf_interval()

static int define_kf_interval ( AV1_COMP * cpi,
FIRSTPASS_STATS * this_frame,
double * kf_group_err,
int num_frames_to_detect_scenecut )
static

Determine the location of the next key frame.

This function decides the placement of the next key frame when a scenecut is detected or the maximum key frame distance is reached.

Parameters
[in]cpiTop-level encoder structure
[in]this_framePointer to first pass stats
[out]kf_group_errThe total error in the KF group
[in]num_frames_to_detect_scenecutMaximum lookahead frames.
Returns
Number of frames to the next key.

References RATE_CONTROL::frames_to_key.

Referenced by av1_get_second_pass_params(), and find_next_key_frame().

◆ find_next_key_frame()

static void find_next_key_frame ( AV1_COMP * cpi,
FIRSTPASS_STATS * this_frame )
static

Determine the next key frame group.

This function decides the placement of the next key frame, and calculates the bit allocation of the KF group and the keyframe itself.

Parameters
[in]cpiTop-level encoder structure
[in]this_framePointer to first pass stats
Returns
Nothing is returned.

References AOM_Q, AV1Common::current_frame, define_kf_interval(), RATE_CONTROL::frames_till_gf_update_due, RATE_CONTROL::frames_to_key, FIRSTPASS_STATS::intra_error, and RATE_CONTROL::kf_boost.

Referenced by av1_get_second_pass_params().