pass2_strategy.h
/*
* Copyright (c) 2019, Alliance for Open Media. All rights reserved.
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AOM_AV1_ENCODER_PASS2_STRATEGY_H_
#define AOM_AV1_ENCODER_PASS2_STRATEGY_H_
#ifdef __cplusplus
extern "C" {
#endif
struct AV1_COMP;
struct EncodeFrameParams;
#include "av1/encoder/encoder.h"
typedef struct {
double gf_group_err;
double gf_group_raw_error;
double gf_group_skip_pct;
double gf_group_inactive_zone_rows;
double mv_ratio_accumulator;
double decay_accumulator;
double zero_motion_accumulator;
double loop_decay_rate;
double last_loop_decay_rate;
double this_frame_mv_in_out;
double mv_in_out_accumulator;
double abs_mv_in_out_accumulator;
double avg_sr_coded_error;
double avg_pcnt_second_ref;
double avg_new_mv_count;
double avg_wavelet_energy;
double avg_raw_err_stdev;
int non_zero_stdev_count;
} GF_GROUP_STATS;
typedef struct {
double frame_err;
double frame_coded_error;
double frame_sr_coded_error;
} GF_FRAME_STATS;
void av1_init_second_pass(struct AV1_COMP *cpi);
void av1_init_single_pass_lap(AV1_COMP *cpi);
void av1_get_second_pass_params(struct AV1_COMP *cpi,
struct EncodeFrameParams *const frame_params,
unsigned int frame_flags);
void av1_twopass_postencode_update(struct AV1_COMP *cpi);
int av1_calc_arf_boost(const TWO_PASS *twopass,
const TWO_PASS_FRAME *twopass_frame,
const PRIMARY_RATE_CONTROL *p_rc, FRAME_INFO *frame_info,
int offset, int f_frames, int b_frames,
int *num_fpstats_used, int *num_fpstats_required,
int project_gfu_boost, const bool scale_max_boost);
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);
void av1_setup_target_rate(AV1_COMP *cpi);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AOM_AV1_ENCODER_PASS2_STRATEGY_H_
encoder.h
Declares top-level encoder structures and functions.
av1_get_second_pass_params
void av1_get_second_pass_params(struct AV1_COMP *cpi, struct EncodeFrameParams *const frame_params, unsigned int frame_flags)
Main per frame entry point for second pass of two pass encode.
Definition pass2_strategy.c:3949
av1_gop_bit_allocation
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:2397
av1_twopass_postencode_update
void av1_twopass_postencode_update(struct AV1_COMP *cpi)
Adjustments to two pass and rate control after each frame.
Definition pass2_strategy.c:4394
AV1_COMP
Top level encoder structure.
Definition encoder.h:2897
EncodeFrameParams
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition encoder.h:3747
GF_FRAME_STATS
accumulated stats and features for a frame
Definition pass2_strategy.h:55
GF_GROUP_STATS
accumulated stats and features in a gf group
Definition pass2_strategy.h:27
GF_GROUP
Data related to the current GF/ARF group and the individual frames within the group.
Definition firstpass.h:343
PRIMARY_RATE_CONTROL
Primary Rate Control parameters and status.
Definition ratectrl.h:313
RATE_CONTROL
Rate Control parameters and status.
Definition ratectrl.h:134
TWO_PASS_FRAME
Frame level Two pass status and control data.
Definition firstpass.h:467
TWO_PASS
Two pass status and control data.
Definition firstpass.h:425