ref: 347ad7fff0459dc8b9dfc9613e66d594c44b57b0
parent: be9cf215a3960ce46b10c1be4e467367f0b18a9a
parent: 15b5e465f266c9d651a2d37a2759959d57887cf3
author: Dmitry Kovalev <[email protected]>
date: Tue Apr 30 08:00:35 EDT 2013
Merge "Adding vp9_update_frame_size function." into experimental
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -223,3 +223,28 @@
vp9_entropy_mode_init();
vp9_entropy_mv_init();
}
+
+
+void vp9_update_frame_size(VP9_COMMON *cm) {
+ const int aligned_width = multiple16(cm->width);
+ const int aligned_height = multiple16(cm->height);
+
+ cm->mb_rows = aligned_height >> 4;
+ cm->mb_cols = aligned_width >> 4;
+
+ cm->mi_rows = aligned_height >> LOG2_MI_SIZE;
+ cm->mi_cols = aligned_width >> LOG2_MI_SIZE;
+
+ cm->MBs = cm->mb_rows * cm->mb_cols;
+ cm->mode_info_stride = cm->mi_cols + 1;
+ cm->mi = cm->mip + cm->mode_info_stride + 1;
+ cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
+
+ memset(cm->mip, 0,
+ cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
+ vp9_update_mode_info_border(cm, cm->mip);
+ vp9_update_mode_info_in_image(cm, cm->mi);
+
+ vp9_update_mode_info_border(cm, cm->prev_mip);
+ vp9_update_mode_info_in_image(cm, cm->prev_mi);
+}
--- a/vp9/common/vp9_alloccommon.h
+++ b/vp9/common/vp9_alloccommon.h
@@ -25,4 +25,6 @@
void vp9_setup_version(VP9_COMMON *oci);
+void vp9_update_frame_size(VP9_COMMON *cm);
+
#endif // VP9_COMMON_VP9_ALLOCCOMMON_H_
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -896,29 +896,6 @@
read_coef_probs_common(fc->coef_probs_32x32, TX_32X32, r);
}
-static void update_frame_size(VP9D_COMP *pbi) {
- VP9_COMMON *cm = &pbi->common;
-
- const int width = multiple16(cm->width);
- const int height = multiple16(cm->height);
-
- cm->mb_rows = height / 16;
- cm->mi_rows = height >> LOG2_MI_SIZE;
- cm->mb_cols = width / 16;
- cm->mi_cols = width >> LOG2_MI_SIZE;
- cm->MBs = cm->mb_rows * cm->mb_cols;
- cm->mode_info_stride = cm->mi_cols + 1;
- memset(cm->mip, 0,
- cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
- vp9_update_mode_info_border(cm, cm->mip);
- vp9_update_mode_info_border(cm, cm->prev_mip);
-
- cm->mi = cm->mip + cm->mode_info_stride + 1;
- cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
- vp9_update_mode_info_in_image(cm, cm->mi);
- vp9_update_mode_info_in_image(cm, cm->prev_mi);
-}
-
static void setup_segmentation(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_reader *r) {
int i, j;
@@ -1110,7 +1087,7 @@
pc->display_width = scaling_active ? display_width : width;
pc->display_height = scaling_active ? display_height : height;
- update_frame_size(pbi);
+ vp9_update_frame_size(pc);
}
return data;
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -982,22 +982,7 @@
static void update_frame_size(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
- const int aligned_width = multiple16(cm->width);
- const int aligned_height = multiple16(cm->height);
-
- cm->mb_rows = aligned_height >> 4;
- cm->mi_rows = aligned_height >> LOG2_MI_SIZE;
- cm->mb_cols = aligned_width >> 4;
- cm->mi_cols = aligned_width >> LOG2_MI_SIZE;
- cm->MBs = cm->mb_rows * cm->mb_cols;
- cm->mode_info_stride = cm->mi_cols + 1;
- memset(cm->mip, 0,
- cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
- vp9_update_mode_info_border(cm, cm->mip);
-
- cm->mi = cm->mip + cm->mode_info_stride + 1;
- cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
- vp9_update_mode_info_in_image(cm, cm->mi);
+ vp9_update_frame_size(cm);
// Update size of buffers local to this frame
if (vp8_yv12_realloc_frame_buffer(&cpi->last_frame_uf,