summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_alloccommon.c
diff options
context:
space:
mode:
authorangiebird <angiebird@google.com>2019-10-29 12:13:41 -0700
committerangiebird <angiebird@google.com>2019-10-29 17:37:48 -0700
commit90a65c2064c20728ee689381628221036b56491f (patch)
tree44f99fec761da7556e4e91e45e1278eb1bb30f94 /vp9/common/vp9_alloccommon.c
parent65f9ded3951f4ae7bda634e308862d5fd3bea730 (diff)
downloadlibvpx-90a65c2064c20728ee689381628221036b56491f.tar
libvpx-90a65c2064c20728ee689381628221036b56491f.tar.gz
libvpx-90a65c2064c20728ee689381628221036b56491f.tar.bz2
libvpx-90a65c2064c20728ee689381628221036b56491f.zip
Add vp9_get_encoder_config / vp9_get_frame_info
Change-Id: Id5c8b2d69a36d218ec04cd504868ce0efebf6b69
Diffstat (limited to 'vp9/common/vp9_alloccommon.c')
-rw-r--r--vp9/common/vp9_alloccommon.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c
index 7345e259b..5702dca71 100644
--- a/vp9/common/vp9_alloccommon.c
+++ b/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) {