12 #ifndef AOM_AV1_ENCODER_TPL_MODEL_H_ 13 #define AOM_AV1_ENCODER_TPL_MODEL_H_ 27 static INLINE BLOCK_SIZE convert_length_to_bsize(
int length) {
29 case 64:
return BLOCK_64X64;
30 case 32:
return BLOCK_32X32;
31 case 16:
return BLOCK_16X16;
32 case 8:
return BLOCK_8X8;
33 case 4:
return BLOCK_4X4;
35 assert(0 &&
"Invalid block size for tpl model");
40 typedef struct AV1TplRowMultiThreadSync {
41 #if CONFIG_MULTITHREAD 43 pthread_mutex_t *mutex_;
44 pthread_cond_t *cond_;
49 int *num_finished_cols;
57 int num_threads_working;
58 } AV1TplRowMultiThreadSync;
60 typedef struct AV1TplRowMultiThreadInfo {
62 void (*sync_read_ptr)(AV1TplRowMultiThreadSync *tpl_mt_sync,
int r,
int c);
63 void (*sync_write_ptr)(AV1TplRowMultiThreadSync *tpl_mt_sync,
int r,
int c,
65 } AV1TplRowMultiThreadInfo;
78 #define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS) 81 #define MAX_LENGTH_TPL_FRAME_STATS (MAX_TPL_FRAME_IDX + REF_FRAMES + 1) 82 #define MAX_TPL_EXTEND (MAX_LAG_BUFFERS - MAX_GF_INTERVAL) 83 #define TPL_DEP_COST_SCALE_LOG2 4 85 typedef struct TplTxfmStats {
86 double abs_coeff_sum[256];
90 typedef struct TplDepStats {
95 int64_t cmp_recrf_dist[2];
98 int64_t cmp_recrf_rate[2];
101 int_mv mv[INTER_REFS_PER_FRAME];
102 int ref_frame_index[2];
103 int64_t pred_error[INTER_REFS_PER_FRAME];
106 typedef struct TplDepFrame {
108 TplDepStats *tpl_stats_ptr;
111 int ref_map_index[REF_FRAMES];
118 uint32_t frame_display_index;
119 double abs_coeff_sum[256];
120 double abs_coeff_mean[256];
122 int txfm_block_count;
168 struct scale_factors
sf;
235 int av1_tpl_ptr_pos(
int mi_row,
int mi_col,
int stride, uint8_t right_shift);
237 void av1_init_tpl_stats(
TplParams *
const tpl_data);
239 void av1_tpl_rdmult_setup(
struct AV1_COMP *cpi);
242 BLOCK_SIZE sb_size,
int mi_row,
int mi_col);
244 void av1_mc_flow_dispenser_row(
struct AV1_COMP *cpi,
246 int mi_row, BLOCK_SIZE bsize, TX_SIZE tx_size);
260 double av1_exponential_entropy(
double q_step,
double b);
275 double av1_laplace_entropy(
double q_step,
double b,
double zero_bin_ratio);
294 double av1_laplace_estimate_frame_rate(
int q_index,
int block_count,
295 const double *abs_coeff_mean,
306 void av1_tpl_stats_init_txfm_stats(TplDepFrame *tpl_frame,
int coeff_num);
313 #endif // AOM_AV1_ENCODER_TPL_MODEL_H_ int border_in_pixels
Definition: tpl_model.h:198
uint8_t tpl_bsize_1d
Definition: tpl_model.h:138
Params related to temporal dependency model.
Definition: tpl_model.h:129
const YV12_BUFFER_CONFIG * ref_frame[INTER_REFS_PER_FRAME]
Definition: tpl_model.h:187
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...
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition: encoder.h:2726
TplDepFrame tpl_stats_buffer[MAX_LENGTH_TPL_FRAME_STATS]
Definition: tpl_model.h:145
AV1TplRowMultiThreadSync tpl_mt_sync
Definition: tpl_model.h:193
struct scale_factors sf
Definition: tpl_model.h:168
TplDepStats * tpl_stats_pool[MAX_LAG_BUFFERS]
Definition: tpl_model.h:152
YV12_BUFFER_CONFIG tpl_rec_pool[MAX_LAG_BUFFERS]
Definition: tpl_model.h:158
YV12 frame buffer data structure.
Definition: yv12config.h:38
int frame_idx
Definition: tpl_model.h:173
Top level encoder structure.
Definition: encoder.h:2095
Declares top-level encoder structures and functions.
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:723
int skip_tpl_setup_stats
Definition: tpl_model.h:203
Encoder's parameters related to the current coding block.
Definition: block.h:846
TplDepFrame * tpl_frame
Definition: tpl_model.h:163
uint8_t tpl_stats_block_mis_log2
Definition: tpl_model.h:133
const YV12_BUFFER_CONFIG * src_ref_frame[INTER_REFS_PER_FRAME]
Definition: tpl_model.h:180