Lines Matching defs:cblk
523 c->log2_cblk_width = (bytestream2_get_byteu(&s->g) & 15) + 2; // cblk width
524 c->log2_cblk_height = (bytestream2_get_byteu(&s->g) & 15) + 2; // cblk height
528 av_log(s->avctx, AV_LOG_ERROR, "cblk size invalid\n");
533 if (c->cblk_style != 0) { // cblk style
534 av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style);
1147 Jpeg2000Cblk *cblk = prec->cblk + cblkno;
1151 if (cblk->npasses)
1160 if (!cblk->npasses) {
1168 cblk->nonzerobits = v;
1173 if (cblk->npasses + newpasses >= JPEG2000_MAX_PASSES) {
1179 if (cblk->lblock + llen + av_log2(newpasses) > 16) {
1185 cblk->lblock += llen;
1187 cblk->nb_lengthinc = 0;
1188 cblk->nb_terminationsinc = 0;
1189 av_free(cblk->lengthinc);
1190 cblk->lengthinc = av_calloc(newpasses, sizeof(*cblk->lengthinc));
1191 if (!cblk->lengthinc)
1193 tmp = av_realloc_array(cblk->data_start, cblk->nb_terminations + newpasses + 1, sizeof(*cblk->data_start));
1196 cblk->data_start = tmp;
1202 if (needs_termination(codsty->cblk_style, cblk->npasses + newpasses1 - 1)) {
1203 cblk->nb_terminationsinc ++;
1208 if ((ret = get_bits(s, av_log2(newpasses1) + cblk->lblock)) < 0)
1210 if (ret > cblk->data_allocated) {
1211 size_t new_size = FFMAX(2*cblk->data_allocated, ret);
1212 void *new = av_realloc(cblk->data, new_size);
1214 cblk->data = new;
1215 cblk->data_allocated = new_size;
1218 if (ret > cblk->data_allocated) {
1221 cblk->data_allocated);
1224 cblk->lengthinc[cblk->nb_lengthinc++] = ret;
1225 cblk->npasses += newpasses1;
1253 Jpeg2000Cblk *cblk = prec->cblk + cblkno;
1254 if (!cblk->nb_terminationsinc && !cblk->lengthinc)
1256 for (cwsno = 0; cwsno < cblk->nb_lengthinc; cwsno ++) {
1257 if (cblk->data_allocated < cblk->length + cblk->lengthinc[cwsno] + 4) {
1258 size_t new_size = FFMAX(2*cblk->data_allocated, cblk->length + cblk->lengthinc[cwsno] + 4);
1259 void *new = av_realloc(cblk->data, new_size);
1261 cblk->data = new;
1262 cblk->data_allocated = new_size;
1265 if ( bytestream2_get_bytes_left(&s->g) < cblk->lengthinc[cwsno]
1266 || cblk->data_allocated < cblk->length + cblk->lengthinc[cwsno] + 4
1270 cblk->length, cblk->lengthinc[cwsno], bytestream2_get_bytes_left(&s->g));
1274 bytestream2_get_bufferu(&s->g, cblk->data + cblk->length, cblk->lengthinc[cwsno]);
1275 cblk->length += cblk->lengthinc[cwsno];
1276 cblk->lengthinc[cwsno] = 0;
1277 if (cblk->nb_terminationsinc) {
1278 cblk->nb_terminationsinc--;
1279 cblk->nb_terminations++;
1280 cblk->data[cblk->length++] = 0xFF;
1281 cblk->data[cblk->length++] = 0xFF;
1282 cblk->data_start[cblk->nb_terminations] = cblk->length;
1285 av_freep(&cblk->lengthinc);
1759 Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
1762 int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1 + roi_shift;
1774 if (!cblk->length)
1779 cblk->data[cblk->length] = 0xff;
1780 cblk->data[cblk->length+1] = 0xff;
1781 ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
1807 if (term_cnt >= cblk->nb_terminations) {
1811 if (FFABS(cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp) > 0) {
1813 cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp,
1814 pass_cnt, cblk->npasses);
1817 ff_mqc_initdec(&t1->mqc, cblk->data + cblk->data_start[++term_cnt], coder_type == 2, 0);
1828 if (cblk->data + cblk->length - 2 > t1->mqc.bp) {
1830 cblk->data + cblk->length - 2 - t1->mqc.bp);
1833 if (cblk->data + cblk->length < t1->mqc.bp) {
1860 static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
1865 int w = cblk->coord[0][1] - cblk->coord[0][0];
1866 for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
1875 static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
1880 int w = cblk->coord[0][1] - cblk->coord[0][0];
1881 for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
1895 static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
1900 int w = cblk->coord[0][1] - cblk->coord[0][0];
1901 for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
1937 static inline void roi_scale_cblk(Jpeg2000Cblk *cblk,
1942 int w = cblk->coord[0][1] - cblk->coord[0][0];
1943 for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
1989 Jpeg2000Cblk *cblk = prec->cblk + cblkno;
1990 int ret = decode_cblk(s, codsty, &t1, cblk,
1991 cblk->coord[0][1] - cblk->coord[0][0],
1992 cblk->coord[1][1] - cblk->coord[1][0],
1998 x = cblk->coord[0][0] - band->coord[0][0];
1999 y = cblk->coord[1][0] - band->coord[1][0];
2002 roi_scale_cblk(cblk, comp, &t1);
2004 dequantization_float(x, y, cblk, comp, &t1, band);
2006 dequantization_int_97(x, y, cblk, comp, &t1, band);
2008 dequantization_int(x, y, cblk, comp, &t1, band);
2009 } /* end cblk */