VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
BufferPool *const pool) {
- unsigned int i;
+ unsigned int i, frame;
VP9_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP9_COMP));
VP9_COMMON *volatile const cm = cpi != NULL ? &cpi->common : NULL;
}
#endif // !CONFIG_REALTIME_ONLY
+ for (frame = 0; frame < MAX_LAG_BUFFERS; ++frame) {
+ CHECK_MEM_ERROR(cm, cpi->tpl_stats[frame].tpl_stats_ptr,
+ vpx_calloc(cm->mi_rows * cm->mi_cols,
+ sizeof(*cpi->tpl_stats[frame].tpl_stats_ptr)));
+ cpi->tpl_stats[frame].is_valid = 1;
+ cpi->tpl_stats[frame].width = cm->mi_cols;
+ cpi->tpl_stats[frame].height = cm->mi_rows;
+ cpi->tpl_stats[frame].stride = cm->mi_cols;
+ }
+
vp9_set_speed_features_framesize_independent(cpi);
vp9_set_speed_features_framesize_dependent(cpi);
void vp9_remove_compressor(VP9_COMP *cpi) {
VP9_COMMON *cm;
- unsigned int i;
+ unsigned int i, frame;
int t;
if (!cpi) return;
vp9_denoiser_free(&(cpi->denoiser));
#endif
+ for (frame = 0; frame < MAX_LAG_BUFFERS; ++frame) {
+ if (cpi->tpl_stats[frame].is_valid)
+ vpx_free(cpi->tpl_stats[frame].tpl_stats_ptr);
+ cpi->tpl_stats[frame].is_valid = 0;
+ }
+
for (t = 0; t < cpi->num_workers; ++t) {
VPxWorker *const worker = &cpi->workers[t];
EncWorkerData *const thread_data = &cpi->tile_thr_data[t];