1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file price_table_gen.c
4 /// \brief Probability price table generator
6 /// Compiling: gcc -std=c99 -o price_table_gen price_table_gen.c
8 // Copyright (C) 2007 Lasse Collin
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
20 ///////////////////////////////////////////////////////////////////////////////
22 #include <sys/types.h>
25 #include "range_common.h"
26 #include "price_table_init.c"
34 printf("/* This file has been automatically generated by "
35 "price_table_gen.c. */\n\n"
36 "#include \"range_encoder.h\"\n\n"
37 "const uint32_t lzma_rc_prob_prices["
38 "BIT_MODEL_TOTAL >> MOVE_REDUCING_BITS] = {");
40 const size_t array_size = sizeof(lzma_rc_prob_prices)
41 / sizeof(lzma_rc_prob_prices[0]);
42 for (size_t i = 0; i < array_size; ++i) {
46 printf("%4" PRIu32, lzma_rc_prob_prices[i]);
48 if (i != array_size - 1)