vp9_set_speed_features_framesize_dependent(cpi);
if (cpi->sf.enable_tpl_model) {
+ const int mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
+ const int mi_rows = mi_cols_aligned_to_sb(cm->mi_rows);
// TODO(jingning): Reduce the actual memory use for tpl model build up.
for (frame = 0; frame < MAX_ARF_GOP_SIZE; ++frame) {
- int mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
- int mi_rows = mi_cols_aligned_to_sb(cm->mi_rows);
-
CHECK_MEM_ERROR(cm, cpi->tpl_stats[frame].tpl_stats_ptr,
vpx_calloc(mi_rows * mi_cols,
sizeof(*cpi->tpl_stats[frame].tpl_stats_ptr)));
cpi->tpl_stats[frame].mi_rows = cm->mi_rows;
cpi->tpl_stats[frame].mi_cols = cm->mi_cols;
}
+
+ for (frame = 0; frame < REF_FRAMES; ++frame) {
+ cpi->enc_frame_buf[frame].mem_valid = 0;
+ cpi->enc_frame_buf[frame].released = 1;
+ }
}
// Allocate memory to store variances for a frame.
struct scale_factors sf;
} ARNRFilterData;
+typedef struct EncFrameBuf {
+ int mem_valid;
+ int released;
+ YV12_BUFFER_CONFIG frame;
+} EncFrameBuf;
+
// Maximum operating frame buffer size needed for a GOP using ARF reference.
#define MAX_ARF_GOP_SIZE (2 * MAX_LAG_BUFFERS)
YV12_BUFFER_CONFIG *raw_source_frame;
TplDepFrame tpl_stats[MAX_ARF_GOP_SIZE];
- YV12_BUFFER_CONFIG *tpl_recon_frames[REFS_PER_FRAME + 1];
+ YV12_BUFFER_CONFIG *tpl_recon_frames[REF_FRAMES];
+ EncFrameBuf enc_frame_buf[REF_FRAMES];
TileDataEnc *tile_data;
int allocated_tiles; // Keep track of memory allocated for tiles.