 |
AOMedia AV1 Codec
|
12 #ifndef AOM_AV1_ENCODER_PASS2_STRATEGY_H_
13 #define AOM_AV1_ENCODER_PASS2_STRATEGY_H_
31 double gf_group_raw_error;
32 double gf_group_skip_pct;
33 double gf_group_inactive_zone_rows;
35 double mv_ratio_accumulator;
36 double decay_accumulator;
37 double zero_motion_accumulator;
38 double loop_decay_rate;
39 double last_loop_decay_rate;
40 double this_frame_mv_in_out;
41 double mv_in_out_accumulator;
42 double abs_mv_in_out_accumulator;
44 double avg_sr_coded_error;
45 double avg_tr_coded_error;
46 double avg_pcnt_second_ref;
47 double avg_pcnt_third_ref;
48 double avg_pcnt_third_ref_nolast;
49 double avg_new_mv_count;
50 double avg_wavelet_energy;
51 double avg_raw_err_stdev;
52 int non_zero_stdev_count;
62 double frame_coded_error;
63 double frame_sr_coded_error;
64 double frame_tr_coded_error;
69 void av1_init_second_pass(
struct AV1_COMP *cpi);
71 void av1_init_single_pass_lap(
AV1_COMP *cpi);
97 unsigned int frame_flags);
134 GF_GROUP *gf_group,
int is_key_frame,
int use_arf,
135 int64_t gf_group_bits);
141 #endif // AOM_AV1_ENCODER_PASS2_STRATEGY_H_
void av1_gop_bit_allocation(const AV1_COMP *cpi, RATE_CONTROL *const rc, GF_GROUP *gf_group, int is_key_frame, int use_arf, int64_t gf_group_bits)
Distributes bits to frames in a group.
Definition: pass2_strategy.c:2648
int width
Definition: encoder.h:1707
double pcnt_neutral
Definition: firstpass.h:91
int projected_frame_size
Definition: ratectrl.h:139
int mb_rows
Definition: av1_common_int.h:482
Declares top-level encoder structures and functions.
The stucture of acummulated frame stats in the first pass.
Definition: firstpass.h:36
int av1_calc_iframe_target_size_one_pass_cbr(const struct AV1_COMP *cpi)
Calculates how many bits to use for an i frame in one pass cbr.
Rate Control parameters and status.
Definition: ratectrl.h:118
Data related to the current GF/ARF group and the individual frames within the group.
Definition: firstpass.h:171
static void define_gf_group_pass0(AV1_COMP *cpi)
Define a GF group in one pass mode when no look ahead stats are available.
Definition: pass2_strategy.c:2184
int partition_search_skippable_frame
Definition: encoder.h:2212
int lap_enabled
Definition: encoder.h:2641
double pcnt_third_ref
Definition: firstpass.h:85
PARTITION_SPEED_FEATURES part_sf
Definition: speed_features.h:1139
Encoder rate control configuration parameters.
Definition: encoder.h:430
static void calculate_gf_length(AV1_COMP *cpi, int max_gop_length, int max_intervals)
Determine the length of future GF groups.
Definition: pass2_strategy.c:1923
static int get_twopass_worst_quality(AV1_COMP *cpi, const double av_frame_err, double inactive_zone, int av_target_bandwidth)
Choose a target maximum Q for a group of frames.
Definition: pass2_strategy.c:279
bool enable_tpl_model
Definition: encoder.h:753
unsigned int vbr_corpus_complexity_lap
Definition: encoder.h:460
double tr_coded_error
Definition: firstpass.h:67
double MVcv
Definition: firstpass.h:131
SPEED_FEATURES sf
Definition: encoder.h:2314
int gf_intervals[MAX_NUM_GF_INTERVALS]
Definition: ratectrl.h:199
int best_quality
Definition: ratectrl.h:271
unsigned char gf_frame_index
Definition: encoder.h:2362
COMPRESSOR_STAGE compressor_stage
Definition: encoder.h:2645
bool fwd_kf_enabled
Definition: encoder.h:414
accumulated stats and features for a frame
Definition: pass2_strategy.h:59
int arnr_max_frames
Definition: encoder.h:735
double pcnt_motion
Definition: firstpass.h:75
accumulated stats and features in a gf group
Definition: pass2_strategy.h:28
@ AOM_CQ
Definition: aom_encoder.h:168
TWO_PASS twopass
Definition: encoder.h:2352
double pcnt_second_ref
Definition: firstpass.h:81
Two pass status and control data.
Definition: firstpass.h:214
KeyFrameCfg kf_cfg
Definition: encoder.h:822
int spatial_layer_id
Definition: av1_common_int.h:1034
double sr_coded_error
Definition: firstpass.h:63
double frame
Definition: firstpass.h:41
int sframe_mode
Definition: encoder.h:404
double MVrv
Definition: firstpass.h:127
Describes the codec algorithm interface to applications.
Main encoder configuration data structure.
Definition: encoder.h:805
int av1_calc_pframe_target_size_one_pass_cbr(const struct AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type)
Calculates how many bits to use for a P frame in one pass cbr.
static void find_next_key_frame(AV1_COMP *cpi, FIRSTPASS_STATS *this_frame)
Determine the next key frame group.
Definition: pass2_strategy.c:3154
int kf_boost
Definition: ratectrl.h:173
GF_GROUP gf_group
Definition: encoder.h:2357
Top level encoder structure.
Definition: encoder.h:2095
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.
Definition: pass2_strategy.c:2879
int height
Definition: av1_common_int.h:749
void av1_get_second_pass_params(AV1_COMP *cpi, EncodeFrameParams *const frame_params, const EncodeFrameInput *const frame_input, unsigned int frame_flags)
Main per frame entry point for second pass of two pass encode.
Definition: pass2_strategy.c:3505
@ AOM_CBR
Definition: aom_encoder.h:167
int initial_mbs
Definition: encoder.h:2461
int key_freq_min
Definition: encoder.h:381
int temporal_layer_id
Definition: av1_common_int.h:1024
int sframe_dist
Definition: encoder.h:397
enum aom_rc_mode mode
Definition: encoder.h:514
FRAME_TYPE frame_type
Definition: encoder.h:2734
int frames_left
Definition: encoder.h:2697
struct lookahead_ctx * lookahead
Definition: encoder.h:2071
double mv_in_out_count
Definition: firstpass.h:137
AV1_COMMON common
Definition: encoder.h:2138
int under_shoot_pct
Definition: encoder.h:489
TplParams tpl_data
Definition: encoder.h:2202
int cq_level
Definition: encoder.h:509
int gfu_boost
Definition: ratectrl.h:169
double mvc_abs
Definition: firstpass.h:123
double new_mv_count
Definition: firstpass.h:141
InitialDimensions initial_dimensions
Definition: encoder.h:2453
double pcnt_inter
Definition: firstpass.h:71
Declares frame encoding functions.
double inactive_zone_rows
Definition: firstpass.h:103
int best_allowed_q
Definition: encoder.h:505
void av1_twopass_postencode_update(AV1_COMP *cpi)
Adjustments to two pass and rate control after each frame.
Definition: pass2_strategy.c:3865
bool auto_key
Definition: encoder.h:409
int over_shoot_pct
Definition: encoder.h:495
int frames_till_gf_update_due
Definition: ratectrl.h:189
int av1_calc_iframe_target_size_one_pass_vbr(const struct AV1_COMP *const cpi)
Calculates how many bits to use for an i frame in one pass vbr.
int av1_lookahead_pop_sz(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage)
Get pop_sz value.
int internal_altref_allowed
Definition: encoder.h:2089
int vbrmin_section
Definition: encoder.h:526
static int has_no_stats_stage(const AV1_COMP *const cpi)
Check if the current stage has statistics.
Definition: encoder.h:3053
int height
Definition: encoder.h:1708
int av1_tpl_setup_stats(struct AV1_COMP *cpi, int gop_eval, const struct EncodeFrameParams *const frame_params, const struct EncodeFrameInput *const frame_input)
Implements temporal dependency modelling for a GOP (GF/ARF group) and selects between 16 and 32 frame...
Initial frame dimensions.
Definition: encoder.h:1706
YV12_BUFFER_CONFIG alt_ref_buffer
Definition: encoder.h:2378
enum aom_enc_pass pass
Definition: encoder.h:930
int intervals_till_gf_calculate_due
Definition: ratectrl.h:194
static int64_t calculate_total_gf_group_bits(AV1_COMP *cpi, double gf_group_err)
Calculates the bit target for this GF/ARF group.
Definition: pass2_strategy.c:767
int vbrbias
Definition: encoder.h:521
int64_t target_bandwidth
Definition: encoder.h:454
int base_frame_target
Definition: ratectrl.h:125
AV1LevelParams level_params
Definition: encoder.h:2582
TPL_SPEED_FEATURES tpl_sf
Definition: speed_features.h:1129
CommonQuantParams quant_params
Definition: av1_common_int.h:899
double duration
Definition: firstpass.h:145
Describes the encoder algorithm interface to applications.
Encoder config related to the coding of key frames.
Definition: encoder.h:377
int active_worst_quality
Definition: ratectrl.h:306
RATE_CONTROL rc
Definition: encoder.h:2294
int base_qindex
Definition: av1_common_int.h:586
int vbrmax_section
Definition: encoder.h:531
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:723
@ AOM_Q
Definition: aom_encoder.h:169
AlgoCfg algo_cfg
Definition: encoder.h:817
void av1_cyclic_refresh_set_golden_update(struct AV1_COMP *const cpi)
Set golden frame update interval nased on cyclic refresh.
double intra_error
Definition: firstpass.h:51
int active_best_quality[MAX_ARF_LAYERS+1]
Definition: ratectrl.h:310
double inactive_zone_cols
Definition: firstpass.h:107
double MVc
Definition: firstpass.h:119
double framerate
Definition: encoder.h:2299
int MBs
Definition: av1_common_int.h:492
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition: encoder.h:2726
aom_rc_mode
Rate control mode.
Definition: aom_encoder.h:165
double intra_skip_pct
Definition: firstpass.h:99
double raw_error_stdev
Definition: firstpass.h:154
double mvr_abs
Definition: firstpass.h:115
AV1_PRIMARY * ppi
Definition: encoder.h:2099
double MVr
Definition: firstpass.h:111
int cur_gf_index
Definition: ratectrl.h:204
double count
Definition: firstpass.h:150
unsigned int av1_lookahead_depth(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage)
Get the number of frames currently in the lookahead queue.
int width
Definition: av1_common_int.h:748
AV1EncoderConfig oxcf
Definition: encoder.h:2143
SequenceHeader seq_params
Definition: av1_common_int.h:953
int av1_calc_pframe_target_size_one_pass_vbr(const struct AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type)
Calculates how many bits to use for a P frame in one pass vbr.
int av1_temporal_filter(struct AV1_COMP *cpi, const int filter_frame_lookahead_idx, FRAME_UPDATE_TYPE update_type, int is_forward_keyframe, int *show_existing_arf)
Performs temporal filtering if needed on a source frame. For example to create a filtered alternate r...
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.
Definition: pass2_strategy.c:2324
double coded_error
Definition: firstpass.h:59
RateControlCfg rc_cfg
Definition: encoder.h:827
enum aom_bit_depth aom_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
GF_STATE gf_state
Definition: encoder.h:2367
int64_t gf_group_bits
Definition: ratectrl.h:134
CurrentFrame current_frame
Definition: av1_common_int.h:727
int last_q[FRAME_TYPES]
Definition: ratectrl.h:154
FRAME_INFO frame_info
Definition: encoder.h:2443
CommonModeInfoParams mi_params
Definition: av1_common_int.h:887
double frame_avg_wavelet_energy
Definition: firstpass.h:55
void av1_gop_setup_structure(struct AV1_COMP *cpi)
Set up the Group-Of-Pictures structure for this GF_GROUP.
int show_frame
Definition: encoder.h:2744
int skip_tpl_setup_stats
Definition: tpl_model.h:203
int frames_to_key
Definition: ratectrl.h:223
int worst_quality
Definition: ratectrl.h:267
int key_freq_max
Definition: encoder.h:386
double weight
Definition: firstpass.h:47