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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 } | 802 } |
802 a = 0; | 803 a = 0; |
803 b = 1; | 804 b = 1; |
804 }else{ | 805 }else{ |
805 if(!((dwt->sn > 0) || (dwt->dn > 1))) { | 806 if(!((dwt->sn > 0) || (dwt->dn > 1))) { |
806 return; | 807 return; |
807 } | 808 } |
808 a = 1; | 809 a = 1; |
809 b = 0; | 810 b = 0; |
810 } | 811 } |
811 | |
812 #ifdef __SSE__ | 812 #ifdef __SSE__ |
813 opj_v4dwt_decode_step1_sse(dwt->wavelet+a, dwt->sn, _mm_set1_ps(opj_K)); | 813 opj_v4dwt_decode_step1_sse(dwt->wavelet+a, dwt->sn, _mm_set1_ps(opj_K)); |
814 opj_v4dwt_decode_step1_sse(dwt->wavelet+b, dwt->dn, _mm_set1_ps(opj_c133
18)); | 814 opj_v4dwt_decode_step1_sse(dwt->wavelet+b, dwt->dn, _mm_set1_ps(opj_c133
18)); |
815 opj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, op
j_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_delta)); | 815 opj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, op
j_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_delta)); |
816 opj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, op
j_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_gamma)); | 816 opj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, op
j_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_gamma)); |
817 opj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, op
j_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_beta)); | 817 opj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, op
j_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_beta)); |
818 opj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, op
j_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_alpha)); | 818 opj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, op
j_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_alpha)); |
819 #else | 819 #else |
820 opj_v4dwt_decode_step1(dwt->wavelet+a, dwt->sn, opj_K); | 820 opj_v4dwt_decode_step1(dwt->wavelet+a, dwt->sn, opj_K); |
821 opj_v4dwt_decode_step1(dwt->wavelet+b, dwt->dn, opj_c13318); | 821 opj_v4dwt_decode_step1(dwt->wavelet+b, dwt->dn, opj_c13318); |
(...skipping 14 matching lines...) Expand all Loading... |
836 opj_v4dwt_t v; | 836 opj_v4dwt_t v; |
837 | 837 |
838 opj_tcd_resolution_t* res = tilec->resolutions; | 838 opj_tcd_resolution_t* res = tilec->resolutions; |
839 | 839 |
840 OPJ_UINT32 rw = (OPJ_UINT32)(res->x1 - res->x0); /* width of the
resolution level computed */ | 840 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 */ | 841 OPJ_UINT32 rh = (OPJ_UINT32)(res->y1 - res->y0); /* height of the
resolution level computed */ |
842 | 842 |
843 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); | 843 OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); |
844 | 844 |
845 h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res,
numres)+5) * sizeof(opj_v4_t)); | 845 h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res,
numres)+5) * sizeof(opj_v4_t)); |
| 846 if (!h.wavelet) { |
| 847 /* FIXME event manager error callback */ |
| 848 return OPJ_FALSE; |
| 849 } |
846 v.wavelet = h.wavelet; | 850 v.wavelet = h.wavelet; |
847 | 851 |
848 while( --numres) { | 852 while( --numres) { |
849 OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data; | 853 OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data; |
850 OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (til
ec->y1 - tilec->y0)); | 854 OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (til
ec->y1 - tilec->y0)); |
851 OPJ_INT32 j; | 855 OPJ_INT32 j; |
852 | 856 |
853 h.sn = (OPJ_INT32)rw; | 857 h.sn = (OPJ_INT32)rw; |
854 v.sn = (OPJ_INT32)rh; | 858 v.sn = (OPJ_INT32)rh; |
855 | 859 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 | 921 |
918 for(k = 0; k < rh; ++k){ | 922 for(k = 0; k < rh; ++k){ |
919 memcpy(&aj[k*w], &v.wavelet[k], (size_t)j * size
of(OPJ_FLOAT32)); | 923 memcpy(&aj[k*w], &v.wavelet[k], (size_t)j * size
of(OPJ_FLOAT32)); |
920 } | 924 } |
921 } | 925 } |
922 } | 926 } |
923 | 927 |
924 opj_aligned_free(h.wavelet); | 928 opj_aligned_free(h.wavelet); |
925 return OPJ_TRUE; | 929 return OPJ_TRUE; |
926 } | 930 } |
OLD | NEW |