| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/Compression.pd! Do not modify! |
| 5 |
|
| */ |
| 6 |
|
| |
| 7 |
|
| #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \ |
| 8 |
|
| if (destroy) { \ |
| 9 |
|
| comp_free_code \ |
| 10 |
|
| } \ |
| 11 |
|
| if ((trans)->dims_redone) { \ |
| 12 |
|
| ntpriv_free_code \ |
| 13 |
|
| } |
| 14 |
|
| |
| 15 |
|
| #include "EXTERN.h" |
| 16 |
|
| #include "perl.h" |
| 17 |
|
| #include "XSUB.h" |
| 18 |
|
| #include "pdl.h" |
| 19 |
|
| #include "pdlcore.h" |
| 20 |
|
| #define PDL PDL_Compression |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/Compression-pp-rice_compress.c" |
| 23 |
|
| #include "ricecomp.h" |
| 24 |
|
| |
| 25 |
|
| |
| 26 |
|
| |
| 27 |
|
| #line 1877 "lib/PDL/PP.pm" |
| 28 |
|
| typedef struct pdl_params_rice_compress { |
| 29 |
|
| #line 30 "lib/PDL/Compression-pp-rice_compress.c" |
| 30 |
|
| int blocksize; |
| 31 |
|
| } pdl_params_rice_compress; |
| 32 |
|
| |
| 33 |
|
| |
| 34 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 35 |
|
| pdl_error pdl_rice_compress_redodims(pdl_trans *__privtrans) { |
| 36 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 37 |
|
| #line 38 "lib/PDL/Compression-pp-rice_compress.c" |
| 38 |
4 |
| pdl_params_rice_compress *__params = __privtrans->params; (void)__params; |
| 39 |
4 |
| __privtrans->ind_sizes[0] = ceil(__privtrans->ind_sizes[1] * 1.01); |
| 40 |
4 |
▶ | PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
0 |
4 |
4 |
|
| 41 |
4 |
| return PDL_err; |
| 42 |
|
| } |
| 43 |
|
| |
| 44 |
|
| |
| 45 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 46 |
|
| pdl_error pdl_rice_compress_readdata(pdl_trans *__privtrans) { |
| 47 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 48 |
|
| #line 49 "lib/PDL/Compression-pp-rice_compress.c" |
| 49 |
4 |
| pdl_params_rice_compress *__params = __privtrans->params; (void)__params; |
| 50 |
4 |
▶ | if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "broadcast.incs NULL"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "broadcast.incs NULL"); |
0 |
4 |
4 |
|
| 51 |
|
| /* broadcastloop declarations */ |
| 52 |
|
| int __brcloopval; |
| 53 |
|
| register PDL_Indx __tind0,__tind1; /* counters along dim */ |
| 54 |
4 |
| register PDL_Indx __tnpdls = __privtrans->broadcast.npdls; |
| 55 |
|
| /* dims here are how many steps along those dims */ |
| 56 |
4 |
| register PDL_Indx __tinc0_in = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0); |
| 57 |
4 |
| register PDL_Indx __tinc0_out = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0); |
| 58 |
4 |
| register PDL_Indx __tinc0_len = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0); |
| 59 |
4 |
| register PDL_Indx __tinc1_in = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1); |
| 60 |
4 |
| register PDL_Indx __tinc1_out = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1); |
| 61 |
4 |
| register PDL_Indx __tinc1_len = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1); |
| 62 |
|
| #define PDL_BROADCASTLOOP_START_rice_compress_readdata PDL_BROADCASTLOOP_START( \ |
| 63 |
|
| readdata, \ |
| 64 |
|
| __privtrans->broadcast, \ |
| 65 |
|
| __privtrans->vtable, \ |
| 66 |
|
| in_datap += __offsp[0]; \ |
| 67 |
|
| out_datap += __offsp[1]; \ |
| 68 |
|
| len_datap += __offsp[2]; \ |
| 69 |
|
| , \ |
| 70 |
|
| ( ,in_datap += __tinc1_in - __tinc0_in * __tdims0 \ |
| 71 |
|
| ,out_datap += __tinc1_out - __tinc0_out * __tdims0 \ |
| 72 |
|
| ,len_datap += __tinc1_len - __tinc0_len * __tdims0 \ |
| 73 |
|
| ), \ |
| 74 |
|
| ( ,in_datap += __tinc0_in \ |
| 75 |
|
| ,out_datap += __tinc0_out \ |
| 76 |
|
| ,len_datap += __tinc0_len \ |
| 77 |
|
| ) \ |
| 78 |
|
| ) |
| 79 |
|
| #define PDL_BROADCASTLOOP_END_rice_compress_readdata PDL_BROADCASTLOOP_END( \ |
| 80 |
|
| __privtrans->broadcast, \ |
| 81 |
|
| in_datap -= __tinc1_in * __tdims1 + __offsp[0]; \ |
| 82 |
|
| out_datap -= __tinc1_out * __tdims1 + __offsp[1]; \ |
| 83 |
|
| len_datap -= __tinc1_len * __tdims1 + __offsp[2]; \ |
| 84 |
|
| ) |
| 85 |
4 |
| register PDL_Indx __inc_in_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_in_n; |
| 86 |
4 |
| register PDL_Indx __inc_out_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_out_m; |
| 87 |
|
| #ifndef PDL_DECLARE_PARAMS_rice_compress_1 |
| 88 |
|
| #define PDL_DECLARE_PARAMS_rice_compress_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_len,PDL_PPSYM_PARAM_len) \ |
| 89 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, in, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \ |
| 90 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, out, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \ |
| 91 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_len, len, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_len) |
| 92 |
|
| #endif |
| 93 |
|
| #define PDL_IF_BAD(t,f) f |
| 94 |
4 |
| switch (__privtrans->__datatype) { /* Start generic switch */ |
| 95 |
1 |
| case PDL_B: { |
| 96 |
1 |
▶ | PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
Branch: 9 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Byte,B,PDL_Indx,N) |
0 |
1 |
1 |
|
| 97 |
4 |
▶ | PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
1 |
1 |
2 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
1 |
1 |
2 |
|
| 98 |
2 |
| (len_datap)[0] = fits_rcomp_byte(&err, (void *)in_datap, |
| 99 |
1 |
| __privtrans->ind_sizes[1], |
| 100 |
|
| (void *)out_datap, |
| 101 |
1 |
| __privtrans->ind_sizes[0] * sizeof(PDL_Byte), |
| 102 |
|
| __params->blocksize |
| 103 |
|
| ); |
| 104 |
1 |
▶ | if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
Branch: 1 branch
| Branch | True | False | Total |
| if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
0 |
1 |
1 |
|
| 105 |
1 |
▶ | }PDL_BROADCASTLOOP_END_rice_compress_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
1 |
1 |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
1 |
1 |
|
| 106 |
1 |
| } break; |
| 107 |
0 |
| case PDL_S: { |
| 108 |
0 |
▶ | PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
Branch: 9 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Short,S,PDL_Indx,N) |
0 |
0 |
0 |
|
| 109 |
0 |
▶ | PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
|
| 110 |
0 |
| (len_datap)[0] = fits_rcomp_short(&err, (void *)in_datap, |
| 111 |
0 |
| __privtrans->ind_sizes[1], |
| 112 |
|
| (void *)out_datap, |
| 113 |
0 |
| __privtrans->ind_sizes[0] * sizeof(PDL_Short), |
| 114 |
|
| __params->blocksize |
| 115 |
|
| ); |
| 116 |
0 |
▶ | if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
Branch: 1 branch
| Branch | True | False | Total |
| if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
0 |
0 |
0 |
|
| 117 |
0 |
▶ | }PDL_BROADCASTLOOP_END_rice_compress_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
0 |
0 |
|
| 118 |
0 |
| } break; |
| 119 |
0 |
| case PDL_US: { |
| 120 |
0 |
▶ | PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
Branch: 9 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Ushort,U,PDL_Indx,N) |
0 |
0 |
0 |
|
| 121 |
0 |
▶ | PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
0 |
0 |
|
| 122 |
0 |
| (len_datap)[0] = fits_rcomp_short(&err, (void *)in_datap, |
| 123 |
0 |
| __privtrans->ind_sizes[1], |
| 124 |
|
| (void *)out_datap, |
| 125 |
0 |
| __privtrans->ind_sizes[0] * sizeof(PDL_Ushort), |
| 126 |
|
| __params->blocksize |
| 127 |
|
| ); |
| 128 |
0 |
▶ | if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
Branch: 1 branch
| Branch | True | False | Total |
| if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
0 |
0 |
0 |
|
| 129 |
0 |
▶ | }PDL_BROADCASTLOOP_END_rice_compress_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
0 |
0 |
|
| 130 |
0 |
| } break; |
| 131 |
3 |
| case PDL_L: { |
| 132 |
3 |
▶ | PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
Branch: 9 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
3 |
0 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
3 |
0 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
3 |
0 |
3 |
| PDL_DECLARE_PARAMS_rice_compress_1(PDL_Long,L,PDL_Indx,N) |
0 |
3 |
3 |
|
| 133 |
1929 |
▶ | PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
3 |
3 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
3 |
3 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
3 |
3 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
3 |
3 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
0 |
3 |
3 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
1920 |
3 |
1923 |
| PDL_BROADCASTLOOP_START_rice_compress_readdata {char *err = "error message not updated"; |
3 |
3 |
6 |
|
| 134 |
3840 |
| (len_datap)[0] = fits_rcomp(&err, (void *)in_datap, |
| 135 |
1920 |
| __privtrans->ind_sizes[1], |
| 136 |
|
| (void *)out_datap, |
| 137 |
1920 |
| __privtrans->ind_sizes[0] * sizeof(PDL_Long), |
| 138 |
|
| __params->blocksize |
| 139 |
|
| ); |
| 140 |
1920 |
▶ | if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
Branch: 1 branch
| Branch | True | False | Total |
| if (err) return PDL->make_error(PDL_EUSERERROR, "Error in rice_compress:" "%s",err); |
0 |
1920 |
1920 |
|
| 141 |
3 |
▶ | }PDL_BROADCASTLOOP_END_rice_compress_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
3 |
3 |
| }PDL_BROADCASTLOOP_END_rice_compress_readdata |
0 |
3 |
3 |
|
| 142 |
3 |
| } break; |
| 143 |
0 |
| default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in rice_compress: unhandled datatype(%d), only handles (BSUL)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
| 144 |
|
| } |
| 145 |
|
| #undef PDL_IF_BAD |
| 146 |
4 |
| return PDL_err; |
| 147 |
|
| } |
| 148 |
|
| |
| 149 |
|
| static pdl_datatypes pdl_rice_compress_vtable_gentypes[] = { PDL_B, PDL_S, PDL_US, PDL_L, -1 }; |
| 150 |
|
| static PDL_Indx pdl_rice_compress_vtable_realdims[] = { 1, 1, 0 }; |
| 151 |
|
| static char *pdl_rice_compress_vtable_parnames[] = { "in","out","len" }; |
| 152 |
|
| static short pdl_rice_compress_vtable_parflags[] = { |
| 153 |
|
| PDL_PARAM_ISPHYS, |
| 154 |
|
| PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISPHYS|PDL_PARAM_ISWRITE, |
| 155 |
|
| PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE |
| 156 |
|
| }; |
| 157 |
|
| static pdl_datatypes pdl_rice_compress_vtable_partypes[] = { -1, -1, PDL_IND }; |
| 158 |
|
| static PDL_Indx pdl_rice_compress_vtable_realdims_starts[] = { 0, 1, 2 }; |
| 159 |
|
| static PDL_Indx pdl_rice_compress_vtable_realdims_ind_ids[] = { 1, 0 }; |
| 160 |
|
| static char *pdl_rice_compress_vtable_indnames[] = { "m","n" }; |
| 161 |
|
| pdl_transvtable pdl_rice_compress_vtable = { |
| 162 |
|
| PDL_TRANS_DO_BROADCAST|PDL_TRANS_BADIGNORE, 0, pdl_rice_compress_vtable_gentypes, 1, 3, NULL /*CORE21*/, |
| 163 |
|
| pdl_rice_compress_vtable_realdims, pdl_rice_compress_vtable_parnames, |
| 164 |
|
| pdl_rice_compress_vtable_parflags, pdl_rice_compress_vtable_partypes, |
| 165 |
|
| pdl_rice_compress_vtable_realdims_starts, pdl_rice_compress_vtable_realdims_ind_ids, 2, |
| 166 |
|
| 2, pdl_rice_compress_vtable_indnames, |
| 167 |
|
| pdl_rice_compress_redodims, pdl_rice_compress_readdata, NULL, |
| 168 |
|
| NULL, |
| 169 |
|
| sizeof(pdl_params_rice_compress),"PDL::Compression::rice_compress" |
| 170 |
|
| }; |
| 171 |
|
| |
| 172 |
|
| |
| 173 |
4 |
| pdl_error pdl_run_rice_compress(pdl *in,pdl *out,pdl *len,int blocksize) { |
| 174 |
4 |
| pdl_error PDL_err = {0, NULL, 0}; |
| 175 |
4 |
▶ | if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
0 |
4 |
4 |
|
| 176 |
4 |
| pdl_trans *__privtrans = PDL->create_trans(&pdl_rice_compress_vtable); |
| 177 |
4 |
▶ | if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
0 |
4 |
4 |
|
| 178 |
4 |
| pdl_params_rice_compress *__params = __privtrans->params; |
| 179 |
4 |
| __privtrans->pdls[0] = in; |
| 180 |
4 |
| __privtrans->pdls[1] = out; |
| 181 |
4 |
| __privtrans->pdls[2] = len; |
| 182 |
4 |
▶ | PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
0 |
4 |
4 |
|
| 183 |
4 |
| (__params->blocksize) = (blocksize); /* CType.get_copy */ |
| 184 |
4 |
▶ | PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
0 |
4 |
4 |
|
| 185 |
4 |
| return PDL_err; |
| 186 |
|
| } |