initialisation of model */ n number of symbols in that model */ compress set to 1 on compression, 0 on decompression */ targetrescale desired rescaling interval, should be < 1<<(lg_totf+1) */ lg_totf base2 log of total frequency count */
| 56 | /* targetrescale desired rescaling interval, should be < 1<<(lg_totf+1) */ |
| 57 | /* lg_totf base2 log of total frequency count */ |
| 58 | RangeModel::RangeModel(U32 n, BOOL compress, I32 targetrescale, I32 lg_totf) |
| 59 | { |
| 60 | this->n = n; |
| 61 | this->targetrescale = targetrescale; |
| 62 | this->lg_totf = lg_totf; |
| 63 | cf = new U16[n+1]; |
| 64 | newf = new U16[n+1]; |
| 65 | if (lg_totf == 16) |
| 66 | { |
| 67 | cf[n] = 65535; |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | cf[n] = (1<<lg_totf); |
| 72 | } |
| 73 | cf[0] = 0; |
| 74 | if (compress) |
| 75 | { |
| 76 | search = NULL; |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | searchshift = lg_totf - TBLSHIFT; |
| 81 | search = new U16[(1<<TBLSHIFT)+1]; |
| 82 | search[1<<TBLSHIFT] = n-1; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /* deletion */ |
| 87 | RangeModel::~RangeModel() |
nothing calls this directly
no outgoing calls
no test coverage detected