shithub: libvpx

Download patch

ref: ba420f10977bbaf5296a8d4d7423d4c293609f97
parent: 5a8cbb895550983774247a7d9e80092ee82f5122
parent: 4f586f7bd0a32c26a0b7cc28faa16520bb370182
author: Scott LaVarnway <slavarnway@google.com>
date: Fri May 27 03:52:04 EDT 2011

Merge "Broken EC after MODE_INFO size reduction"

--- a/vp8/common/blockd.h
+++ b/vp8/common/blockd.h
@@ -143,6 +143,11 @@
     int_mv mv;
 } B_MODE_INFO;
 
+union b_mode_info
+{
+    B_PREDICTION_MODE as_mode;
+    int_mv mv;
+};
 
 typedef enum
 {
@@ -168,11 +173,7 @@
 typedef struct
 {
     MB_MODE_INFO mbmi;
-    union
-    {
-        B_PREDICTION_MODE as_mode;
-        int_mv mv;
-    } bmi[16];
+    union b_mode_info bmi[16];
 } MODE_INFO;
 
 typedef struct
--- a/vp8/decoder/ec_types.h
+++ b/vp8/decoder/ec_types.h
@@ -13,6 +13,8 @@
 
 #define MAX_OVERLAPS 16
 
+
+
 /* The area (pixel area in Q6) the block pointed to by bmi overlaps
  * another block with.
  */
@@ -19,7 +21,7 @@
 typedef struct
 {
     int overlap;
-    B_MODE_INFO *bmi;
+    union b_mode_info *bmi;
 } OVERLAP_NODE;
 
 /* Structure to keep track of overlapping blocks on a block level. */
--- a/vp8/decoder/error_concealment.c
+++ b/vp8/decoder/error_concealment.c
@@ -69,7 +69,7 @@
 
 /* Inserts a new overlap area value to the list of overlaps of a block */
 static void assign_overlap(OVERLAP_NODE* overlaps,
-                           B_MODE_INFO *bmi,
+                           union b_mode_info *bmi,
                            int overlap)
 {
     int i;
@@ -111,7 +111,7 @@
  * first block being overlapped in the macroblock has position (first_blk_row,
  * first_blk_col) in blocks relative the upper-left corner of the image.
  */
-static void calculate_overlaps_mb(B_OVERLAP *b_overlaps, B_MODE_INFO *bmi,
+static void calculate_overlaps_mb(B_OVERLAP *b_overlaps, union b_mode_info *bmi,
                                   int new_row, int new_col,
                                   int mb_row, int mb_col,
                                   int first_blk_row, int first_blk_col)
@@ -171,7 +171,7 @@
 
 void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul,
                             int mb_rows, int mb_cols,
-                            B_MODE_INFO *bmi,
+                            union b_mode_info *bmi,
                             int b_row, int b_col)
 {
     MB_OVERLAP *mb_overlap;
@@ -246,7 +246,7 @@
  * Filters out all overlapping blocks which do not refer to the correct
  * reference frame type.
  */
-static void estimate_mv(const OVERLAP_NODE *overlaps, B_MODE_INFO *bmi)
+static void estimate_mv(const OVERLAP_NODE *overlaps, union b_mode_info *bmi)
 {
     int i;
     int overlap_sum = 0;
@@ -267,13 +267,11 @@
         /* Q9 / Q6 = Q3 */
         bmi->mv.as_mv.col = col_acc / overlap_sum;
         bmi->mv.as_mv.row = row_acc / overlap_sum;
-        bmi->mode = NEW4X4;
     }
     else
     {
         bmi->mv.as_mv.col = 0;
         bmi->mv.as_mv.row = 0;
-        bmi->mode = NEW4X4;
     }
 }
 
@@ -290,7 +288,7 @@
     int i;
     int non_zero_count = 0;
     MV * const filtered_mv = &(mi->mbmi.mv.as_mv);
-    B_MODE_INFO * const bmi = mi->bmi;
+    union b_mode_info * const bmi = mi->bmi;
     filtered_mv->col = 0;
     filtered_mv->row = 0;
     for (i = 0; i < 16; ++i)
@@ -558,7 +556,7 @@
                  */
                 mv->as_mv.row = mv_row_sum / w_sum;
                 mv->as_mv.col = mv_col_sum / w_sum;
-                mi->bmi[row*4 + col].mode = NEW4X4;
+
                 mi->mbmi.need_to_clamp_mvs = vp8_check_mv_bounds(mv,
                                                        mb->mb_to_left_edge,
                                                        mb->mb_to_right_edge,