Lines Matching refs:entropy
334 prediction ability is calculated as Shannon entropy. Here we need
335 Shannon entropy instead of 'BitsEntropy' since the prefix will be
361 double entropy[4];
366 entropy[1] = ShannonEntropy(monogram_histo, 3, &dummy);
367 entropy[2] = (ShannonEntropy(two_prefix_histo, 3, &dummy) +
369 entropy[3] = 0;
371 entropy[3] += ShannonEntropy(bigram_histo + 3 * i, 3, &dummy);
376 entropy[0] = 1.0 / (double)total;
377 entropy[1] *= entropy[0];
378 entropy[2] *= entropy[0];
379 entropy[3] *= entropy[0];
383 entropy[3] = entropy[1] * 10;
387 if (entropy[1] - entropy[2] < 0.2 &&
388 entropy[1] - entropy[3] < 0.2) {
390 } else if (entropy[2] - entropy[3] < 0.02) {
400 context values, based on the entropy reduction of histograms over the
429 /* To make entropy calculations faster and to fit on the stack, we collect
435 double entropy[3];
457 entropy[1] = ShannonEntropy(combined_histo, 32, &dummy);
458 entropy[2] = 0;
460 entropy[2] += ShannonEntropy(&context_histo[i][0], 32, &dummy);
462 entropy[0] = 1.0 / (double)total;
463 entropy[1] *= entropy[0];
464 entropy[2] *= entropy[0];
467 for not very well compressible input (i.e. entropy using context modeling
468 is 60% of maximal entropy) or if expected savings by symbol are less
472 if (entropy[2] > 3.0 || entropy[1] - entropy[2] < 0.2) {