]> granicus.if.org Git - libvpx/commitdiff
Moving get_token_alloc function from common to the encoder.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 1 Oct 2013 18:54:10 +0000 (11:54 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 1 Oct 2013 18:54:10 +0000 (11:54 -0700)
Also renaming mb_row -> mi_row, mb_col -> mi_col arguments and calculate
mb_rows/mb_cols values from mi_rows/mi_cols.

Change-Id: I6919a279f560648e23bc9a12f507d17c21ffd5d7

vp9/common/vp9_alloccommon.c
vp9/common/vp9_onyxc_int.h
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.h
vp9/encoder/vp9_onyx_int.h

index 5e526a83c1dac680322ff3edf883788ba4bf810d..f0c653f72b9869e0e37c07078efd194bee683e06 100644 (file)
@@ -58,13 +58,13 @@ void vp9_free_frame_buffers(VP9_COMMON *cm) {
 }
 
 static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
-  cm->mb_cols = (aligned_width + 8) >> 4;
-  cm->mb_rows = (aligned_height + 8) >> 4;
-  cm->MBs = cm->mb_rows * cm->mb_cols;
-
   cm->mi_cols = aligned_width >> MI_SIZE_LOG2;
   cm->mi_rows = aligned_height >> MI_SIZE_LOG2;
   cm->mode_info_stride = cm->mi_cols + MI_BLOCK_SIZE;
+
+  cm->mb_cols = (cm->mi_cols + 1) >> 1;
+  cm->mb_rows = (cm->mi_rows + 1) >> 1;
+  cm->MBs = cm->mb_rows * cm->mb_cols;
 }
 
 static void setup_mi(VP9_COMMON *cm) {
index f7d639103a0885f7f8271fa716780de0db5d6c57..953764c859d7baf1cf247dd8f96d8a8369f22643 100644 (file)
@@ -291,10 +291,6 @@ static void set_mi_row_col(VP9_COMMON *cm, MACROBLOCKD *xd,
   xd->right_available = (mi_col + bw < cm->cur_tile_mi_col_end);
 }
 
-static int get_token_alloc(int mb_rows, int mb_cols) {
-  return mb_rows * mb_cols * (48 * 16 + 4);
-}
-
 static void set_prev_mi(VP9_COMMON *cm) {
   const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
                                        cm->height == cm->last_height &&
index 8950a05a8f166ae0476ea9e453d997ff6264a096..7a4dee4d58373480480f352584a93127dfecab8c 100644 (file)
@@ -461,18 +461,17 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
 }
 
 void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
-                          int mb_row, int mb_col) {
-  uint8_t *buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, src
-      ->alpha_buffer};
-  int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, src
-      ->alpha_stride};
+                          int mi_row, int mi_col) {
+  uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+                               src->alpha_buffer};
+  const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+                          src->alpha_stride};
   int i;
 
-  for (i = 0; i < MAX_MB_PLANE; i++) {
-    setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mb_row, mb_col,
+  for (i = 0; i < MAX_MB_PLANE; i++)
+    setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mi_row, mi_col,
                      NULL, x->e_mbd.plane[i].subsampling_x,
                      x->e_mbd.plane[i].subsampling_y);
-  }
 }
 
 static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
index 399196927cb805c2aaa94a1c12f1d052e7437e62..3e9f5381c06ae66b0cc61cb6bca8891a168965ab 100644 (file)
@@ -17,6 +17,6 @@ struct yv12_buffer_config;
 
 void vp9_setup_src_planes(struct macroblock *x,
                           const struct yv12_buffer_config *src,
-                          int mb_row, int mb_col);
+                          int mi_row, int mi_col);
 
 #endif  // VP9_ENCODER_VP9_ENCODEFRAME_H_
index 1002ff756d930b7cef4c36268775c5c7da194179..2b2ef16555b757bbc23fa255abf2d3d42a71a439 100644 (file)
@@ -698,4 +698,8 @@ int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest);
 
 void vp9_alloc_compressor_data(VP9_COMP *cpi);
 
+static int get_token_alloc(int mb_rows, int mb_cols) {
+  return mb_rows * mb_cols * (48 * 16 + 4);
+}
+
 #endif  // VP9_ENCODER_VP9_ONYX_INT_H_