Skip to content
Snippets Groups Projects
Commit 4f586f7b authored by Scott LaVarnway's avatar Scott LaVarnway
Browse files

Broken EC after MODE_INFO size reduction

This patch fixes the compiler errors and the seg fault
when running decode_with_partial_drops.

Change-Id: I7c75369e2fef81d53b790d5dabc327218216838b
parent 1fe5070b
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,11 @@ typedef struct ...@@ -143,6 +143,11 @@ typedef struct
int_mv mv; int_mv mv;
} B_MODE_INFO; } B_MODE_INFO;
union b_mode_info
{
B_PREDICTION_MODE as_mode;
int_mv mv;
};
typedef enum typedef enum
{ {
...@@ -168,11 +173,7 @@ typedef struct ...@@ -168,11 +173,7 @@ typedef struct
typedef struct typedef struct
{ {
MB_MODE_INFO mbmi; MB_MODE_INFO mbmi;
union union b_mode_info bmi[16];
{
B_PREDICTION_MODE as_mode;
int_mv mv;
} bmi[16];
} MODE_INFO; } MODE_INFO;
typedef struct typedef struct
......
...@@ -13,13 +13,15 @@ ...@@ -13,13 +13,15 @@
#define MAX_OVERLAPS 16 #define MAX_OVERLAPS 16
/* The area (pixel area in Q6) the block pointed to by bmi overlaps /* The area (pixel area in Q6) the block pointed to by bmi overlaps
* another block with. * another block with.
*/ */
typedef struct typedef struct
{ {
int overlap; int overlap;
B_MODE_INFO *bmi; union b_mode_info *bmi;
} OVERLAP_NODE; } OVERLAP_NODE;
/* Structure to keep track of overlapping blocks on a block level. */ /* Structure to keep track of overlapping blocks on a block level. */
......
...@@ -69,7 +69,7 @@ void vp8_de_alloc_overlap_lists(VP8D_COMP *pbi) ...@@ -69,7 +69,7 @@ void vp8_de_alloc_overlap_lists(VP8D_COMP *pbi)
/* Inserts a new overlap area value to the list of overlaps of a block */ /* Inserts a new overlap area value to the list of overlaps of a block */
static void assign_overlap(OVERLAP_NODE* overlaps, static void assign_overlap(OVERLAP_NODE* overlaps,
B_MODE_INFO *bmi, union b_mode_info *bmi,
int overlap) int overlap)
{ {
int i; int i;
...@@ -111,7 +111,7 @@ static int block_overlap(int b1_row, int b1_col, int b2_row, int b2_col) ...@@ -111,7 +111,7 @@ static int block_overlap(int b1_row, int b1_col, int b2_row, int b2_col)
* first block being overlapped in the macroblock has position (first_blk_row, * 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. * 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 new_row, int new_col,
int mb_row, int mb_col, int mb_row, int mb_col,
int first_blk_row, int first_blk_col) int first_blk_row, int first_blk_col)
...@@ -171,7 +171,7 @@ static void calculate_overlaps_mb(B_OVERLAP *b_overlaps, B_MODE_INFO *bmi, ...@@ -171,7 +171,7 @@ static void calculate_overlaps_mb(B_OVERLAP *b_overlaps, B_MODE_INFO *bmi,
void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul, void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul,
int mb_rows, int mb_cols, int mb_rows, int mb_cols,
B_MODE_INFO *bmi, union b_mode_info *bmi,
int b_row, int b_col) int b_row, int b_col)
{ {
MB_OVERLAP *mb_overlap; MB_OVERLAP *mb_overlap;
...@@ -246,7 +246,7 @@ void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul, ...@@ -246,7 +246,7 @@ void vp8_calculate_overlaps(MB_OVERLAP *overlap_ul,
* Filters out all overlapping blocks which do not refer to the correct * Filters out all overlapping blocks which do not refer to the correct
* reference frame type. * 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 i;
int overlap_sum = 0; int overlap_sum = 0;
...@@ -267,13 +267,11 @@ static void estimate_mv(const OVERLAP_NODE *overlaps, B_MODE_INFO *bmi) ...@@ -267,13 +267,11 @@ static void estimate_mv(const OVERLAP_NODE *overlaps, B_MODE_INFO *bmi)
/* Q9 / Q6 = Q3 */ /* Q9 / Q6 = Q3 */
bmi->mv.as_mv.col = col_acc / overlap_sum; bmi->mv.as_mv.col = col_acc / overlap_sum;
bmi->mv.as_mv.row = row_acc / overlap_sum; bmi->mv.as_mv.row = row_acc / overlap_sum;
bmi->mode = NEW4X4;
} }
else else
{ {
bmi->mv.as_mv.col = 0; bmi->mv.as_mv.col = 0;
bmi->mv.as_mv.row = 0; bmi->mv.as_mv.row = 0;
bmi->mode = NEW4X4;
} }
} }
...@@ -290,7 +288,7 @@ static void estimate_mb_mvs(const B_OVERLAP *block_overlaps, ...@@ -290,7 +288,7 @@ static void estimate_mb_mvs(const B_OVERLAP *block_overlaps,
int i; int i;
int non_zero_count = 0; int non_zero_count = 0;
MV * const filtered_mv = &(mi->mbmi.mv.as_mv); 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->col = 0;
filtered_mv->row = 0; filtered_mv->row = 0;
for (i = 0; i < 16; ++i) for (i = 0; i < 16; ++i)
...@@ -558,7 +556,7 @@ static void interpolate_mvs(MACROBLOCKD *mb, ...@@ -558,7 +556,7 @@ static void interpolate_mvs(MACROBLOCKD *mb,
*/ */
mv->as_mv.row = mv_row_sum / w_sum; mv->as_mv.row = mv_row_sum / w_sum;
mv->as_mv.col = mv_col_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, mi->mbmi.need_to_clamp_mvs = vp8_check_mv_bounds(mv,
mb->mb_to_left_edge, mb->mb_to_left_edge,
mb->mb_to_right_edge, mb->mb_to_right_edge,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment