OLD | NEW |
1 /* | 1 /* |
2 * The copyright in this software is being made available under the 2-clauses | 2 * The copyright in this software is being made available under the 2-clauses |
3 * BSD License, included below. This software may be subject to other third | 3 * BSD License, included below. This software may be subject to other third |
4 * party and contributor rights, including patent rights, and no such rights | 4 * party and contributor rights, including patent rights, and no such rights |
5 * are granted under this license. | 5 * are granted under this license. |
6 * | 6 * |
7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium | 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
8 * Copyright (c) 2002-2014, Professor Benoit Macq | 8 * Copyright (c) 2002-2014, Professor Benoit Macq |
9 * Copyright (c) 2001-2003, David Janssens | 9 * Copyright (c) 2001-2003, David Janssens |
10 * Copyright (c) 2002-2003, Yannick Verschueren | 10 * Copyright (c) 2002-2003, Yannick Verschueren |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 opj_tcd_resolution_t* tr = tilec->resolutions; | 564 opj_tcd_resolution_t* tr = tilec->resolutions; |
565 | 565 |
566 OPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 - tr->x0); /* width of the resoluti
on level computed */ | 566 OPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 - tr->x0); /* width of the resoluti
on level computed */ |
567 OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0); /* height of the resolut
ion level computed */ | 567 OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0); /* height of the resolut
ion level computed */ |
568 | 568 |
569 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); | 569 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); |
570 | 570 |
571 h.mem = (OPJ_INT32*) | 571 h.mem = (OPJ_INT32*) |
572 opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32
)); | 572 opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32
)); |
573 if (! h.mem){ | 573 if (! h.mem){ |
| 574 /* FIXME event manager error callback */ |
574 return OPJ_FALSE; | 575 return OPJ_FALSE; |
575 } | 576 } |
576 | 577 |
577 v.mem = h.mem; | 578 v.mem = h.mem; |
578 | 579 |
579 while( --numres) { | 580 while( --numres) { |
580 OPJ_INT32 * restrict tiledp = tilec->data; | 581 OPJ_INT32 * restrict tiledp = tilec->data; |
581 OPJ_UINT32 j; | 582 OPJ_UINT32 j; |
582 | 583 |
583 ++tr; | 584 ++tr; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 opj_v4dwt_t v; | 837 opj_v4dwt_t v; |
837 | 838 |
838 opj_tcd_resolution_t* res = tilec->resolutions; | 839 opj_tcd_resolution_t* res = tilec->resolutions; |
839 | 840 |
840 OPJ_UINT32 rw = (OPJ_UINT32)(res->x1 - res->x0); /* width of the
resolution level computed */ | 841 OPJ_UINT32 rw = (OPJ_UINT32)(res->x1 - res->x0); /* width of the
resolution level computed */ |
841 OPJ_UINT32 rh = (OPJ_UINT32)(res->y1 - res->y0); /* height of the
resolution level computed */ | 842 OPJ_UINT32 rh = (OPJ_UINT32)(res->y1 - res->y0); /* height of the
resolution level computed */ |
842 | 843 |
843 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); | 844 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); |
844 | 845 |
845 h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res,
numres)+5) * sizeof(opj_v4_t)); | 846 h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res,
numres)+5) * sizeof(opj_v4_t)); |
| 847 if (!h.wavelet) { |
| 848 /* FIXME event manager error callback */ |
| 849 return OPJ_FALSE; |
| 850 } |
846 v.wavelet = h.wavelet; | 851 v.wavelet = h.wavelet; |
847 | 852 |
848 while( --numres) { | 853 while( --numres) { |
849 OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data; | 854 OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data; |
850 OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (til
ec->y1 - tilec->y0)); | 855 OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (til
ec->y1 - tilec->y0)); |
851 OPJ_INT32 j; | 856 OPJ_INT32 j; |
852 | 857 |
853 h.sn = (OPJ_INT32)rw; | 858 h.sn = (OPJ_INT32)rw; |
854 v.sn = (OPJ_INT32)rh; | 859 v.sn = (OPJ_INT32)rh; |
855 | 860 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 | 922 |
918 for(k = 0; k < rh; ++k){ | 923 for(k = 0; k < rh; ++k){ |
919 memcpy(&aj[k*w], &v.wavelet[k], (size_t)j * size
of(OPJ_FLOAT32)); | 924 memcpy(&aj[k*w], &v.wavelet[k], (size_t)j * size
of(OPJ_FLOAT32)); |
920 } | 925 } |
921 } | 926 } |
922 } | 927 } |
923 | 928 |
924 opj_aligned_free(h.wavelet); | 929 opj_aligned_free(h.wavelet); |
925 return OPJ_TRUE; | 930 return OPJ_TRUE; |
926 } | 931 } |
OLD | NEW |