summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Chiang <angiebird@google.com>2019-01-18 23:05:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-18 23:05:51 +0000
commit73cb14553d6711b3c97c68986479fa8310d2a315 (patch)
treedcf0bd0a89dda744f1d69d8b0c4097e01e5d39ba
parent77c1b9d259149fb53d1c1852786568c4367ae85d (diff)
parent0437a885a84fb620e337b277277a4e9fa7c57b01 (diff)
downloadlibvpx-73cb14553d6711b3c97c68986479fa8310d2a315.tar
libvpx-73cb14553d6711b3c97c68986479fa8310d2a315.tar.gz
libvpx-73cb14553d6711b3c97c68986479fa8310d2a315.tar.bz2
libvpx-73cb14553d6711b3c97c68986479fa8310d2a315.zip
Merge changes Id99ca6fc,I34cdbc6e,Iac7fee46
* changes: Correct pyramid_mv_arr's memory size Adjust lambda with bsize in build_motion_field() Free pyramid_mv_arr properly
-rw-r--r--vp9/encoder/vp9_encoder.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index bf35b3570..11037cd14 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2572,6 +2572,15 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
vpx_free(cpi->feature_score_loc_heap);
#endif
for (frame = 0; frame < MAX_ARF_GOP_SIZE; ++frame) {
+#if CONFIG_NON_GREEDY_MV
+ int rf_idx;
+ for (rf_idx = 0; rf_idx < 3; ++rf_idx) {
+ int sqr_bsize;
+ for (sqr_bsize = 0; sqr_bsize < SQUARE_BLOCK_SIZES; ++sqr_bsize) {
+ vpx_free(cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize]);
+ }
+ }
+#endif
vpx_free(cpi->tpl_stats[frame].tpl_stats_ptr);
cpi->tpl_stats[frame].is_valid = 0;
}
@@ -6156,11 +6165,13 @@ static void build_motion_field(VP9_COMP *cpi, MACROBLOCKD *xd, int frame_idx,
TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
const int mi_height = num_8x8_blocks_high_lookup[bsize];
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
+ const int pw = num_4x4_blocks_wide_lookup[bsize] << 2;
+ const int ph = num_4x4_blocks_high_lookup[bsize] << 2;
int fs_loc_sort_size;
int fs_loc_heap_size;
int mi_row, mi_col;
- tpl_frame->lambda = 250;
+ tpl_frame->lambda = (pw * ph) / 4;
fs_loc_sort_size = 0;
for (mi_row = 0; mi_row < cm->mi_rows; mi_row += mi_height) {
@@ -6459,13 +6470,13 @@ static void init_tpl_buffer(VP9_COMP *cpi) {
continue;
#if CONFIG_NON_GREEDY_MV
- vpx_free(cpi->tpl_stats[frame].pyramid_mv_arr);
for (rf_idx = 0; rf_idx < 3; ++rf_idx) {
for (sqr_bsize = 0; sqr_bsize < SQUARE_BLOCK_SIZES; ++sqr_bsize) {
+ vpx_free(cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize]);
CHECK_MEM_ERROR(
cm, cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize],
vpx_calloc(
- mi_rows * mi_cols,
+ mi_rows * mi_cols * 4,
sizeof(
*cpi->tpl_stats[frame].pyramid_mv_arr[rf_idx][sqr_bsize])));
}