Home | History | Annotate | Download | only in libjasper

Lines Matching full:cblk

116     jpc_enc_cblk_t *cblk;
147 for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
149 for (i = 0; i < jas_matrix_numrows(cblk->data); ++i) {
150 for (j = 0; j < jas_matrix_numcols(cblk->data); ++j) {
151 v = abs(jas_matrix_get(cblk->data, i, j));
160 cblk->numbps = JAS_MAX(jpc_firstone(mx) + 1 - JPC_NUMEXTRABITS, 0);
163 for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
164 cblk->numimsbs = band->numbps - cblk->numbps;
165 assert(cblk->numimsbs >= 0);
168 for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
169 if (jpc_enc_enccblk(enc, cblk->stream, tcmpt, band, cblk)) {
193 int jpc_enc_enccblk(jpc_enc_t *enc, jas_stream_t *out, jpc_enc_tcmpt_t *tcmpt, jpc_enc_band_t *band, jpc_enc_cblk_t *cblk)
214 cblk->stream = jas_stream_memopen(0, 0);
215 assert(cblk->stream);
216 cblk->mqenc = jpc_mqenc_create(JPC_NUMCTXS, cblk->stream);
217 assert(cblk->mqenc);
218 jpc_mqenc_setctxs(cblk->mqenc, JPC_NUMCTXS, jpc_mqctxs);
220 cblk->numpasses = (cblk->numbps > 0) ? (3 * cblk->numbps - 2) : 0;
221 if (cblk->numpasses > 0) {
222 cblk->passes = jas_alloc2(cblk->numpasses, sizeof(jpc_enc_pass_t));
223 assert(cblk->passes);
225 cblk->passes = 0;
227 endpasses = &cblk->passes[cblk->numpasses];
228 for (pass = cblk->passes; pass != endpasses; ++pass) {
231 pass->term = JPC_ISTERMINATED(pass - cblk->passes, 0, cblk->numpasses, (tcmpt->cblksty & JPC_COX_TERMALL) != 0, (tcmpt->cblksty & JPC_COX_LAZY) != 0);
232 pass->type = JPC_SEGTYPE(pass - cblk->passes, 0, (tcmpt->cblksty & JPC_COX_LAZY) != 0);
240 cblk->flags = jas_matrix_create(jas_matrix_numrows(cblk->data) + 2,
241 jas_matrix_numcols(cblk->data) + 2);
242 assert(cblk->flags);
245 bitpos = cblk->numbps - 1;
246 pass = cblk->passes;
247 n = cblk->numpasses;
255 bout = jpc_bitstream_sopen(cblk->stream, "w");
261 passtype = (pass - cblk->passes + 2) % 3;
263 passtype = JPC_PASSTYPE(pass - cblk->passes + 2);
265 pass->start = jas_stream_tell(cblk->stream);
267 assert(jas_stream_tell(cblk->stream) == jas_stream_getrwcount(cblk->stream));
280 ret = (pass->type == JPC_SEG_MQ) ? jpc_encsigpass(cblk->mqenc,
281 bitpos, band->orient, vcausal, cblk->flags,
282 cblk->data, termmode, &pass->nmsedec) :
283 jpc_encrawsigpass(bout, bitpos, vcausal, cblk->flags,
284 cblk->data, termmode, &pass->nmsedec);
287 ret = (pass->type == JPC_SEG_MQ) ? jpc_encrefpass(cblk->mqenc,
288 bitpos, vcausal, cblk->flags, cblk->data, termmode,
290 vcausal, cblk->flags, cblk->data, termmode,
295 ret = jpc_encclnpass(cblk->mqenc, bitpos, band->orient,
296 vcausal, segsym, cblk->flags, cblk->data, termmode,
306 jpc_mqenc_init(cblk->mqenc);
308 jpc_mqenc_getstate(cblk->mqenc, &pass->mqencstate);
309 pass->end = jas_stream_tell(cblk->stream);
311 jpc_mqenc_setctxs(cblk->mqenc, JPC_NUMCTXS, jpc_mqctxs);
320 pass->end = jas_stream_tell(cblk->stream);
322 pass->end = jas_stream_tell(cblk->stream) +
330 assert(jas_stream_tell(cblk->stream) == jas_stream_getrwcount(cblk->stream));
341 if (pass != cblk->passes) {
351 dump_passes(cblk->passes, cblk->numpasses, cblk);
355 endpasses = &cblk->passes[cblk->numpasses];
356 for (pass = cblk->passes; pass != endpasses; ++pass) {
365 while (termpass - pass < cblk->numpasses &&
381 if ((c = getthebyte(cblk->stream, pass->end - 1)) == EOF) {
394 dump_passes(cblk->passes, cblk->numpasses, cblk);