1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include "AriBitCoder.h"
#include "AriPrice.h"
#include <cmath>
namespace NCompression {
namespace NArithmetic {
static const double kDummyMultMid = (1.0 / kBitPrice) / 2;
CPriceTables::CPriceTables()
{
double aLn2 = log((double)2);
double aLnAll = log((double)(kBitModelTotal >> kNumMoveReducingBits));
for(UINT32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
m_StatePrices[i] = UINT32((fabs(aLnAll - log((double)i)) / aLn2 + kDummyMultMid) * kBitPrice);
}
CPriceTables g_PriceTables;
}}
|