 |
AOMedia AV1 Codec
|
Go to the documentation of this file.
15 #ifndef AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
16 #define AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
27 #include "av1/encoder/firstpass.h"
56 uint8_t *
const dest,
unsigned int *frame_flags,
57 int64_t *
const time_stamp, int64_t *
const time_end,
58 const aom_rational64_t *
const timestamp_ratio,
59 int *
const pop_lookahead,
int flush);
65 void av1_configure_buffer_updates(
AV1_COMP *
const cpi,
67 const FRAME_UPDATE_TYPE type,
68 const REFBUF_STATE refbuf_state,
69 int force_refresh_all);
71 int av1_get_refresh_frame_flags(
73 FRAME_UPDATE_TYPE frame_update_type,
int gf_index,
int cur_disp_order,
74 RefFrameMapPair ref_frame_map_pairs[REF_FRAMES]);
76 int av1_get_refresh_ref_frame_map(
int refresh_frame_flags);
88 void av1_get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
90 #
if CONFIG_FRAME_PARALLEL_ENCODE_2
92 int is_parallel_encode,
94 int remapped_ref_idx[REF_FRAMES]);
96 int is_forced_keyframe_pending(
struct lookahead_ctx *lookahead,
97 const int up_to_index,
98 const COMPRESSOR_STAGE compressor_stage);
100 static AOM_INLINE
int is_frame_droppable(
101 const SVC *
const svc,
105 if (svc->set_ref_frame_config)
106 return svc->non_reference_frame;
117 static AOM_INLINE
int get_current_frame_ref_type(
const AV1_COMP *
const cpi) {
128 case MAX_ARF_LAYERS + 1:
return 4;
133 #if CONFIG_FRAME_PARALLEL_ENCODE
134 #if CONFIG_FRAME_PARALLEL_ENCODE_2
135 int av1_calc_refresh_idx_for_intnl_arf(
136 AV1_COMP *cpi, RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
138 #endif // CONFIG_FRAME_PARALLEL_ENCODE_2
139 #endif // CONFIG_FRAME_PARALLEL_ENCODE
145 #endif // AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
REAL_TIME_SPEED_FEATURES rt_sf
Definition: speed_features.h:1597
Declares top-level encoder structures and functions.
InterpFilter interp_filter
Definition: av1_common_int.h:407
int av1_rc_pick_q_and_bounds(const struct AV1_COMP *cpi, int width, int height, int gf_index, int *bottom_index, int *top_index)
Picks q and q bounds given the rate control parameters in cpi->rc.
void av1_cyclic_refresh_update_parameters(struct AV1_COMP *const cpi)
Set the global/frame level parameters for cyclic refresh.
bool alt_ref_frame
Definition: encoder.h:2134
@ AOM_RC_SECOND_PASS
Definition: aom_encoder.h:178
ExternalFlags ext_flags
Definition: encoder.h:2813
int ref_frame_flags
Definition: encoder.h:3386
Data related to the current GF/ARF group and the individual frames within the group.
Definition: firstpass.h:344
int av1_check_show_filtered_frame(const YV12_BUFFER_CONFIG *frame, const FRAME_DIFF *frame_diff, int q_index, aom_bit_depth_t bit_depth)
Check whether a filtered frame can be show directly.
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:3622
#define AOM_EFLAG_SET_S_FRAME
Enable s frame mode.
Definition: aomcx.h:159
bool use_error_resilient
Definition: encoder.h:2174
ExtRefreshFrameFlagsInfo refresh_frame
Definition: encoder.h:2153
bool alt_ref_frame
Definition: encoder.h:2028
void av1_set_reference_structure_one_pass_rt(AV1_COMP *cpi, int gf_update)
Setup the reference prediction structure for 1 pass real-time.
Definition: ratectrl.c:2587
bool error_resilient_mode
Definition: av1_common_int.h:400
bool enable_tpl_model
Definition: encoder.h:848
int av1_gop_is_second_arf(const GF_GROUP *gf_group, int gf_frame_index)
Check whether a frame in the GOP is the second arf.
CommonTileParams tiles
Definition: av1_common_int.h:992
TWO_PASS twopass
Definition: encoder.h:2525
SPEED_FEATURES sf
Definition: encoder.h:2881
unsigned int number_spatial_layers
Definition: encoder.h:2560
bool use_s_frame
Definition: encoder.h:2179
ThreadData td
Definition: encoder.h:2679
unsigned char gf_frame_index
Definition: encoder.h:2912
COMPRESSOR_STAGE compressor_stage
Definition: encoder.h:3168
bool use_primary_ref_none
Definition: encoder.h:2185
bool golden_frame
Definition: encoder.h:2131
int ref_frame_flags
Definition: encoder.h:2148
bool alt2_ref_frame
Definition: encoder.h:2133
struct aom_internal_error_info * error
Definition: av1_common_int.h:758
GF_GROUP gf_group
Definition: encoder.h:2495
@ AOM_CODEC_OK
Operation completed without error.
Definition: aom_codec.h:157
KeyFrameCfg kf_cfg
Definition: encoder.h:926
bool allow_ref_frame_mvs
Definition: av1_common_int.h:381
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.
Definition: encode_strategy.c:1166
void av1_temporal_filter(struct AV1_COMP *cpi, const int filter_frame_lookahead_idx, int gf_frame_index, FRAME_DIFF *frame_diff, YV12_BUFFER_CONFIG *output_frame)
Performs temporal filtering if needed on a source frame. For example to create a filtered alternate r...
Params related to temporal dependency model.
Definition: tpl_model.h:142
#define AOM_EFLAG_FORCE_KF
Force this frame to be a keyframe.
Definition: aom_encoder.h:378
Describes the codec algorithm interface to applications.
TWO_PASS_FRAME twopass_frame
Definition: encoder.h:3323
Main encoder configuration data structure.
Definition: encoder.h:909
@ AOM_RC_FIRST_PASS
Definition: aom_encoder.h:177
RefCntBuffer * cur_frame
Definition: av1_common_int.h:832
unsigned int number_temporal_layers
Definition: encoder.h:2555
bool refresh_frame_context
Definition: encoder.h:2158
@ AOM_CODEC_ERROR
Unspecified error.
Definition: aom_codec.h:160
Top level encoder structure.
Definition: encoder.h:2664
int remapped_ref_idx[REF_FRAMES]
Definition: encoder.h:3391
Frame time stamps.
Definition: encoder.h:2280
int height
Definition: av1_common_int.h:776
int droppable
Definition: encoder.h:2935
TplParams tpl_data
Definition: encoder.h:2583
The stucture of SVC.
Definition: svc_layercontext.h:87
YV12_BUFFER_CONFIG * unscaled_source
Definition: encoder.h:2740
int av1_encode(AV1_COMP *const cpi, uint8_t *const dest, const EncodeFrameInput *const frame_input, const EncodeFrameParams *const frame_params, EncodeFrameResults *const frame_results)
Run 1-pass/2-pass encoding.
Definition: encoder.c:3678
int64_t prev_ts_end
Definition: encoder.h:2288
#define AOM_EFLAG_ERROR_RESILIENT
Enable error resilient frame.
Definition: aomcx.h:153
enum aom_rc_mode mode
Definition: encoder.h:604
FRAME_TYPE frame_type
Definition: encoder.h:3364
Refresh frame flags for different type of frames.
Definition: encoder.h:2025
TEMPORAL_FILTER_INFO tf_info
Definition: encoder.h:2535
SequenceHeader * seq_params
Definition: av1_common_int.h:976
struct lookahead_ctx * lookahead
Definition: encoder.h:2467
MV_STATS mv_stats
Definition: encoder.h:2588
TplDepStats * tpl_stats_pool[MAX_LAG_BUFFERS]
Definition: tpl_model.h:170
AV1_COMMON common
Definition: encoder.h:2707
int error_resilient_mode
Definition: encoder.h:3360
REFRESH_FRAME_CONTEXT_MODE refresh_frame_context
Definition: av1_common_int.h:421
int superres_upscaled_width
Definition: av1_common_int.h:799
int cq_level
Definition: encoder.h:599
bool last_frame
Definition: encoder.h:2130
bool golden_frame
Definition: encoder.h:2026
bool using_qmatrix
Definition: av1_common_int.h:696
Declares frame encoding functions.
int av1_tpl_setup_stats(struct AV1_COMP *cpi, int gop_eval, const struct EncodeFrameParams *const frame_params)
Implements temporal dependency modelling for a GOP (GF/ARF group) and selects between 16 and 32 frame...
aom_film_grain_t film_grain_params
Definition: av1_common_int.h:960
uint32_t frame_presentation_time
Definition: av1_common_int.h:821
void av1_get_one_pass_rt_params(AV1_COMP *cpi, EncodeFrameParams *const frame_params, unsigned int frame_flags)
Setup the rate control parameters for 1 pass real-time mode.
Definition: ratectrl.c:3021
aom_film_grain_table_t * film_grain_table
Definition: encoder.h:3069
int av1_lookahead_pop_sz(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage)
Get pop_sz value.
static int has_no_stats_stage(const AV1_COMP *const cpi)
Check if the current stage has statistics.
Definition: encoder.h:3761
@ AOM_CODEC_MEM_ERROR
Memory operation failed.
Definition: aom_codec.h:163
enum aom_enc_pass pass
Definition: encoder.h:1034
PRIMARY_RATE_CONTROL p_rc
Definition: encoder.h:2530
FILE * second_pass_log_stream
Definition: encoder.h:3333
int speed
Definition: encoder.h:3402
int show_frame
Definition: av1_common_int.h:885
HIGH_LEVEL_SPEED_FEATURES hl_sf
Definition: speed_features.h:1532
unsigned int large_scale
Definition: av1_common_int.h:488
int show_existing_alt_ref
Definition: encoder.h:2490
int64_t prev_ts_start
Definition: encoder.h:2284
TPL_SPEED_FEATURES tpl_sf
Definition: speed_features.h:1542
CommonQuantParams quant_params
Definition: av1_common_int.h:922
int use_svc
Definition: encoder.h:2545
YV12 frame buffer data structure.
Definition: yv12config.h:39
YV12_BUFFER_CONFIG orig_source
Definition: encoder.h:2767
TimeStamps time_stamps
Definition: encoder.h:2856
Describes the encoder algorithm interface to applications.
Flags signalled by the external interface at frame level.
Definition: encoder.h:2144
RATE_CONTROL rc
Definition: encoder.h:2861
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:750
bool use_ref_frame_mvs
Definition: encoder.h:2169
double new_framerate
Definition: encoder.h:3032
YV12_BUFFER_CONFIG * unfiltered_source
Definition: encoder.h:2761
int av1_svc_primary_ref_frame(const struct AV1_COMP *const cpi)
Get primary reference frame for current layer.
@ AOM_Q
Definition: aom_encoder.h:188
AlgoCfg algo_cfg
Definition: encoder.h:921
YV12_BUFFER_CONFIG scaled_source
Definition: encoder.h:2745
bool bwd_ref_frame
Definition: encoder.h:2027
RefreshFrameInfo refresh_frame
Definition: encoder.h:2808
MV_STATS mv_stats
Definition: encoder.h:3237
int skip_tpl_setup_stats
Definition: encoder.h:2772
double framerate
Definition: encoder.h:2866
struct lookahead_entry * av1_lookahead_peek(struct lookahead_ctx *ctx, int index, COMPRESSOR_STAGE stage)
Get a future source buffer to encode.
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition: encoder.h:3356
int second_alt_ref_filtering
Definition: speed_features.h:431
RefCntBuffer * ref_frame_map[REF_FRAMES]
Definition: av1_common_int.h:878
AV1_PRIMARY * ppi
Definition: encoder.h:2668
YV12_BUFFER_CONFIG tf_buf_second_arf
Definition: temporal_filter.h:175
Variables related to current coding block.
Definition: blockd.h:577
int enable_keyframe_filtering
Definition: encoder.h:476
int superres_upscaled_height
Definition: av1_common_int.h:800
bool refresh_frame_context_pending
Definition: encoder.h:2164
MACROBLOCKD e_mbd
Decoder's view of current coding block.
Definition: block.h:831
bool bwd_ref_frame
Definition: encoder.h:2132
unsigned int av1_lookahead_depth(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage)
Get the number of frames currently in the lookahead queue.
bool enable_sframe
Definition: encoder.h:509
int fb_of_context_type[REF_FRAMES]
Definition: encoder.h:2640
int width
Definition: av1_common_int.h:775
AV1EncoderConfig oxcf
Definition: encoder.h:2712
RefreshFrameInfo refresh_frame
Definition: encoder.h:3397
int64_t first_ts_start
Definition: encoder.h:2292
Frame refresh flags set by the external interface.
Definition: encoder.h:2129
RateControlCfg rc_cfg
Definition: encoder.h:931
double rate_correction_factors[RATE_FACTOR_LEVELS]
Definition: ratectrl.h:485
bool update_pending
Definition: encoder.h:2138
int showable_frame
Definition: av1_common_int.h:893
CurrentFrame current_frame
Definition: av1_common_int.h:754
FeatureFlags features
Definition: av1_common_int.h:905
YV12_BUFFER_CONFIG * source
Definition: encoder.h:2725
CommonModeInfoParams mi_params
Definition: av1_common_int.h:910
int show_frame
Definition: encoder.h:3374
Encoder's parameters related to the current coding block.
Definition: block.h:813
int remapped_ref_idx[REF_FRAMES]
Definition: av1_common_int.h:854
int frames_to_key
Definition: ratectrl.h:185
int key_freq_max
Definition: encoder.h:471
@ AOM_RC_THIRD_PASS
Definition: aom_encoder.h:179
SVC svc
Definition: encoder.h:3163