diff options
author | Jerome Jiang <jianj@google.com> | 2022-07-01 14:37:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-07-01 14:37:32 +0000 |
commit | 7b65e46983e8aae8024fef562a68aa72d7a111b9 (patch) | |
tree | 82c53c4372c09d99182f557243afea3be486ad67 /vp9/common | |
parent | dbac8e01e05ad3d1b47887b1ac864339115aa721 (diff) | |
parent | 5b530fc962bcb8a51bbf03f5fbc2912f21b86e70 (diff) | |
download | libvpx-7b65e46983e8aae8024fef562a68aa72d7a111b9.tar libvpx-7b65e46983e8aae8024fef562a68aa72d7a111b9.tar.gz libvpx-7b65e46983e8aae8024fef562a68aa72d7a111b9.tar.bz2 libvpx-7b65e46983e8aae8024fef562a68aa72d7a111b9.zip |
Merge "Fix bug with smaller width bigger size" into main
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_alloccommon.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index faad657a0..c27fe6477 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -132,15 +132,6 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) { if (cm->mi_alloc_size < new_mi_size) { cm->free_mi(cm); if (cm->alloc_mi(cm, new_mi_size)) goto fail; - } - - if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) { - // Create the segmentation map structure and set to 0. - free_seg_map(cm); - if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail; - } - - if (cm->above_context_alloc_cols < cm->mi_cols) { vpx_free(cm->above_context); cm->above_context = (ENTROPY_CONTEXT *)vpx_calloc( 2 * mi_cols_aligned_to_sb(cm->mi_cols) * MAX_MB_PLANE, @@ -154,6 +145,12 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) { cm->above_context_alloc_cols = cm->mi_cols; } + if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) { + // Create the segmentation map structure and set to 0. + free_seg_map(cm); + if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail; + } + if (vp9_alloc_loop_filter(cm)) goto fail; return 0; |