Fixed transform offset value and set tr_depth to correct value when depth 0

This commit is contained in:
Marko Viitanen 2014-03-05 15:33:50 +02:00
parent 8f3d5045b0
commit b00f4c8dbf
2 changed files with 5 additions and 5 deletions

View file

@ -1789,7 +1789,7 @@ void encode_transform_tree(encoder_control* encoder, int32_t x, int32_t y, uint8
// Split transform and increase depth // Split transform and increase depth
if (depth == 0 || cur_cu->tr_depth > depth) { if (depth == 0 || cur_cu->tr_depth > depth) {
int offset = 1 << (MAX_DEPTH - (depth + 1)); int offset = LCU_WIDTH>>(depth+1);
encode_transform_tree(encoder, x, y, depth+1, lcu); encode_transform_tree(encoder, x, y, depth+1, lcu);
encode_transform_tree(encoder, x + offset, y, depth+1, lcu); encode_transform_tree(encoder, x + offset, y, depth+1, lcu);
encode_transform_tree(encoder, x, y + offset, depth+1, lcu); encode_transform_tree(encoder, x, y + offset, depth+1, lcu);
@ -2241,7 +2241,7 @@ void encode_transform_coeff(encoder_control *encoder, int32_t x_pu,int32_t y_pu,
// The implicit split by intra NxN is not counted towards max_tr_depth. // The implicit split by intra NxN is not counted towards max_tr_depth.
int max_tr_depth = (cur_cu->type == CU_INTRA ? TR_DEPTH_INTRA + intra_split_flag : TR_DEPTH_INTER); int max_tr_depth = (cur_cu->type == CU_INTRA ? TR_DEPTH_INTRA + intra_split_flag : TR_DEPTH_INTER);
int8_t split = (cur_cu->tr_depth > depth) | depth == 0; int8_t split = (cur_cu->tr_depth > depth);
int8_t cb_flag_u = cur_cu->coeff_top_u[depth]; int8_t cb_flag_u = cur_cu->coeff_top_u[depth];
int8_t cb_flag_v = cur_cu->coeff_top_v[depth]; int8_t cb_flag_v = cur_cu->coeff_top_v[depth];

View file

@ -593,7 +593,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 ? depth : 1;
cur_cu->type = CU_NOTSET; cur_cu->part_size = SIZE_2Nx2N; 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.