12 #ifndef AOM_AV1_ENCODER_FIRSTPASS_H_
13 #define AOM_AV1_ENCODER_FIRSTPASS_H_
15 #include "av1/common/av1_common_int.h"
18 #include "av1/encoder/ratectrl.h"
24 #define DOUBLE_DIVIDE_CHECK(x) ((x) < 0 ? (x)-0.000001 : (x) + 0.000001)
26 #define MIN_ZERO_MOTION 0.95
27 #define MAX_SR_CODED_ERROR 40
28 #define MAX_RAW_ERR_VAR 2000
29 #define MIN_MV_IN_OUT 0.4
31 #define VLOW_MOTION_THRESHOLD 950
159 #define FC_ANIMATION_THRESH 0.15
162 FC_GRAPHICS_ANIMATION = 1,
163 FRAME_CONTENT_TYPES = 2
164 } UENUM1BYTE(FRAME_CONTENT_TYPE);
176 FRAME_UPDATE_TYPE update_type[MAX_STATIC_GF_GROUP_LENGTH];
177 unsigned char arf_src_offset[MAX_STATIC_GF_GROUP_LENGTH];
180 unsigned char cur_frame_idx[MAX_STATIC_GF_GROUP_LENGTH];
181 int layer_depth[MAX_STATIC_GF_GROUP_LENGTH];
182 int arf_boost[MAX_STATIC_GF_GROUP_LENGTH];
184 int max_layer_depth_allowed;
186 unsigned char q_val[MAX_STATIC_GF_GROUP_LENGTH];
187 int bit_allocation[MAX_STATIC_GF_GROUP_LENGTH];
189 FRAME_TYPE frame_type[MAX_STATIC_GF_GROUP_LENGTH];
191 REFBUF_STATE refbuf_state[MAX_STATIC_GF_GROUP_LENGTH];
200 int arf_gf_boost_lst;
218 unsigned int section_intra_rating;
223 int frame_stats_next_idx;
225 STATS_BUFFER_CTX *stats_buf_ctx;
228 double modified_error_min;
229 double modified_error_max;
230 double modified_error_left;
232 double frame_avg_haar_energy;
235 FRAME_CONTENT_TYPE fr_content_type;
238 int64_t kf_group_bits;
241 int64_t kf_group_error_left;
247 int rolling_arf_group_target_bits;
248 int rolling_arf_group_actual_bits;
252 int kf_zeromotion_pct;
253 int last_kfgroup_zeromotion_pct;
256 int extend_minq_fast;
268 int64_t frame_avg_wavelet_energy;
272 int64_t sr_coded_error;
274 int64_t tr_coded_error;
281 int second_ref_count;
285 double neutral_count;
287 int intra_skip_count;
289 int image_data_start_row;
309 double brightness_factor;
317 FRAME_STATS *mb_stats;
322 int *raw_motion_err_list;
330 int av1_get_unit_rows_in_tile(TileInfo tile,
const BLOCK_SIZE fp_block_size);
331 int av1_get_unit_cols_in_tile(TileInfo tile,
const BLOCK_SIZE fp_block_size);
333 void av1_rc_get_first_pass_params(
struct AV1_COMP *cpi);
334 void av1_first_pass_row(
struct AV1_COMP *cpi,
struct ThreadData *td,
335 struct TileDataEnc *tile_data,
const int mb_row,
336 const BLOCK_SIZE fp_block_size);
337 void av1_end_first_pass(
struct AV1_COMP *cpi);
void av1_first_pass(struct AV1_COMP *cpi, const int64_t ts_duration)
AV1 first pass encoding.
Describes look ahead buffer operations.
Main encoder configuration data structure.
Definition: encoder.h:791
Top level encoder structure.
Definition: encoder.h:2042
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition: encoder.h:2675
The stucture of acummulated frame stats in the first pass.
Definition: firstpass.h:36
double pcnt_neutral
Definition: firstpass.h:91
double MVr
Definition: firstpass.h:111
double MVc
Definition: firstpass.h:119
double pcnt_second_ref
Definition: firstpass.h:81
double mvr_abs
Definition: firstpass.h:115
double pcnt_inter
Definition: firstpass.h:71
double intra_error
Definition: firstpass.h:51
double new_mv_count
Definition: firstpass.h:141
double pcnt_third_ref
Definition: firstpass.h:85
double count
Definition: firstpass.h:150
double coded_error
Definition: firstpass.h:59
double raw_error_stdev
Definition: firstpass.h:154
double pcnt_motion
Definition: firstpass.h:75
double frame
Definition: firstpass.h:41
double mv_in_out_count
Definition: firstpass.h:137
double MVcv
Definition: firstpass.h:131
double inactive_zone_cols
Definition: firstpass.h:107
double frame_avg_wavelet_energy
Definition: firstpass.h:55
double duration
Definition: firstpass.h:145
double tr_coded_error
Definition: firstpass.h:67
double sr_coded_error
Definition: firstpass.h:63
double mvc_abs
Definition: firstpass.h:123
double intra_skip_pct
Definition: firstpass.h:99
double MVrv
Definition: firstpass.h:127
double inactive_zone_rows
Definition: firstpass.h:103
double weight
Definition: firstpass.h:47
Data related to the current GF/ARF group and the individual frames within the group.
Definition: firstpass.h:171
Two pass status and control data.
Definition: firstpass.h:216