1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file price_tablegen.c
4 /// \brief Probability price table generator
6 /// Compiling: gcc -std=c99 -o price_tablegen price_tablegen.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 ///////////////////////////////////////////////////////////////////////////////
25 #include "range_common.h"
27 #include "price_table_init.c"
35 printf("/* This file has been automatically generated by "
36 "price_tablegen.c. */\n\n"
37 "#include \"range_encoder.h\"\n\n"
38 "const uint32_t lzma_rc_prices["
39 "RC_PRICE_TABLE_SIZE] = {");
41 const size_t array_size = sizeof(lzma_rc_prices)
42 / sizeof(lzma_rc_prices[0]);
43 for (size_t i = 0; i < array_size; ++i) {
47 printf("%4" PRIu32, lzma_rc_prices[i]);
49 if (i != array_size - 1)