@@ -207,20 +207,31 @@ namespace ojph {
207207
208208 const param_qcd* qp = codestream->access_qcd ()->get_qcc (comp_num);
209209 ui32 precision = qp->propose_precision (cdp);
210+ const param_atk* atk = cdp->access_atk ();
211+ bool reversible = atk->is_reversible ();
210212
211213 ui32 width = res_rect.siz .w + 1 ;
212- if (precision <= 32 ) {
213- for (ui32 i = 0 ; i < num_steps; ++i)
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 );
214219 allocator->pre_alloc_data <si32>(width, 1 );
215- allocator->pre_alloc_data <si32>(width, 1 );
216- 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+ }
217229 }
218- else
219- {
230+ else {
220231 for (ui32 i = 0 ; i < num_steps; ++i)
221- allocator->pre_alloc_data <si64 >(width, 1 );
222- allocator->pre_alloc_data <si64 >(width, 1 );
223- allocator->pre_alloc_data <si64 >(width, 1 );
232+ allocator->pre_alloc_data <float >(width, 1 );
233+ allocator->pre_alloc_data <float >(width, 1 );
234+ allocator->pre_alloc_data <float >(width, 1 );
224235 }
225236 }
226237 }
@@ -474,21 +485,38 @@ namespace ojph {
474485
475486 // initiate storage of line_buf
476487 ui32 width = res_rect.siz .w + 1 ;
477- if (precision <= 32 )
488+ if (this -> reversible )
478489 {
479- for (ui32 i = 0 ; i < num_steps; ++i)
480- ssp[i].line ->wrap (
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 (
481496 allocator->post_alloc_data <si32>(width, 1 ), width, 1 );
482- sig->line ->wrap (allocator->post_alloc_data <si32>(width, 1 ), width, 1 );
483- aug->line ->wrap (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+ }
484510 }
485- else
511+ else
486512 {
487- for (ui32 i = 0 ; i < num_steps; ++i)
488- ssp[i].line ->wrap (
489- allocator->post_alloc_data <si64>(width, 1 ), width, 1 );
490- sig->line ->wrap (allocator->post_alloc_data <si64>(width, 1 ), width, 1 );
491- aug->line ->wrap (allocator->post_alloc_data <si64>(width, 1 ), width, 1 );
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 );
492520 }
493521
494522 cur_line = 0 ;
0 commit comments