• Home
  • Raw
  • Download

Lines Matching refs:bi

115 static int get_block_info(BlockInfo *bi, int block)  in get_block_info()  argument
117 bi->row = block / bi->blocks_per_row; in get_block_info()
118 bi->col = block % bi->blocks_per_row; in get_block_info()
121 if (bi->col == bi->blocks_per_row - 1 && (bi->image_width % 4) != 0) { in get_block_info()
122 bi->block_width = bi->image_width % 4; in get_block_info()
124 bi->block_width = 4; in get_block_info()
128 if (bi->row == (bi->image_height / 4) && (bi->image_height % 4) != 0) { in get_block_info()
129 bi->block_height = bi->image_height % 4; in get_block_info()
131 bi->block_height = 4; in get_block_info()
134 return block ? (bi->col * 4) + (bi->row * bi->rowstride * 4) : 0; in get_block_info()
194 static void get_max_component_diff(BlockInfo *bi, uint16_t *block_ptr, in get_max_component_diff() argument
206 for (y = 0; y < bi->block_height; y++) { in get_max_component_diff()
207 for (x = 0; x < bi->block_width; x++) { in get_max_component_diff()
217 block_ptr += bi->rowstride; in get_max_component_diff()
244 static int compare_blocks(uint16_t *block1, uint16_t *block2, BlockInfo *bi, int thresh) in compare_blocks() argument
247 for (y = 0; y < bi->block_height; y++) { in compare_blocks()
248 for (x = 0; x < bi->block_width; x++) { in compare_blocks()
254 block1 += bi->rowstride; in compare_blocks()
255 block2 += bi->rowstride; in compare_blocks()
264 static int leastsquares(uint16_t *block_ptr, BlockInfo *bi, in leastsquares() argument
273 count = bi->block_height * bi->block_width; in leastsquares()
278 for (i = 0; i < bi->block_height; i++) { in leastsquares()
279 for (j = 0; j < bi->block_width; j++) { in leastsquares()
288 block_ptr += bi->rowstride; in leastsquares()
317 static int calc_lsq_max_fit_error(uint16_t *block_ptr, BlockInfo *bi, in calc_lsq_max_fit_error() argument
325 for (i = 0; i < bi->block_height; i++) { in calc_lsq_max_fit_error()
326 for (j = 0; j < bi->block_width; j++) { in calc_lsq_max_fit_error()
349 block_ptr += bi->rowstride; in calc_lsq_max_fit_error()
386 PutBitContext *pb, uint16_t *block_ptr, BlockInfo *bi) in encode_four_color_block() argument
409 block_ptr += bi->rowstride; in encode_four_color_block()
419 const BlockInfo *bi, int block_counter) in update_block_in_prev_frame() argument
421 const int y_size = FFMIN(4, bi->image_height - bi->row * 4); in update_block_in_prev_frame()
425 dest_pixels += bi->rowstride; in update_block_in_prev_frame()
426 src_pixels += bi->rowstride; in update_block_in_prev_frame()
445 static int update_block_stats(RpzaContext *s, BlockInfo *bi, uint16_t *block, in update_block_stats() argument
488 total_pixels_blk = *total_pixels + bi->block_height * bi->block_width; in update_block_stats()
493 for (y = 0; y < bi->block_height; y++) { in update_block_stats()
494 for (x = 0; x < bi->block_width; x++) { in update_block_stats()
507 block += bi->rowstride; in update_block_stats()
551 BlockInfo bi; in rpza_encode_stream() local
572 bi.image_width = s->frame_width; in rpza_encode_stream()
573 bi.image_height = s->frame_height; in rpza_encode_stream()
574 bi.rowstride = pict->linesize[0] / 2; in rpza_encode_stream()
576 bi.blocks_per_row = (s->frame_width + 3) / 4; in rpza_encode_stream()
588 block_offset = get_block_info(&bi, block_counter + n_blocks); in rpza_encode_stream()
604 &src_pixels[block_offset], &bi, s->skip_frame_thresh) != 0) { in rpza_encode_stream()
640 block_offset = get_block_info(&bi, block_counter); in rpza_encode_stream()
645 if (update_block_stats(s, &bi, &src_pixels[block_offset], in rpza_encode_stream()
654 &prev_pixels[block_offset], &bi, block_counter + n_blocks); in rpza_encode_stream()
658 block_offset = get_block_info(&bi, block_counter + n_blocks); in rpza_encode_stream()
666 if (!update_block_stats(s, &bi, &src_pixels[block_offset], in rpza_encode_stream()
676 … &prev_pixels[block_offset], &bi, block_counter + n_blocks); in rpza_encode_stream()
691 get_max_component_diff(&bi, &src_pixels[block_offset], &min, &max, &chan); in rpza_encode_stream()
710 if (leastsquares(&src_pixels[block_offset], &bi, chan, i, in rpza_encode_stream()
723 err = FFMAX(calc_lsq_max_fit_error(&src_pixels[block_offset], &bi, in rpza_encode_stream()
735 block_offset = get_block_info(&bi, block_counter); in rpza_encode_stream()
738 y_size = FFMIN(4, bi.image_height - bi.row * 4); in rpza_encode_stream()
746 row_ptr += bi.rowstride; in rpza_encode_stream()
757 &s->pb, &src_pixels[block_offset], &bi); in rpza_encode_stream()
762 &prev_pixels[block_offset], &bi, block_counter); in rpza_encode_stream()