Fixed CU type initialization and PU index calculations

This commit is contained in:
Marko Viitanen 2014-02-28 15:56:27 +02:00
parent c05e91472d
commit f1882a0d82
3 changed files with 5 additions and 5 deletions

View file

@ -1875,7 +1875,7 @@ void encode_transform_tree(encoder_control* encoder, int32_t x, int32_t y, uint8
if(cur_cu->type == CU_INTRA) if(cur_cu->type == CU_INTRA)
{ {
int pu_index = x_pu + 2 * (y_pu); int pu_index = x_pu&1 + 2 * (y_pu&1);
int luma_mode = cur_cu->intra[pu_index].mode; int luma_mode = cur_cu->intra[pu_index].mode;
scan_idx_luma = SCAN_DIAG; scan_idx_luma = SCAN_DIAG;
@ -1960,7 +1960,7 @@ void encode_transform_tree(encoder_control* encoder, int32_t x, int32_t y, uint8
cur_cu->coeff_top_y[d] = 1; cur_cu->coeff_top_y[d] = 1;
} }
} else { } else {
int pu_index = x_pu + 2 * y_pu; int pu_index = x_pu&1 + 2 * (y_pu&1);
cur_cu->coeff_top_y[depth + pu_index] = 1; cur_cu->coeff_top_y[depth + pu_index] = 1;
} }
break; break;

View file

@ -100,7 +100,7 @@ pixel intra_get_dc_pred(pixel *pic, uint16_t picwidth, uint8_t width)
return (pixel)((sum + width) / (width + width)); return (pixel)((sum + width) / (width + width));
} }
#define PU_INDEX(x_pu, y_pu) (((x_pu) % 2) + 2 * (y_pu % 2)) #define PU_INDEX(x_pu, y_pu) (((x_pu) % 2) + 2 * ((y_pu) % 2))
/** /**
* \brief Function for deriving intra luma predictions * \brief Function for deriving intra luma predictions

View file

@ -576,7 +576,7 @@ static int search_cu(encoder_control *encoder, int x, int y, int depth, lcu_t wo
cur_cu = &(&work_tree[depth])->cu[LCU_CU_OFFSET+(x_local>>3) + (y_local>>3)*LCU_T_CU_WIDTH]; cur_cu = &(&work_tree[depth])->cu[LCU_CU_OFFSET+(x_local>>3) + (y_local>>3)*LCU_T_CU_WIDTH];
// Assign correct depth // Assign correct depth
cur_cu->depth = depth; cur_cu->tr_depth = depth; cur_cu->depth = depth; cur_cu->tr_depth = depth;
cur_cu->type = CU_NOTSET; cur_cu->part_size = SIZE_2Nx2N;
// If the CU is completely inside the frame at this depth, search for // If the CU is completely inside the frame at this depth, search for
// prediction modes at this depth. // prediction modes at this depth.
if (x + cu_width <= encoder->in.width && if (x + cu_width <= encoder->in.width &&