diff options
author | Johann <johannkoenig@google.com> | 2019-12-19 15:13:14 -0800 |
---|---|---|
committer | Johann <johannkoenig@google.com> | 2020-01-13 15:18:33 -0800 |
commit | 6ec360e770aae975eb3702467d9df6f76bc29700 (patch) | |
tree | 2aefc46ce3861ac17b136a0d66f82212c5bfa5ab /libvpx/vp9/common/vp9_alloccommon.c | |
parent | f95b460169fe5b77f1d493fd2e58b31a2dbf816b (diff) | |
download | libvpx-6ec360e770aae975eb3702467d9df6f76bc29700.tar.gz |
libvpx: Pull from upstream
Current HEAD: 7ec7a33a081aeeb53fed1a8d87e4cbd189152527
git log from upstream:
7ec7a33a0 Release v1.8.2 Pekin Duck
Test: upstream
Change-Id: If7ab690a76b3cd93a3c922d5e9fc9a3996668005
Diffstat (limited to 'libvpx/vp9/common/vp9_alloccommon.c')
-rw-r--r-- | libvpx/vp9/common/vp9_alloccommon.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/libvpx/vp9/common/vp9_alloccommon.c b/libvpx/vp9/common/vp9_alloccommon.c index 7345e259b..5702dca71 100644 --- a/libvpx/vp9/common/vp9_alloccommon.c +++ b/libvpx/vp9/common/vp9_alloccommon.c @@ -17,17 +17,26 @@ #include "vp9/common/vp9_entropymv.h" #include "vp9/common/vp9_onyxc_int.h" -void vp9_set_mb_mi(VP9_COMMON *cm, int width, int height) { +void vp9_set_mi_size(int *mi_rows, int *mi_cols, int *mi_stride, int width, + int height) { const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2); const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2); + *mi_cols = aligned_width >> MI_SIZE_LOG2; + *mi_rows = aligned_height >> MI_SIZE_LOG2; + *mi_stride = calc_mi_size(*mi_cols); +} - cm->mi_cols = aligned_width >> MI_SIZE_LOG2; - cm->mi_rows = aligned_height >> MI_SIZE_LOG2; - cm->mi_stride = calc_mi_size(cm->mi_cols); +void vp9_set_mb_size(int *mb_rows, int *mb_cols, int *mb_num, int mi_rows, + int mi_cols) { + *mb_cols = (mi_cols + 1) >> 1; + *mb_rows = (mi_rows + 1) >> 1; + *mb_num = (*mb_rows) * (*mb_cols); +} - cm->mb_cols = (cm->mi_cols + 1) >> 1; - cm->mb_rows = (cm->mi_rows + 1) >> 1; - cm->MBs = cm->mb_rows * cm->mb_cols; +void vp9_set_mb_mi(VP9_COMMON *cm, int width, int height) { + vp9_set_mi_size(&cm->mi_rows, &cm->mi_cols, &cm->mi_stride, width, height); + vp9_set_mb_size(&cm->mb_rows, &cm->mb_cols, &cm->MBs, cm->mi_rows, + cm->mi_cols); } static int alloc_seg_map(VP9_COMMON *cm, int seg_map_size) { |