int av1_clpf_maxbits(const AV1_COMMON *cm) {
return get_msb(
- ALIGN_POWER_OF_TWO(cm->mi_cols * MAX_MIB_SIZE, cm->clpf_size + 4) *
- ALIGN_POWER_OF_TWO(cm->mi_rows * MAX_MIB_SIZE,
- cm->clpf_size + 4) >>
+ ALIGN_POWER_OF_TWO(cm->mi_cols * MI_SIZE, cm->clpf_size + 4) *
+ ALIGN_POWER_OF_TWO(cm->mi_rows * MI_SIZE, cm->clpf_size + 4) >>
(cm->clpf_size * 2 + 8)) +
1;
}
unsigned int, unsigned int, uint8_t *)) {
/* Constrained low-pass filter (CLPF) */
int c, k, l, m, n;
- int width = rec->y_crop_width;
- int height = rec->y_crop_height;
+ const int bs = MI_SIZE;
+ int width = cm->mi_cols * bs;
+ int height = cm->mi_rows * bs;
int xpos, ypos;
int stride_y = rec->y_stride;
- const int bs = MAX_MIB_SIZE;
int num_fb_hor = (width + (1 << fb_size_log2) - bs) >> fb_size_log2;
int num_fb_ver = (height + (1 << fb_size_log2) - bs) >> fb_size_log2;
int block_index = 0;
// 50% probability, so a more efficient coding is possible.
aom_wb_write_literal(wb, cm->clpf_numblocks, av1_clpf_maxbits(cm));
for (i = 0; i < cm->clpf_numblocks; i++) {
- aom_wb_write_literal(wb, cm->clpf_blocks[i], 1);
+ aom_wb_write_literal(wb, cm->clpf_blocks ? cm->clpf_blocks[i] : 0, 1);
}
}
}