vp9: remove partition+entropy contexts from common
authorJames Zern <jzern@google.com>
Thu, 24 Oct 2013 19:33:46 +0000 (21:33 +0200)
committerJames Zern <jzern@google.com>
Mon, 28 Oct 2013 10:34:20 +0000 (11:34 +0100)
these are now handled separately by the encoder and decoder

Change-Id: If9b16f7d734e992fb94a510a6d88f2690d7fb7cb

vp9/common/vp9_alloccommon.c
vp9/common/vp9_onyxc_int.h

index 0f50f37..0d65651 100644 (file)
@@ -41,17 +41,12 @@ void vp9_free_frame_buffers(VP9_COMMON *cm) {
 
   vpx_free(cm->mip);
   vpx_free(cm->prev_mip);
-  vpx_free(cm->above_seg_context);
   vpx_free(cm->last_frame_seg_map);
   vpx_free(cm->mi_grid_base);
   vpx_free(cm->prev_mi_grid_base);
 
-  vpx_free(cm->above_context[0]);
-  for (i = 0; i < MAX_MB_PLANE; i++)
-    cm->above_context[i] = 0;
   cm->mip = NULL;
   cm->prev_mip = NULL;
-  cm->above_seg_context = NULL;
   cm->last_frame_seg_map = NULL;
   cm->mi_grid_base = NULL;
   cm->prev_mi_grid_base = NULL;
@@ -85,7 +80,7 @@ static void setup_mi(VP9_COMMON *cm) {
 }
 
 int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
-  int i, mi_cols;
+  int i;
 
   const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
   const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
@@ -140,21 +135,6 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
 
   setup_mi(cm);
 
-  // FIXME(jkoleszar): allocate subsampled arrays for U/V once subsampling
-  // information is exposed at this level
-  mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
-
-  // 2 contexts per 'mi unit', so that we have one context per 4x4 txfm
-  // block where mi unit size is 8x8.
-  cm->above_context[0] = vpx_calloc(sizeof(ENTROPY_CONTEXT) * MAX_MB_PLANE *
-                                         (2 * mi_cols), 1);
-  if (!cm->above_context[0])
-    goto fail;
-
-  cm->above_seg_context = vpx_calloc(sizeof(PARTITION_CONTEXT) * mi_cols, 1);
-  if (!cm->above_seg_context)
-    goto fail;
-
   // Create the segmentation map structure and set to 0.
   cm->last_frame_seg_map = vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
   if (!cm->last_frame_seg_map)
@@ -186,18 +166,12 @@ void vp9_initialize_common() {
 }
 
 void vp9_update_frame_size(VP9_COMMON *cm) {
-  int i, mi_cols;
   const int aligned_width = ALIGN_POWER_OF_TWO(cm->width, MI_SIZE_LOG2);
   const int aligned_height = ALIGN_POWER_OF_TWO(cm->height, MI_SIZE_LOG2);
 
   set_mb_mi(cm, aligned_width, aligned_height);
   setup_mi(cm);
 
-  mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
-  for (i = 1; i < MAX_MB_PLANE; i++)
-    cm->above_context[i] =
-        cm->above_context[0] + i * sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
-
   // Initialize the previous frame segment map to 0.
   if (cm->last_frame_seg_map)
     vpx_memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols);
index 04964b3..f45ffb5 100644 (file)
@@ -183,14 +183,6 @@ typedef struct VP9Common {
   struct loopfilter lf;
   struct segmentation seg;
 
-  /* Y,U,V */
-  ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
-  ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16];
-
-  // partition contexts
-  PARTITION_CONTEXT *above_seg_context;
-  PARTITION_CONTEXT left_seg_context[8];
-
   // Context probabilities for reference frame prediction
   int allow_comp_inter_inter;
   MV_REFERENCE_FRAME comp_fixed_ref;