70 int h,
int w,
int stride, uint8_t *pfptr)
77 for (i = dx + h; i > dx; i--) {
78 nsptr = sptr + i * stride + dy * 3;
79 npfptr = pfptr + i * stride + dy * 3;
80 for (j = 0; j < w * 3; j++) {
81 diff |= npfptr[j] ^ nsptr[j];
99 "Input dimensions too large, input must be max 4096x4096 !\n");
104 memset(&s->
zstream, 0,
sizeof(z_stream));
124 int buf_size,
int block_width,
int block_height,
125 uint8_t *previous_frame,
int *I_frame)
129 int h_blocks, v_blocks, h_part, v_part, i, j;
135 put_bits(&pb, 4, block_width / 16 - 1);
137 put_bits(&pb, 4, block_height / 16 - 1);
148 for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
150 int y_pos = j * block_height;
151 int cur_blk_height = (j < v_blocks) ? block_height : v_part;
154 for (i = 0; i < h_blocks + (h_part ? 1 : 0); i++) {
155 int x_pos = i * block_width;
156 int cur_blk_width = (i < h_blocks) ? block_width : h_part;
158 uint8_t *ptr = buf + buf_pos;
164 x_pos, cur_blk_height, cur_blk_width,
167 if (res || *I_frame) {
168 unsigned long zsize = 3 * block_width * block_height;
169 ret = compress2(ptr + 2, &zsize, s->
tmpblock,
170 3 * cur_blk_width * cur_blk_height, 9);
175 "error while compressing block %dx%d\n", i, j);
177 bytestream_put_be16(&ptr, zsize);
178 buf_pos += zsize + 2;
182 bytestream_put_be16(&ptr, 0);
198 int buf_size,
void *
data)
206 int opt_w = 4, opt_h = 4;