mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Fixed rounding in bi-pred reconstruction
This commit is contained in:
parent
c7a17cf1c4
commit
da3fe9f199
15
src/search.c
15
src/search.c
|
@ -2486,17 +2486,18 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
|
|||
for (temp_x = 0; temp_x < LCU_WIDTH >> depth; ++temp_x) {
|
||||
int x_in_lcu = ((x + temp_x) & ((LCU_WIDTH)-1));
|
||||
lcu->rec.y[y_in_lcu * LCU_WIDTH + x_in_lcu] = (pixel_t)(((int)lcu->rec.y[y_in_lcu * LCU_WIDTH + x_in_lcu] +
|
||||
(int)temp_lcu_y[y_in_lcu * LCU_WIDTH + x_in_lcu]) >> 1);
|
||||
(int)temp_lcu_y[y_in_lcu * LCU_WIDTH + x_in_lcu] + 1) >> 1);
|
||||
}
|
||||
}
|
||||
for (temp_y = 0; temp_y < LCU_WIDTH >> (depth+1); ++temp_y) {
|
||||
int y_in_lcu = (((y >> 1) + temp_y) & ((LCU_WIDTH >> 1) - 1));
|
||||
int y_in_lcu = (((y >> 1) + temp_y) & (LCU_WIDTH_C - 1));
|
||||
for (temp_x = 0; temp_x < LCU_WIDTH >> (depth+1); ++temp_x) {
|
||||
int x_in_lcu = (((x >> 1) + temp_x) & ((LCU_WIDTH>>1)-1));
|
||||
lcu->rec.u[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu] = (pixel_t)((int)(lcu->rec.u[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu] +
|
||||
(int)temp_lcu_u[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu]) >> 1);
|
||||
lcu->rec.v[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu] = (pixel_t)(((int)lcu->rec.v[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu] +
|
||||
(int)temp_lcu_v[y_in_lcu * (LCU_WIDTH >> 1) + x_in_lcu]) >> 1);
|
||||
int x_in_lcu = (((x >> 1) + temp_x) & (LCU_WIDTH_C - 1));
|
||||
lcu->rec.u[y_in_lcu * LCU_WIDTH_C + x_in_lcu] = (pixel_t)(((int)lcu->rec.u[y_in_lcu * LCU_WIDTH_C + x_in_lcu] +
|
||||
(int)temp_lcu_u[y_in_lcu * LCU_WIDTH_C + x_in_lcu] + 1) >> 1);
|
||||
|
||||
lcu->rec.v[y_in_lcu * LCU_WIDTH_C + x_in_lcu] = (pixel_t)(((int)lcu->rec.v[y_in_lcu * LCU_WIDTH_C + x_in_lcu] +
|
||||
(int)temp_lcu_v[y_in_lcu * LCU_WIDTH_C + x_in_lcu] + 1) >> 1);
|
||||
}
|
||||
}
|
||||
FREE_POINTER(temp_lcu_y);
|
||||
|
|
Loading…
Reference in a new issue