/*
* jaricom . c
*
* This file was part of the Independent JPEG Group ' s software :
* Developed 1997 - 2009 by Guido Vollbeding .
* libjpeg - turbo Modifications :
* Copyright ( C ) 2015 , 2018 , D . R . Commander .
* For conditions of distribution and use , see the accompanying README . ijg
* file .
*
* This file contains probability estimation tables for common use in
* arithmetic entropy encoding and decoding routines .
*
* This data represents Table D . 2 in
* Recommendation ITU - T T . 81 ( 1992 ) | ISO / IEC 10918 - 1 : 1994 and Table 24 in
* Recommendation ITU - T T . 82 ( 1993 ) | ISO / IEC 11544 : 1993 .
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* The following #define specifies the packing of the four components
* into the compact JLONG representation .
* Note that this formula must match the actual arithmetic encoder
* and decoder implementation . The implementation has to be changed
* if this formula is changed .
* The current organization is leaned on Markus Kuhn ' s JBIG
* implementation ( jbig_tab . c ) .
*/
#define V(i, a, b, c, d) \
(((JLONG)a << 16 ) | ((JLONG)c << 8 ) | ((JLONG)d << 7 ) | b)
const JLONG jpeg_aritab[113 + 1 ] = {
/*
* Index , Qe_Value , Next_Index_LPS , Next_Index_MPS , Switch_MPS
*/
V( 0 , 0 x5a1d, 1 , 1 , 1 ),
V( 1 , 0 x2586, 14 , 2 , 0 ),
V( 2 , 0 x1114, 16 , 3 , 0 ),
V( 3 , 0 x080b, 18 , 4 , 0 ),
V( 4 , 0 x03d8, 20 , 5 , 0 ),
V( 5 , 0 x01da, 23 , 6 , 0 ),
V( 6 , 0 x00e5, 25 , 7 , 0 ),
V( 7 , 0 x006f, 28 , 8 , 0 ),
V( 8 , 0 x0036, 30 , 9 , 0 ),
V( 9 , 0 x001a, 33 , 10 , 0 ),
V( 10 , 0 x000d, 35 , 11 , 0 ),
V( 11 , 0 x0006, 9 , 12 , 0 ),
V( 12 , 0 x0003, 10 , 13 , 0 ),
V( 13 , 0 x0001, 12 , 13 , 0 ),
V( 14 , 0 x5a7f, 15 , 15 , 1 ),
V( 15 , 0 x3f25, 36 , 16 , 0 ),
V( 16 , 0 x2cf2, 38 , 17 , 0 ),
V( 17 , 0 x207c, 39 , 18 , 0 ),
V( 18 , 0 x17b9, 40 , 19 , 0 ),
V( 19 , 0 x1182, 42 , 20 , 0 ),
V( 20 , 0 x0cef, 43 , 21 , 0 ),
V( 21 , 0 x09a1, 45 , 22 , 0 ),
V( 22 , 0 x072f, 46 , 23 , 0 ),
V( 23 , 0 x055c, 48 , 24 , 0 ),
V( 24 , 0 x0406, 49 , 25 , 0 ),
V( 25 , 0 x0303, 51 , 26 , 0 ),
V( 26 , 0 x0240, 52 , 27 , 0 ),
V( 27 , 0 x01b1, 54 , 28 , 0 ),
V( 28 , 0 x0144, 56 , 29 , 0 ),
V( 29 , 0 x00f5, 57 , 30 , 0 ),
V( 30 , 0 x00b7, 59 , 31 , 0 ),
V( 31 , 0 x008a, 60 , 32 , 0 ),
V( 32 , 0 x0068, 62 , 33 , 0 ),
V( 33 , 0 x004e, 63 , 34 , 0 ),
V( 34 , 0 x003b, 32 , 35 , 0 ),
V( 35 , 0 x002c, 33 , 9 , 0 ),
V( 36 , 0 x5ae1, 37 , 37 , 1 ),
V( 37 , 0 x484c, 64 , 38 , 0 ),
V( 38 , 0 x3a0d, 65 , 39 , 0 ),
V( 39 , 0 x2ef1, 67 , 40 , 0 ),
V( 40 , 0 x261f, 68 , 41 , 0 ),
V( 41 , 0 x1f33, 69 , 42 , 0 ),
V( 42 , 0 x19a8, 70 , 43 , 0 ),
V( 43 , 0 x1518, 72 , 44 , 0 ),
V( 44 , 0 x1177, 73 , 45 , 0 ),
V( 45 , 0 x0e74, 74 , 46 , 0 ),
V( 46 , 0 x0bfb, 75 , 47 , 0 ),
V( 47 , 0 x09f8, 77 , 48 , 0 ),
V( 48 , 0 x0861, 78 , 49 , 0 ),
V( 49 , 0 x0706, 79 , 50 , 0 ),
V( 50 , 0 x05cd, 48 , 51 , 0 ),
V( 51 , 0 x04de, 50 , 52 , 0 ),
V( 52 , 0 x040f, 50 , 53 , 0 ),
V( 53 , 0 x0363, 51 , 54 , 0 ),
V( 54 , 0 x02d4, 52 , 55 , 0 ),
V( 55 , 0 x025c, 53 , 56 , 0 ),
V( 56 , 0 x01f8, 54 , 57 , 0 ),
V( 57 , 0 x01a4, 55 , 58 , 0 ),
V( 58 , 0 x0160, 56 , 59 , 0 ),
V( 59 , 0 x0125, 57 , 60 , 0 ),
V( 60 , 0 x00f6, 58 , 61 , 0 ),
V( 61 , 0 x00cb, 59 , 62 , 0 ),
V( 62 , 0 x00ab, 61 , 63 , 0 ),
V( 63 , 0 x008f, 61 , 32 , 0 ),
V( 64 , 0 x5b12, 65 , 65 , 1 ),
V( 65 , 0 x4d04, 80 , 66 , 0 ),
V( 66 , 0 x412c, 81 , 67 , 0 ),
V( 67 , 0 x37d8, 82 , 68 , 0 ),
V( 68 , 0 x2fe8, 83 , 69 , 0 ),
V( 69 , 0 x293c, 84 , 70 , 0 ),
V( 70 , 0 x2379, 86 , 71 , 0 ),
V( 71 , 0 x1edf, 87 , 72 , 0 ),
V( 72 , 0 x1aa9, 87 , 73 , 0 ),
V( 73 , 0 x174e, 72 , 74 , 0 ),
V( 74 , 0 x1424, 72 , 75 , 0 ),
V( 75 , 0 x119c, 74 , 76 , 0 ),
V( 76 , 0 x0f6b, 74 , 77 , 0 ),
V( 77 , 0 x0d51, 75 , 78 , 0 ),
V( 78 , 0 x0bb6, 77 , 79 , 0 ),
V( 79 , 0 x0a40, 77 , 48 , 0 ),
V( 80 , 0 x5832, 80 , 81 , 1 ),
V( 81 , 0 x4d1c, 88 , 82 , 0 ),
V( 82 , 0 x438e, 89 , 83 , 0 ),
V( 83 , 0 x3bdd, 90 , 84 , 0 ),
V( 84 , 0 x34ee, 91 , 85 , 0 ),
V( 85 , 0 x2eae, 92 , 86 , 0 ),
V( 86 , 0 x299a, 93 , 87 , 0 ),
V( 87 , 0 x2516, 86 , 71 , 0 ),
V( 88 , 0 x5570, 88 , 89 , 1 ),
V( 89 , 0 x4ca9, 95 , 90 , 0 ),
V( 90 , 0 x44d9, 96 , 91 , 0 ),
V( 91 , 0 x3e22, 97 , 92 , 0 ),
V( 92 , 0 x3824, 99 , 93 , 0 ),
V( 93 , 0 x32b4, 99 , 94 , 0 ),
V( 94 , 0 x2e17, 93 , 86 , 0 ),
V( 95 , 0 x56a8, 95 , 96 , 1 ),
V( 96 , 0 x4f46, 101 , 97 , 0 ),
V( 97 , 0 x47e5, 102 , 98 , 0 ),
V( 98 , 0 x41cf, 103 , 99 , 0 ),
V( 99 , 0 x3c3d, 104 , 100 , 0 ),
V( 100 , 0 x375e, 99 , 93 , 0 ),
V( 101 , 0 x5231, 105 , 102 , 0 ),
V( 102 , 0 x4c0f, 106 , 103 , 0 ),
V( 103 , 0 x4639, 107 , 104 , 0 ),
V( 104 , 0 x415e, 103 , 99 , 0 ),
V( 105 , 0 x5627, 105 , 106 , 1 ),
V( 106 , 0 x50e7, 108 , 107 , 0 ),
V( 107 , 0 x4b85, 109 , 103 , 0 ),
V( 108 , 0 x5597, 110 , 109 , 0 ),
V( 109 , 0 x504f, 111 , 107 , 0 ),
V( 110 , 0 x5a10, 110 , 111 , 1 ),
V( 111 , 0 x5522, 112 , 109 , 0 ),
V( 112 , 0 x59eb, 112 , 111 , 1 ),
/*
* This last entry is used for fixed probability estimate of 0 . 5
* as recommended in Section 10 . 3 Table 5 of ITU - T Rec . T . 851 .
*/
V( 113 , 0 x5a1d, 113 , 113 , 0 )
};
Messung V0.5 in Prozent C=92 H=93 G=92