OpenJPH Open-source implementation of JPEG2000 Part-15

Loading...
Searching...
No Matches
ojph_resolution.cpp
Go to the documentation of this file.
1//***************************************************************************/
2// This software is released under the 2-Clause BSD license, included
3// below.
4//
5// Copyright (c) 2019, Aous Naman
6// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7// Copyright (c) 2019, The University of New South Wales, Australia
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// 1. Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15//
16// 2. Redistributions in binary form must reproduce the above copyright
17// notice, this list of conditions and the following disclaimer in the
18// documentation and/or other materials provided with the distribution.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31//***************************************************************************/
32// This file is part of the OpenJPH software implementation.
33// File: ojph_resolution.cpp
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#include <climits>
40#include <cmath>
41#include <new>
42
43#include "ojph_mem.h"
44#include "ojph_params.h"
45#include "ojph_codestream_local.h"
46#include "ojph_resolution.h"
47#include "ojph_tile_comp.h"
48#include "ojph_tile.h"
49#include "ojph_subband.h"
50#include "ojph_precinct.h"
51
52#include "../transform/ojph_transform.h"
53
54 namespace ojph {
55
56 namespace local
57 {
59 void resolution::pre_alloc(codestream* codestream, const rect& res_rect,
60 const rect& recon_res_rect,
61 ui32 comp_num, ui32 res_num)
62 {
63 mem_fixed_allocator* allocator = codestream->get_allocator();
64 const param_cod* cdp = codestream->get_coc(comp_num);
65 ui32 num_decomps = cdp->get_num_decompositions();
66 ui32 t = num_decomps - codestream->get_skipped_res_for_recon();
67 bool skipped_res_for_recon = res_num > t;
68
69 const param_atk* atk = cdp->access_atk();
70 param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
71 if (cdp->is_dfs_defined()) {
72 const param_dfs* dfs = codestream->access_dfs();
73 if (dfs == NULL) {
74 OJPH_ERROR(0x00070001, "There is a problem with codestream "
75 "marker segments. COD/COC specifies the use of a DFS marker "
76 "but there are no DFS markers within the main codestream "
77 "headers");
78 }
79 else {
80 ui16 dfs_idx = cdp->get_dfs_index();
81 dfs = dfs->get_dfs(dfs_idx);
82 if (dfs == NULL) {
83 OJPH_ERROR(0x00070002, "There is a problem with codestream "
84 "marker segments. COD/COC specifies the use of a DFS marker "
85 "with index %d, but there are no such marker within the "
86 "main codestream headers", dfs_idx);
87 }
88 ds = dfs->get_dwt_type(num_decomps - res_num + 1);
89 }
90 }
91
92 ui32 transform_flags = 0;
93 if (res_num > 0)
94 {
95 if (ds == param_dfs::BIDIR_DWT)
96 transform_flags = HORZ_TRX | VERT_TRX;
97 else if (ds == param_dfs::HORZ_DWT)
98 transform_flags = HORZ_TRX;
99 else if (ds == param_dfs::VERT_DWT)
100 transform_flags = VERT_TRX;
101 }
102
103 //allocate resolution/subbands
104 ui32 trx0 = res_rect.org.x;
105 ui32 try0 = res_rect.org.y;
106 ui32 trx1 = res_rect.org.x + res_rect.siz.w;
107 ui32 try1 = res_rect.org.y + res_rect.siz.h;
108 allocator->pre_alloc_obj<subband>(4);
109 if (res_num > 0)
110 {
111 if (ds == param_dfs::BIDIR_DWT)
112 {
113 for (ui32 i = 0; i < 4; ++i)
114 {
115 ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
116 ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
117 ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
118 ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
119
120 rect re;
121 re.org.x = tbx0;
122 re.org.y = tby0;
123 re.siz.w = tbx1 - tbx0;
124 re.siz.h = tby1 - tby0;
125 if (i == 0) {
126 allocator->pre_alloc_obj<resolution>(1);
127 resolution::pre_alloc(codestream, re,
128 skipped_res_for_recon ? recon_res_rect : re,
129 comp_num, res_num - 1);
130 }
131 else
132 subband::pre_alloc(codestream, re, comp_num, res_num,
133 transform_flags);
134 }
135 }
136 else if (ds == param_dfs::VERT_DWT)
137 {
138 ui32 tby0, tby1;
139 rect re = res_rect;
140 tby0 = (try0 + 1) >> 1;
141 tby1 = (try1 + 1) >> 1;
142 re.org.y = tby0;
143 re.siz.h = tby1 - tby0;
144 allocator->pre_alloc_obj<resolution>(1);
145 resolution::pre_alloc(codestream, re,
146 skipped_res_for_recon ? recon_res_rect : re,
147 comp_num, res_num - 1);
148
149 tby0 = try0 >> 1;
150 tby1 = try1 >> 1;
151 re.org.y = tby0;
152 re.siz.h = tby1 - tby0;
153 subband::pre_alloc(codestream, re, comp_num, res_num,
154 transform_flags);
155 }
156 else if (ds == param_dfs::HORZ_DWT)
157 {
158 ui32 tbx0, tbx1;
159 rect re = res_rect;
160 tbx0 = (trx0 + 1) >> 1;
161 tbx1 = (trx1 + 1) >> 1;
162 re.org.x = tbx0;
163 re.siz.w = tbx1 - tbx0;
164 allocator->pre_alloc_obj<resolution>(1);
165 resolution::pre_alloc(codestream, re,
166 skipped_res_for_recon ? recon_res_rect : re,
167 comp_num, res_num - 1);
168
169 tbx0 = trx0 >> 1;
170 tbx1 = trx1 >> 1;
171 re.org.x = tbx0;
172 re.siz.w = tbx1 - tbx0;
173 subband::pre_alloc(codestream, re, comp_num, res_num,
174 transform_flags);
175 }
176 else
177 {
178 assert(ds == param_dfs::NO_DWT);
179 allocator->pre_alloc_obj<resolution>(1);
180 resolution::pre_alloc(codestream, res_rect,
181 skipped_res_for_recon ? recon_res_rect : res_rect,
182 comp_num, res_num - 1);
183 }
184 }
185 else
186 subband::pre_alloc(codestream, res_rect, comp_num, res_num,
187 transform_flags);
188
189 //prealloc precincts
190 size log_PP = cdp->get_log_precinct_size(res_num);
191 size num_precincts;
192 if (trx0 != trx1 && try0 != try1)
193 {
194 num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
195 num_precincts.w -= trx0 >> log_PP.w;
196 num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
197 num_precincts.h -= try0 >> log_PP.h;
198 allocator->pre_alloc_obj<precinct>((size_t)num_precincts.area());
199 }
200
201 //allocate lines
202 if (skipped_res_for_recon == false)
203 {
204 ui32 num_steps = atk->get_num_steps();
205 allocator->pre_alloc_obj<line_buf>(num_steps + 2);
206 allocator->pre_alloc_obj<lifting_buf>(num_steps + 2);
207
208 const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
209 ui32 precision = qp->propose_precision(cdp);
210 const param_atk* atk = cdp->access_atk();
211 bool reversible = atk->is_reversible();
212
213 ui32 width = res_rect.siz.w + 1;
214 if (reversible)
215 {
216 if (precision <= 32) {
217 for (ui32 i = 0; i < num_steps; ++i)
218 allocator->pre_alloc_data<si32>(width, 1);
219 allocator->pre_alloc_data<si32>(width, 1);
220 allocator->pre_alloc_data<si32>(width, 1);
221 }
222 else
223 {
224 for (ui32 i = 0; i < num_steps; ++i)
225 allocator->pre_alloc_data<si64>(width, 1);
226 allocator->pre_alloc_data<si64>(width, 1);
227 allocator->pre_alloc_data<si64>(width, 1);
228 }
229 }
230 else {
231 for (ui32 i = 0; i < num_steps; ++i)
232 allocator->pre_alloc_data<float>(width, 1);
233 allocator->pre_alloc_data<float>(width, 1);
234 allocator->pre_alloc_data<float>(width, 1);
235 }
236 }
237 }
238
240 void resolution::finalize_alloc(codestream* codestream,
241 const rect& res_rect,
242 const rect& recon_res_rect,
243 ui32 comp_num, ui32 res_num,
244 point comp_downsamp, point res_downsamp,
245 tile_comp* parent_tile_comp,
246 resolution* parent_res)
247 {
248 mem_fixed_allocator* allocator = codestream->get_allocator();
249 elastic = codestream->get_elastic_alloc();
250 const param_cod* cdp = codestream->get_coc(comp_num);
251 ui32 t, num_decomps = cdp->get_num_decompositions();
252 t = num_decomps - codestream->get_skipped_res_for_recon();
253 skipped_res_for_recon = res_num > t;
254 t = num_decomps - codestream->get_skipped_res_for_read();
255 skipped_res_for_read = res_num > t;
256
257 this->comp_downsamp = comp_downsamp;
258 this->parent_comp = parent_tile_comp;
259 this->parent_res = parent_res;
260 this->res_rect = res_rect;
261 this->comp_num = comp_num;
262 this->res_num = res_num;
263 this->num_bytes = 0;
264 this->atk = cdp->access_atk();
265 param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
266 if (cdp->is_dfs_defined()) {
267 const param_dfs* dfs = codestream->access_dfs();
268 if (dfs == NULL) {
269 OJPH_ERROR(0x00070011, "There is a problem with codestream "
270 "marker segments. COD/COC specifies the use of a DFS marker "
271 "but there are no DFS markers within the main codestream "
272 "headers");
273 }
274 else {
275 ui16 dfs_idx = cdp->get_dfs_index();
276 dfs = dfs->get_dfs(dfs_idx);
277 if (dfs == NULL) {
278 OJPH_ERROR(0x00070012, "There is a problem with codestream "
279 "marker segments. COD/COC specifies the use of a DFS marker "
280 "with index %d, but there are no such marker within the "
281 "main codestream headers", dfs_idx);
282 }
283 ui32 num_decomps = cdp->get_num_decompositions();
284 ds = dfs->get_dwt_type(num_decomps - res_num + 1);
285 }
286 }
287
288 transform_flags = 0;
289 if (res_num > 0)
290 {
291 if (ds == param_dfs::BIDIR_DWT)
292 transform_flags = HORZ_TRX | VERT_TRX;
293 else if (ds == param_dfs::HORZ_DWT)
294 transform_flags = HORZ_TRX;
295 else if (ds == param_dfs::VERT_DWT)
296 transform_flags = VERT_TRX;
297 }
298
299 //allocate resolution/subbands
300 ui32 trx0 = res_rect.org.x;
301 ui32 try0 = res_rect.org.y;
302 ui32 trx1 = res_rect.org.x + res_rect.siz.w;
303 ui32 try1 = res_rect.org.y + res_rect.siz.h;
304 bands = allocator->post_alloc_obj<subband>(4);
305 for (int i = 0; i < 4; ++i)
306 new (bands + i) subband;
307 if (res_num > 0)
308 {
309 if (ds == param_dfs::BIDIR_DWT)
310 {
311 for (ui32 i = 0; i < 4; ++i)
312 {
313 ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
314 ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
315 ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
316 ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
317
318 rect re;
319 re.org.x = tbx0;
320 re.org.y = tby0;
321 re.siz.w = tbx1 - tbx0;
322 re.siz.h = tby1 - tby0;
323 if (i == 0) {
324 point next_res_downsamp;
325 next_res_downsamp.x = res_downsamp.x * 2;
326 next_res_downsamp.y = res_downsamp.y * 2;
327
328 child_res = allocator->post_alloc_obj<resolution>(1);
329 child_res->finalize_alloc(codestream, re,
330 skipped_res_for_recon ? recon_res_rect : re, comp_num,
331 res_num - 1, comp_downsamp, next_res_downsamp,
332 parent_tile_comp, this);
333 }
334 else
335 bands[i].finalize_alloc(codestream, re, this, res_num, i);
336 }
337 }
338 else if (ds == param_dfs::VERT_DWT)
339 {
340 ui32 tby0, tby1;
341 rect re = res_rect;
342 tby0 = (try0 + 1) >> 1;
343 tby1 = (try1 + 1) >> 1;
344 re.org.y = tby0;
345 re.siz.h = tby1 - tby0;
346
347 point next_res_downsamp;
348 next_res_downsamp.x = res_downsamp.x;
349 next_res_downsamp.y = res_downsamp.y * 2;
350 child_res = allocator->post_alloc_obj<resolution>(1);
351 child_res->finalize_alloc(codestream, re,
352 skipped_res_for_recon ? recon_res_rect : re, comp_num,
353 res_num - 1, comp_downsamp, next_res_downsamp,
354 parent_tile_comp, this);
355
356 tby0 = try0 >> 1;
357 tby1 = try1 >> 1;
358 re.org.y = tby0;
359 re.siz.h = tby1 - tby0;
360 bands[2].finalize_alloc(codestream, re, this, res_num, 2);
361 }
362 else if (ds == param_dfs::HORZ_DWT)
363 {
364 ui32 tbx0, tbx1;
365 rect re = res_rect;
366 tbx0 = (trx0 + 1) >> 1;
367 tbx1 = (trx1 + 1) >> 1;
368 re.org.x = tbx0;
369 re.siz.w = tbx1 - tbx0;
370
371 point next_res_downsamp;
372 next_res_downsamp.x = res_downsamp.x * 2;
373 next_res_downsamp.y = res_downsamp.y;
374 child_res = allocator->post_alloc_obj<resolution>(1);
375 child_res->finalize_alloc(codestream, re,
376 skipped_res_for_recon ? recon_res_rect : re, comp_num,
377 res_num - 1, comp_downsamp, next_res_downsamp,
378 parent_tile_comp, this);
379
380 tbx0 = trx0 >> 1;
381 tbx1 = trx1 >> 1;
382 re.org.x = tbx0;
383 re.siz.w = tbx1 - tbx0;
384 bands[1].finalize_alloc(codestream, re, this, res_num, 1);
385 }
386 else
387 {
388 assert(ds == param_dfs::NO_DWT);
389 child_res = allocator->post_alloc_obj<resolution>(1);
390 child_res->finalize_alloc(codestream, res_rect,
391 skipped_res_for_recon ? recon_res_rect : res_rect, comp_num,
392 res_num - 1, comp_downsamp, res_downsamp, parent_tile_comp, this);
393 }
394 }
395 else {
396 child_res = NULL;
397 bands[0].finalize_alloc(codestream, res_rect, this, res_num, 0);
398 }
399
400 //finalize precincts
401 log_PP = cdp->get_log_precinct_size(res_num);
402 num_precincts = size();
403 precincts = NULL;
404 if (trx0 != trx1 && try0 != try1)
405 {
406 num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
407 num_precincts.w -= trx0 >> log_PP.w;
408 num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
409 num_precincts.h -= try0 >> log_PP.h;
410 precincts =
411 allocator->post_alloc_obj<precinct>((size_t)num_precincts.area());
412 ui64 num = num_precincts.area();
413 for (ui64 i = 0; i < num; ++i)
414 precincts[i] = precinct();
415 }
416 // precincts will be initialized in full shortly
417
418 ui32 x_lower_bound = (trx0 >> log_PP.w) << log_PP.w;
419 ui32 y_lower_bound = (try0 >> log_PP.h) << log_PP.h;
420
421 precinct* pp = precincts;
422 point tile_top_left = parent_tile_comp->get_tile()->get_tile_rect().org;
423 for (ui32 y = 0; y < num_precincts.h; ++y)
424 {
425 ui32 ppy0 = y_lower_bound + (y << log_PP.h);
426 for (ui32 x = 0; x < num_precincts.w; ++x, ++pp)
427 {
428 ui32 ppx0 = x_lower_bound + (x << log_PP.w);
429 point t(res_downsamp.x * ppx0, res_downsamp.y * ppy0);
430 t.x = t.x > tile_top_left.x ? t.x : tile_top_left.x;
431 t.y = t.y > tile_top_left.y ? t.y : tile_top_left.y;
432 pp->img_point = t;
433 pp->bands = bands;
434 pp->may_use_sop = cdp->packets_may_use_sop();
435 pp->uses_eph = cdp->packets_use_eph();
436 pp->scratch = codestream->get_precinct_scratch();
437 pp->coded = NULL;
438 }
439 }
440 for (int i = 0; i < 4; ++i)
441 if (bands[i].exists())
442 bands[i].get_cb_indices(num_precincts, precincts);
443
444 // determine how to divide scratch into multiple levels of
445 // tag trees
446 size log_cb = cdp->get_log_block_dims();
447 log_PP.w -= (transform_flags & HORZ_TRX) ? 1 : 0;
448 log_PP.h -= (transform_flags & VERT_TRX) ? 1 : 0;
449 size ratio;
450 ratio.w = log_PP.w - ojph_min(log_cb.w, log_PP.w);
451 ratio.h = log_PP.h - ojph_min(log_cb.h, log_PP.h);
452 max_num_levels = ojph_max(ratio.w, ratio.h);
453 ui32 val = 1u << (max_num_levels << 1);
454 tag_tree_size = (int)((val * 4 + 2) / 3);
455 ++max_num_levels;
456 level_index[0] = 0;
457 for (ui32 i = 1; i <= max_num_levels; ++i, val >>= 2)
458 level_index[i] = level_index[i - 1] + val;
459 cur_precinct_loc = point(0, 0);
460
461 //allocate lines
462 if (skipped_res_for_recon == false)
463 {
464 this->atk = cdp->access_atk();
465 this->reversible = atk->is_reversible();
466 this->num_steps = atk->get_num_steps();
467 // create line buffers and lifting_bufs
468 lines = allocator->post_alloc_obj<line_buf>(num_steps + 2);
469 ssp = allocator->post_alloc_obj<lifting_buf>(num_steps + 2);
470 sig = ssp + num_steps;
471 aug = ssp + num_steps + 1;
472
473 // initiate lifting_bufs
474 for (ui32 i = 0; i < num_steps; ++i) {
475 new (ssp + i) lifting_buf;
476 ssp[i].line = lines + i;
477 };
478 new (sig) lifting_buf;
479 sig->line = lines + num_steps;
480 new (aug) lifting_buf;
481 aug->line = lines + num_steps + 1;
482
483 const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
484 ui32 precision = qp->propose_precision(cdp);
485
486 // initiate storage of line_buf
487 ui32 width = res_rect.siz.w + 1;
488 if (this->reversible)
489 {
490 if (precision <= 32)
491 {
492 for (ui32 i = 0; i < num_steps; ++i)
493 ssp[i].line->wrap(
494 allocator->post_alloc_data<si32>(width, 1), width, 1);
495 sig->line->wrap(
496 allocator->post_alloc_data<si32>(width, 1), width, 1);
497 aug->line->wrap(
498 allocator->post_alloc_data<si32>(width, 1), width, 1);
499 }
500 else
501 {
502 for (ui32 i = 0; i < num_steps; ++i)
503 ssp[i].line->wrap(
504 allocator->post_alloc_data<si64>(width, 1), width, 1);
505 sig->line->wrap(
506 allocator->post_alloc_data<si64>(width, 1), width, 1);
507 aug->line->wrap(
508 allocator->post_alloc_data<si64>(width, 1), width, 1);
509 }
510 }
511 else
512 {
513 for (ui32 i = 0; i < num_steps; ++i)
514 ssp[i].line->wrap(
515 allocator->post_alloc_data<float>(width, 1), width, 1);
516 sig->line->wrap(
517 allocator->post_alloc_data<float>(width, 1), width, 1);
518 aug->line->wrap(
519 allocator->post_alloc_data<float>(width, 1), width, 1);
520 }
521
522 cur_line = 0;
523 rows_to_produce = res_rect.siz.h;
524 vert_even = (res_rect.org.y & 1) == 0;
525 horz_even = (res_rect.org.x & 1) == 0;
526 }
527 }
528
530 line_buf* resolution::get_line()
531 {
532 if (vert_even)
533 {
534 ++cur_line;
535 sig->active = true;
536 return sig->line;
537 }
538 else
539 {
540 ++cur_line;
541 aug->active = true;
542 return aug->line;
543 }
544 }
545
547 void resolution::push_line()
548 {
549 if (res_num == 0)
550 {
551 assert(child_res == NULL);
552 bands[0].exchange_buf(vert_even ? sig->line : aug->line);
553 bands[0].push_line();
554 return;
555 }
556
557 ui32 width = res_rect.siz.w;
558 if (width == 0)
559 return;
560 if (reversible)
561 {
562 if (res_rect.siz.h > 1)
563 {
564 if (!vert_even && cur_line < res_rect.siz.h) {
565 vert_even = !vert_even;
566 return;
567 }
568
569 do
570 {
571 //vertical transform
572 for (ui32 i = 0; i < num_steps; ++i)
573 {
574 if (aug->active && (sig->active || ssp[i].active))
575 {
576 line_buf* dp = aug->line;
577 line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
578 line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
579 const lifting_step* s = atk->get_step(num_steps - i - 1);
580 rev_vert_step(s, sp1, sp2, dp, width, false);
581 }
582 lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
583 }
584
585 if (aug->active) {
586 rev_horz_ana(atk, bands[2].get_line(),
587 bands[3].get_line(), aug->line, width, horz_even);
588 bands[2].push_line();
589 bands[3].push_line();
590 aug->active = false;
591 --rows_to_produce;
592 }
593 if (sig->active) {
594 rev_horz_ana(atk, child_res->get_line(),
595 bands[1].get_line(), sig->line, width, horz_even);
596 bands[1].push_line();
597 child_res->push_line();
598 sig->active = false;
599 --rows_to_produce;
600 };
601 vert_even = !vert_even;
602 } while (cur_line >= res_rect.siz.h && rows_to_produce > 0);
603 }
604 else
605 {
606 if (vert_even) {
607 // horizontal transform
608 rev_horz_ana(atk, child_res->get_line(),
609 bands[1].get_line(), sig->line, width, horz_even);
610 bands[1].push_line();
611 child_res->push_line();
612 }
613 else
614 {
615 // vertical transform
616 if (aug->line->flags & line_buf::LFT_32BIT)
617 {
618 si32* sp = aug->line->i32;
619 for (ui32 i = width; i > 0; --i)
620 *sp++ <<= 1;
621 }
622 else
623 {
624 assert(aug->line->flags & line_buf::LFT_64BIT);
625 si64* sp = aug->line->i64;
626 for (ui32 i = width; i > 0; --i)
627 *sp++ <<= 1;
628 }
629 // horizontal transform
630 rev_horz_ana(atk, bands[2].get_line(),
631 bands[3].get_line(), aug->line, width, horz_even);
632 bands[2].push_line();
633 bands[3].push_line();
634 }
635 }
636 }
637 else
638 {
639 if (res_rect.siz.h > 1)
640 {
641 if (!vert_even && cur_line < res_rect.siz.h) {
642 vert_even = !vert_even;
643 return;
644 }
645
646 do
647 {
648 //vertical transform
649 for (ui32 i = 0; i < num_steps; ++i)
650 {
651 if (aug->active && (sig->active || ssp[i].active))
652 {
653 line_buf* dp = aug->line;
654 line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
655 line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
656 const lifting_step* s = atk->get_step(num_steps - i - 1);
657 irv_vert_step(s, sp1, sp2, dp, width, false);
658 }
659 lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
660 }
661
662 if (aug->active) {
663 const float K = atk->get_K();
664 irv_vert_times_K(K, aug->line, width);
665
666 irv_horz_ana(atk, bands[2].get_line(),
667 bands[3].get_line(), aug->line, width, horz_even);
668 bands[2].push_line();
669 bands[3].push_line();
670 aug->active = false;
671 --rows_to_produce;
672 }
673 if (sig->active) {
674 const float K_inv = 1.0f / atk->get_K();
675 irv_vert_times_K(K_inv, sig->line, width);
676
677 irv_horz_ana(atk, child_res->get_line(),
678 bands[1].get_line(), sig->line, width, horz_even);
679 bands[1].push_line();
680 child_res->push_line();
681 sig->active = false;
682 --rows_to_produce;
683 };
684 vert_even = !vert_even;
685 } while (cur_line >= res_rect.siz.h && rows_to_produce > 0);
686 }
687 else
688 {
689 if (vert_even) {
690 // horizontal transform
691 irv_horz_ana(atk, child_res->get_line(),
692 bands[1].get_line(), sig->line, width, horz_even);
693 bands[1].push_line();
694 child_res->push_line();
695 }
696 else
697 {
698 // vertical transform
699 float* sp = aug->line->f32;
700 for (ui32 i = width; i > 0; --i)
701 *sp++ *= 2.0f;
702 // horizontal transform
703 irv_horz_ana(atk, bands[2].get_line(),
704 bands[3].get_line(), aug->line, width, horz_even);
705 bands[2].push_line();
706 bands[3].push_line();
707 }
708 }
709 }
710 }
711
713 line_buf* resolution::pull_line()
714 {
715 if (res_num == 0)
716 {
717 assert(child_res == NULL);
718 return bands[0].pull_line();
719 }
720
721 if (skipped_res_for_recon == true)
722 return child_res->pull_line();
723
724 ui32 width = res_rect.siz.w;
725 if (width == 0)
726 return NULL;
727
728 if (transform_flags & VERT_TRX)
729 {
730 if (reversible)
731 {
732 if (res_rect.siz.h > 1)
733 {
734 if (sig->active) {
735 sig->active = false;
736 return sig->line;
737 };
738 for (;;)
739 {
740 //horizontal transform
741 if (cur_line < res_rect.siz.h)
742 {
743 if (vert_even) { // even
744 if (transform_flags & HORZ_TRX)
745 rev_horz_syn(atk, aug->line, child_res->pull_line(),
746 bands[1].pull_line(), width, horz_even);
747 else
748 memcpy(aug->line->p, child_res->pull_line()->p,
749 (size_t)width
750 * (aug->line->flags & line_buf::LFT_SIZE_MASK));
751 aug->active = true;
752 vert_even = !vert_even;
753 ++cur_line;
754 continue;
755 }
756 else {
757 if (transform_flags & HORZ_TRX)
758 rev_horz_syn(atk, sig->line, bands[2].pull_line(),
759 bands[3].pull_line(), width, horz_even);
760 else
761 memcpy(sig->line->p, bands[2].pull_line()->p,
762 (size_t)width
763 * (sig->line->flags & line_buf::LFT_SIZE_MASK));
764 sig->active = true;
765 vert_even = !vert_even;
766 ++cur_line;
767 }
768 }
769
770 //vertical transform
771 for (ui32 i = 0; i < num_steps; ++i)
772 {
773 if (aug->active && (sig->active || ssp[i].active))
774 {
775 line_buf* dp = aug->line;
776 line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
777 line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
778 const lifting_step* s = atk->get_step(i);
779 rev_vert_step(s, sp1, sp2, dp, width, true);
780 }
781 lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
782 }
783
784 if (aug->active) {
785 aug->active = false;
786 return aug->line;
787 }
788 if (sig->active) {
789 sig->active = false;
790 return sig->line;
791 };
792 }
793 }
794 else
795 {
796 if (vert_even) {
797 if (transform_flags & HORZ_TRX)
798 rev_horz_syn(atk, aug->line, child_res->pull_line(),
799 bands[1].pull_line(), width, horz_even);
800 else
801 memcpy(aug->line->p, child_res->pull_line()->p,
802 (size_t)width
803 * (aug->line->flags & line_buf::LFT_SIZE_MASK));
804 }
805 else
806 {
807 if (transform_flags & HORZ_TRX)
808 rev_horz_syn(atk, aug->line, bands[2].pull_line(),
809 bands[3].pull_line(), width, horz_even);
810 else
811 memcpy(aug->line->p, bands[2].pull_line()->p,
812 (size_t)width
813 * (aug->line->flags & line_buf::LFT_SIZE_MASK));
814 if (aug->line->flags & line_buf::LFT_32BIT)
815 {
816 si32* sp = aug->line->i32;
817 for (ui32 i = width; i > 0; --i)
818 *sp++ >>= 1;
819 }
820 else
821 {
822 assert(aug->line->flags & line_buf::LFT_64BIT);
823 si64* sp = aug->line->i64;
824 for (ui32 i = width; i > 0; --i)
825 *sp++ >>= 1;
826 }
827 }
828 return aug->line;
829 }
830 }
831 else
832 {
833 if (res_rect.siz.h > 1)
834 {
835 if (sig->active) {
836 sig->active = false;
837 return sig->line;
838 };
839 for (;;)
840 {
841 //horizontal transform
842 if (cur_line < res_rect.siz.h)
843 {
844 if (vert_even) { // even
845 if (transform_flags & HORZ_TRX)
846 irv_horz_syn(atk, aug->line, child_res->pull_line(),
847 bands[1].pull_line(), width, horz_even);
848 else
849 memcpy(aug->line->f32, child_res->pull_line()->f32,
850 width * sizeof(float));
851 aug->active = true;
852 vert_even = !vert_even;
853 ++cur_line;
854
855 const float K = atk->get_K();
856 irv_vert_times_K(K, aug->line, width);
857
858 continue;
859 }
860 else {
861 if (transform_flags & HORZ_TRX)
862 irv_horz_syn(atk, sig->line, bands[2].pull_line(),
863 bands[3].pull_line(), width, horz_even);
864 else
865 memcpy(sig->line->f32, bands[2].pull_line()->f32,
866 width * sizeof(float));
867 sig->active = true;
868 vert_even = !vert_even;
869 ++cur_line;
870
871 const float K_inv = 1.0f / atk->get_K();
872 irv_vert_times_K(K_inv, sig->line, width);
873 }
874 }
875
876 //vertical transform
877 for (ui32 i = 0; i < num_steps; ++i)
878 {
879 if (aug->active && (sig->active || ssp[i].active))
880 {
881 line_buf* dp = aug->line;
882 line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
883 line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
884 const lifting_step* s = atk->get_step(i);
885 irv_vert_step(s, sp1, sp2, dp, width, true);
886 }
887 lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
888 }
889
890 if (aug->active) {
891 aug->active = false;
892 return aug->line;
893 }
894 if (sig->active) {
895 sig->active = false;
896 return sig->line;
897 };
898 }
899 }
900 else
901 {
902 if (vert_even) {
903 if (transform_flags & HORZ_TRX)
904 irv_horz_syn(atk, aug->line, child_res->pull_line(),
905 bands[1].pull_line(), width, horz_even);
906 else
907 memcpy(aug->line->f32, child_res->pull_line()->f32,
908 width * sizeof(float));
909 }
910 else
911 {
912 if (transform_flags & HORZ_TRX)
913 irv_horz_syn(atk, aug->line, bands[2].pull_line(),
914 bands[3].pull_line(), width, horz_even);
915 else
916 memcpy(aug->line->f32, bands[2].pull_line()->f32,
917 width * sizeof(float));
918 float* sp = aug->line->f32;
919 for (ui32 i = width; i > 0; --i)
920 *sp++ *= 0.5f;
921 }
922 return aug->line;
923 }
924 }
925 }
926 else
927 {
928 if (reversible)
929 {
930 if (transform_flags & HORZ_TRX)
931 rev_horz_syn(atk, aug->line, child_res->pull_line(),
932 bands[1].pull_line(), width, horz_even);
933 else
934 memcpy(aug->line->p, child_res->pull_line()->p,
935 (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK));
936 return aug->line;
937 }
938 else
939 {
940 if (transform_flags & HORZ_TRX)
941 irv_horz_syn(atk, aug->line, child_res->pull_line(),
942 bands[1].pull_line(), width, horz_even);
943 else
944 memcpy(aug->line->f32, child_res->pull_line()->f32,
945 width * sizeof(float));
946 return aug->line;
947 }
948 }
949 }
950
952 ui32 resolution::prepare_precinct()
953 {
954 ui32 lower_resolutions_bytes = 0;
955 if (res_num != 0)
956 lower_resolutions_bytes = child_res->prepare_precinct();
957
958 this->num_bytes = 0;
959 si32 repeat = (si32)num_precincts.area();
960 for (si32 i = 0; i < repeat; ++i)
961 this->num_bytes += precincts[i].prepare_precinct(tag_tree_size,
962 level_index, elastic);
963 return this->num_bytes + lower_resolutions_bytes;
964 }
965
967 void resolution::write_precincts(outfile_base* file)
968 {
969 precinct* p = precincts;
970 for (si32 i = 0; i < (si32)num_precincts.area(); ++i)
971 p[i].write(file);
972 }
973
975 bool resolution::get_top_left_precinct(point& top_left)
976 {
977 ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
978 if (idx < num_precincts.area())
979 {
980 top_left = precincts[idx].img_point;
981 return true;
982 }
983 return false;
984 }
985
987 void resolution::write_one_precinct(outfile_base* file)
988 {
989 ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
990 assert(idx < num_precincts.area());
991 precincts[idx].write(file);
992
993 if (++cur_precinct_loc.x >= num_precincts.w)
994 {
995 cur_precinct_loc.x = 0;
996 ++cur_precinct_loc.y;
997 }
998 }
999
1001 void resolution::parse_all_precincts(ui32& data_left, infile_base* file)
1002 {
1003 precinct* p = precincts;
1004 ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
1005 for (ui32 i = idx; i < num_precincts.area(); ++i)
1006 {
1007 if (data_left == 0)
1008 break;
1009 p[i].parse(tag_tree_size, level_index, elastic, data_left, file,
1010 skipped_res_for_read);
1011 if (++cur_precinct_loc.x >= num_precincts.w)
1012 {
1013 cur_precinct_loc.x = 0;
1014 ++cur_precinct_loc.y;
1015 }
1016 }
1017 }
1018
1020 void resolution::parse_one_precinct(ui32& data_left, infile_base* file)
1021 {
1022 ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
1023 assert(idx < num_precincts.area());
1024
1025 if (data_left == 0)
1026 return;
1027 precinct* p = precincts + idx;
1028 p->parse(tag_tree_size, level_index, elastic, data_left, file,
1029 skipped_res_for_read);
1030 if (++cur_precinct_loc.x >= num_precincts.w)
1031 {
1032 cur_precinct_loc.x = 0;
1033 ++cur_precinct_loc.y;
1034 }
1035 }
1036
1038 ui32 resolution::get_num_bytes(ui32 resolution_num) const
1039 {
1040 if (this->res_num == resolution_num)
1041 return get_num_bytes();
1042 if (resolution_num < this->res_num) {
1043 assert(child_res);
1044 return child_res->get_num_bytes(resolution_num);
1045 }
1046 return 0;
1047 }
1048 }
1049}
ojph::infile_base
Definition ojph_file.h:247
ojph::line_buf
Definition ojph_mem.h:160
ojph::line_buf::LFT_SIZE_MASK
@ LFT_SIZE_MASK
Definition ojph_mem.h:171
ojph::line_buf::LFT_32BIT
@ LFT_32BIT
Definition ojph_mem.h:167
ojph::line_buf::LFT_64BIT
@ LFT_64BIT
Definition ojph_mem.h:168
ojph::local::codestream
Definition ojph_codestream_local.h:69
ojph::local::codestream::get_coc
const param_cod * get_coc(ui32 comp_num)
Definition ojph_codestream_local.h:89
ojph::local::codestream::get_elastic_alloc
mem_elastic_allocator * get_elastic_alloc()
Definition ojph_codestream_local.h:98
ojph::local::codestream::get_skipped_res_for_read
ui32 get_skipped_res_for_read()
Definition ojph_codestream_local.h:129
ojph::local::codestream::access_qcd
const param_qcd * access_qcd()
Definition ojph_codestream_local.h:91
ojph::local::codestream::get_allocator
mem_fixed_allocator * get_allocator()
Definition ojph_codestream_local.h:97
ojph::local::codestream::get_precinct_scratch
ui8 * get_precinct_scratch()
Definition ojph_codestream_local.h:126
ojph::local::codestream::access_dfs
const param_dfs * access_dfs()
Definition ojph_codestream_local.h:93
ojph::local::codestream::get_skipped_res_for_recon
ui32 get_skipped_res_for_recon()
Definition ojph_codestream_local.h:127
ojph::local::resolution
Definition ojph_resolution.h:62
ojph::local::resolution::get_top_left_precinct
bool get_top_left_precinct(point &top_left)
Definition ojph_resolution.cpp:975
ojph::local::resolution::sig
lifting_buf * sig
Definition ojph_resolution.h:109
ojph::local::resolution::rows_to_produce
ui32 rows_to_produce
Definition ojph_resolution.h:125
ojph::local::resolution::bands
subband * bands
Definition ojph_resolution.h:110
ojph::local::resolution::parse_one_precinct
void parse_one_precinct(ui32 &data_left, infile_base *file)
Definition ojph_resolution.cpp:1020
ojph::local::resolution::skipped_res_for_recon
bool skipped_res_for_recon
Definition ojph_resolution.h:99
ojph::local::resolution::tag_tree_size
int tag_tree_size
Definition ojph_resolution.h:118
ojph::local::resolution::push_line
void push_line()
Definition ojph_resolution.cpp:547
ojph::local::resolution::get_num_bytes
ui32 get_num_bytes() const
Definition ojph_resolution.h:95
ojph::local::resolution::atk
const param_atk * atk
Definition ojph_resolution.h:121
ojph::local::resolution::transform_flags
ui32 transform_flags
Definition ojph_resolution.h:122
ojph::local::resolution::elastic
mem_elastic_allocator * elastic
Definition ojph_resolution.h:127
ojph::local::resolution::comp_downsamp
point comp_downsamp
Definition ojph_resolution.h:105
ojph::local::resolution::parent_res
resolution * parent_res
Definition ojph_resolution.h:112
ojph::local::resolution::cur_precinct_loc
point cur_precinct_loc
Definition ojph_resolution.h:120
ojph::local::resolution::prepare_precinct
ui32 prepare_precinct()
Definition ojph_resolution.cpp:952
ojph::local::resolution::reversible
bool reversible
Definition ojph_resolution.h:99
ojph::local::resolution::write_precincts
void write_precincts(outfile_base *file)
Definition ojph_resolution.cpp:967
ojph::local::resolution::comp_num
ui32 comp_num
Definition ojph_resolution.h:102
ojph::local::resolution::res_rect
rect res_rect
Definition ojph_resolution.h:106
ojph::local::resolution::num_steps
ui32 num_steps
Definition ojph_resolution.h:100
ojph::local::resolution::precincts
precinct * precincts
Definition ojph_resolution.h:114
ojph::local::resolution::parent_comp
tile_comp * parent_comp
Definition ojph_resolution.h:111
ojph::local::resolution::pull_line
line_buf * pull_line()
Definition ojph_resolution.cpp:713
ojph::local::resolution::get_line
line_buf * get_line()
Definition ojph_resolution.cpp:530
ojph::local::resolution::HORZ_TRX
@ HORZ_TRX
Definition ojph_resolution.h:65
ojph::local::resolution::VERT_TRX
@ VERT_TRX
Definition ojph_resolution.h:66
ojph::local::resolution::num_precincts
size num_precincts
Definition ojph_resolution.h:115
ojph::local::resolution::pre_alloc
static void pre_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 comp_num, ui32 res_num)
Definition ojph_resolution.cpp:59
ojph::local::resolution::skipped_res_for_read
bool skipped_res_for_read
Definition ojph_resolution.h:99
ojph::local::resolution::finalize_alloc
void finalize_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 comp_num, ui32 res_num, point comp_downsamp, point res_downsamp, tile_comp *parent_tile_comp, resolution *parent_res)
Definition ojph_resolution.cpp:240
ojph::local::resolution::level_index
ui32 level_index[20]
Definition ojph_resolution.h:119
ojph::local::resolution::lines
line_buf * lines
Definition ojph_resolution.h:107
ojph::local::resolution::log_PP
size log_PP
Definition ojph_resolution.h:116
ojph::local::resolution::aug
lifting_buf * aug
Definition ojph_resolution.h:109
ojph::local::resolution::horz_even
bool horz_even
Definition ojph_resolution.h:126
ojph::local::resolution::parse_all_precincts
void parse_all_precincts(ui32 &data_left, infile_base *file)
Definition ojph_resolution.cpp:1001
ojph::local::resolution::res_num
ui32 res_num
Definition ojph_resolution.h:101
ojph::local::resolution::write_one_precinct
void write_one_precinct(outfile_base *file)
Definition ojph_resolution.cpp:987
ojph::local::resolution::max_num_levels
ui32 max_num_levels
Definition ojph_resolution.h:117
ojph::local::resolution::vert_even
bool vert_even
Definition ojph_resolution.h:126
ojph::local::resolution::cur_line
ui32 cur_line
Definition ojph_resolution.h:124
ojph::local::resolution::num_bytes
ui32 num_bytes
Definition ojph_resolution.h:103
ojph::local::resolution::ssp
lifting_buf * ssp
Definition ojph_resolution.h:108
ojph::local::resolution::child_res
resolution * child_res
Definition ojph_resolution.h:112
ojph::local::subband
Definition ojph_subband.h:63
ojph::local::subband::pre_alloc
static void pre_alloc(codestream *codestream, const rect &band_rect, ui32 comp_num, ui32 res_num, ui32 transform_flags)
Definition ojph_subband.cpp:57
ojph::local::tile_comp
Definition ojph_tile_comp.h:63
ojph::local::tile_comp::get_tile
tile * get_tile()
Definition ojph_tile_comp.h:74
ojph::local::tile::get_tile_rect
rect get_tile_rect()
Definition ojph_tile.h:75
ojph::mem_fixed_allocator
Definition ojph_mem.h:58
ojph::mem_fixed_allocator::pre_alloc_data
void pre_alloc_data(size_t num_ele, ui32 pre_size)
Definition ojph_mem.h:71
ojph::mem_fixed_allocator::pre_alloc_obj
void pre_alloc_obj(size_t num_ele)
Definition ojph_mem.h:77
ojph::mem_fixed_allocator::post_alloc_data
T * post_alloc_data(size_t num_ele, ui32 pre_size)
Definition ojph_mem.h:111
ojph::mem_fixed_allocator::post_alloc_obj
T * post_alloc_obj(size_t num_ele)
Definition ojph_mem.h:118
ojph::outfile_base
Definition ojph_file.h:75
ojph::local
Definition ojph_bitbuffer_read.h:52
ojph::local::rev_horz_ana
void(* rev_horz_ana)(const param_atk *atk, const line_buf *ldst, const line_buf *hdst, const line_buf *src, ui32 width, bool even)
Definition ojph_transform.cpp:65
ojph::local::irv_vert_times_K
void(* irv_vert_times_K)(float K, const line_buf *aug, ui32 repeat)
Definition ojph_transform.cpp:84
ojph::local::irv_vert_step
void(* irv_vert_step)(const lifting_step *s, const line_buf *sig, const line_buf *other, const line_buf *aug, ui32 repeat, bool synthesis)
Definition ojph_transform.cpp:79
ojph::local::rev_horz_syn
void(* rev_horz_syn)(const param_atk *atk, const line_buf *dst, const line_buf *lsrc, const line_buf *hsrc, ui32 width, bool even)
Definition ojph_transform.cpp:70
ojph::local::irv_horz_ana
void(* irv_horz_ana)(const param_atk *atk, const line_buf *ldst, const line_buf *hdst, const line_buf *src, ui32 width, bool even)
Definition ojph_transform.cpp:88
ojph::local::rev_vert_step
void(* rev_vert_step)(const lifting_step *s, const line_buf *sig, const line_buf *other, const line_buf *aug, ui32 repeat, bool synthesis)
Definition ojph_transform.cpp:60
ojph::local::irv_horz_syn
void(* irv_horz_syn)(const param_atk *atk, const line_buf *dst, const line_buf *lsrc, const line_buf *hsrc, ui32 width, bool even)
Definition ojph_transform.cpp:93
ojph
Definition ojph_img_io.h:52
ojph::si64
int64_t si64
Definition ojph_defs.h:57
ojph::ui64
uint64_t ui64
Definition ojph_defs.h:56
ojph::ui16
uint16_t ui16
Definition ojph_defs.h:52
ojph::si32
int32_t si32
Definition ojph_defs.h:55
ojph::ui32
uint32_t ui32
Definition ojph_defs.h:54
ojph_codestream_local.h
ojph_max
#define ojph_max(a, b)
Definition ojph_defs.h:73
ojph_min
#define ojph_min(a, b)
Definition ojph_defs.h:76
ojph_mem.h
OJPH_ERROR
#define OJPH_ERROR(t,...)
Definition ojph_message.h:288
ojph_params.h
ojph_precinct.h
ojph_resolution.h
ojph_subband.h
ojph_tile.h
ojph_tile_comp.h
ojph_transform.h
ojph::lifting_buf
Definition ojph_mem.h:193
ojph::local::param_atk
Definition ojph_params_local.h:1071
ojph::local::param_cod
Definition ojph_params_local.h:371
ojph::local::param_cod::get_log_block_dims
size get_log_block_dims() const
Definition ojph_params_local.h:512
ojph::local::param_cod::get_dfs_index
ui16 get_dfs_index() const
Definition ojph_params_local.h:600
ojph::local::param_cod::access_atk
const param_atk * access_atk() const
Definition ojph_params_local.h:592
ojph::local::param_cod::get_log_precinct_size
size get_log_precinct_size(ui32 res_num) const
Definition ojph_params_local.h:539
ojph::local::param_cod::is_dfs_defined
bool is_dfs_defined() const
Definition ojph_params_local.h:596
ojph::local::param_cod::packets_use_eph
bool packets_use_eph() const
Definition ojph_params_local.h:556
ojph::local::param_cod::get_num_decompositions
ui8 get_num_decompositions() const
Definition ojph_params_local.h:490
ojph::local::param_cod::packets_may_use_sop
bool packets_may_use_sop() const
Definition ojph_params_local.h:548
ojph::local::param_dfs
Definition ojph_params_local.h:979
ojph::local::param_dfs::get_dwt_type
dfs_dwt_type get_dwt_type(ui32 decomp_level) const
Definition ojph_params.cpp:2235
ojph::local::param_dfs::dfs_dwt_type
dfs_dwt_type
Definition ojph_params_local.h:981
ojph::local::param_dfs::HORZ_DWT
@ HORZ_DWT
Definition ojph_params_local.h:984
ojph::local::param_dfs::BIDIR_DWT
@ BIDIR_DWT
Definition ojph_params_local.h:983
ojph::local::param_dfs::VERT_DWT
@ VERT_DWT
Definition ojph_params_local.h:985
ojph::local::param_dfs::NO_DWT
@ NO_DWT
Definition ojph_params_local.h:982
ojph::local::param_dfs::get_dfs
const param_dfs * get_dfs(int index) const
Definition ojph_params.cpp:2226
ojph::local::param_qcd
Definition ojph_params_local.h:663
ojph::local::param_qcd::propose_precision
ui32 propose_precision(const param_cod *cod) const
Definition ojph_params.cpp:1433
ojph::local::param_qcd::get_qcc
param_qcd * get_qcc(ui32 comp_idx)
Definition ojph_params.cpp:1746
ojph::local::precinct
Definition ojph_precinct.h:59
ojph::local::precinct::may_use_sop
bool may_use_sop
Definition ojph_precinct.h:76
ojph::local::precinct::coded
coded_lists * coded
Definition ojph_precinct.h:75
ojph::local::precinct::bands
subband * bands
Definition ojph_precinct.h:74
ojph::local::precinct::scratch
ui8 * scratch
Definition ojph_precinct.h:71
ojph::local::precinct::parse
void parse(int tag_tree_size, ui32 *lev_idx, mem_elastic_allocator *elastic, ui32 &data_left, infile_base *file, bool skipped)
Definition ojph_precinct.cpp:328
ojph::local::precinct::img_point
point img_point
Definition ojph_precinct.h:72
ojph::local::precinct::uses_eph
bool uses_eph
Definition ojph_precinct.h:76
ojph::point
Definition ojph_base.h:58
ojph::point::y
ui32 y
Definition ojph_base.h:60
ojph::point::x
ui32 x
Definition ojph_base.h:60
ojph::rect
Definition ojph_base.h:65
ojph::rect::siz
size siz
Definition ojph_base.h:67
ojph::rect::org
point org
Definition ojph_base.h:66
ojph::size
Definition ojph_base.h:48
ojph::size::w
ui32 w
Definition ojph_base.h:50
ojph::size::h
ui32 h
Definition ojph_base.h:51
ojph::local::lifting_step
Definition ojph_params_local.h:1051