Skip to content

Error in compiling the arithmetic coder #11

@dq0309

Description

@dq0309

There is something wrong with the compilation of the arithmetic coder.

module_arithmeticcoding.cpp:11:9: error: expected unqualified-id before 'int128'
typedef int128 comint;
^~~~~~~~
module_arithmeticcoding.cpp:12:7: error: 'comint' does not name a type
const comint STATE_SIZE = 64;
^~~~~~
module_arithmeticcoding.cpp:13:7: error: 'comint' does not name a type
const comint MAX_RANGE = (comint)1 << STATE_SIZE;
^~~~~~
module_arithmeticcoding.cpp:14:7: error: 'comint' does not name a type
const comint MIN_RANGE = (MAX_RANGE >> 2) + 2;
^~~~~~
module_arithmeticcoding.cpp:15:7: error: 'comint' does not name a type
const comint MAX_TOTAL = MIN_RANGE;
^~~~~~
module_arithmeticcoding.cpp:16:7: error: 'comint' does not name a type
const comint MASK = MAX_RANGE - 1;
^~~~~~
module_arithmeticcoding.cpp:17:7: error: 'comint' does not name a type
const comint TOP_MASK = MAX_RANGE >> 1;
^~~~~~
module_arithmeticcoding.cpp:18:7: error: 'comint' does not name a type
const comint SECOND_MASK = TOP_MASK >> 1;
^~~~~~
module_arithmeticcoding.cpp:142:13: error: 'comint' has not been declared
int get(comint symbol) {
^~~~~~
module_arithmeticcoding.cpp:155:5: error: 'comint' does not name a type
comint get_low(comint symbol) {
^~~~~~
module_arithmeticcoding.cpp:162:5: error: 'comint' does not name a type
comint get_high(comint symbol) {
^~~~~~
module_arithmeticcoding.cpp:169:24: error: 'comint' has not been declared
void check_symbol(comint symbol) {
^~~~~~
module_arithmeticcoding.cpp:183:5: error: 'comint' does not name a type
comint low, high;
^~~~~~
module_arithmeticcoding.cpp:189:53: error: 'comint' has not been declared
virtual void update(ModelFrequencyTable freqs, comint symbol) {
^~~~~~
module_arithmeticcoding.cpp: In constructor 'ArithmeticCoderBase::ArithmeticCoderBase()':
module_arithmeticcoding.cpp:184:27: error: class 'ArithmeticCoderBase' does not have any field named '_low'
ArithmeticCoderBase():_low(0),_high(MASK) {}
^~~~
module_arithmeticcoding.cpp:184:35: error: class 'ArithmeticCoderBase' does not have any field named '_high'
ArithmeticCoderBase():_low(0),_high(MASK) {}
^~~~~
module_arithmeticcoding.cpp:184:41: error: 'MASK' was not declared in this scope
ArithmeticCoderBase():_low(0),_high(MASK) {}
^~~~
module_arithmeticcoding.cpp: In member function 'virtual void ArithmeticCoderBase::update(ModelFrequencyTable
, int)':
module_arithmeticcoding.cpp:190:9: error: 'comint' was not declared in this scope
comint low=low, high=high;
^~~~~~
module_arithmeticcoding.cpp:191:15: error: 'low' was not declared in this scope
if ( (low >= high) || ((low & MASK) != low) || ((high & MASK) != high) ) {
^~~
module_arithmeticcoding.cpp:191:22: error: 'high' was not declared in this scope
if ( (low >= high) || ((low & MASK) != low) || ((high & MASK) != high) ) {
^~~~
module_arithmeticcoding.cpp:191:39: error: 'MASK' was not declared in this scope
if ( (low >= high) || ((low & MASK) != low) || ((high & MASK) != high) ) {
^~~~
module_arithmeticcoding.cpp:195:16: error: expected ';' before 'range
'
comint range
= high - low + 1;
^~~~~~
module_arithmeticcoding.cpp:196:15: error: 'MIN_RANGE' was not declared in this scope
if (!(MIN_RANGE <= range
&& range
<= MAX_RANGE)) {
^~~~~~~~~
module_arithmeticcoding.cpp:196:28: error: 'range
' was not declared in this scope
if (!(MIN_RANGE <= range
&& range
<= MAX_RANGE)) {
^~~~~~
module_arithmeticcoding.cpp:196:48: error: 'MAX_RANGE' was not declared in this scope
if (!(MIN_RANGE <= range
&& range
<= MAX_RANGE)) {
^~~~~~~~~
module_arithmeticcoding.cpp:201:16: error: expected ';' before 'total'
comint total = freqs -> get_total();
^~~~~
module_arithmeticcoding.cpp:202:16: error: expected ';' before 'symlow'
comint symlow = freqs -> get_low(symbol);
^~~~~~
module_arithmeticcoding.cpp:203:16: error: expected ';' before 'symhigh'
comint symhigh = freqs -> get_high(symbol);
^~~~~~~
module_arithmeticcoding.cpp:204:13: error: 'symlow' was not declared in this scope
if (symlow == symhigh) {
^~~~~~
module_arithmeticcoding.cpp:204:23: error: 'symhigh' was not declared in this scope
if (symlow == symhigh) {
^~~~~~~
module_arithmeticcoding.cpp:208:55: error: 'class ModelFrequencyTable' has no member named 'get_low'
fprintf(stderr, "symlow: %ld", freqs->get_low(idx));
^~~~~~~
module_arithmeticcoding.cpp:209:56: error: 'class ModelFrequencyTable' has no member named 'get_high'; did you mean 'set_sigma'?
fprintf(stderr, "symhigh: %ld", freqs->get_high(idx));
^~~~~~~~
module_arithmeticcoding.cpp:216:13: error: 'total' was not declared in this scope
if (total > MAX_TOTAL) {
^~~~~
module_arithmeticcoding.cpp:216:21: error: 'MAX_TOTAL' was not declared in this scope
if (total > MAX_TOTAL) {
^~~~~~~~~
module_arithmeticcoding.cpp:220:16: error: expected ';' before 'newlow'
comint newlow = low + symlow * range_ / total;
^~~~~~
module_arithmeticcoding.cpp:221:16: error: expected ';' before 'newhigh'
comint newhigh = low + symhigh * range_ / total - 1;
^~~~~~~
module_arithmeticcoding.cpp:222:9: error: '_low' was not declared in this scope
_low = newlow;
^~~~
module_arithmeticcoding.cpp:222:16: error: 'newlow' was not declared in this scope
_low = newlow;
^~~~~~
module_arithmeticcoding.cpp:223:9: error: '_high' was not declared in this scope
_high = newhigh;
^~~~~
module_arithmeticcoding.cpp:223:17: error: 'newhigh' was not declared in this scope
_high = newhigh;
^~~~~~~
module_arithmeticcoding.cpp:227:35: error: 'TOP_MASK' was not declared in this scope
while ( ((_low ^ _high) & TOP_MASK) == 0 ) {
^~~~~~~~
module_arithmeticcoding.cpp:229:34: error: 'MASK' was not declared in this scope
_low = (_low << 1) & MASK;
^~~~
module_arithmeticcoding.cpp:233:35: error: 'SECOND_MASK' was not declared in this scope
while ((( _low & ~_high & SECOND_MASK )) != 0) {
^~~~~~~~~~~
module_arithmeticcoding.cpp:235:35: error: 'MASK' was not declared in this scope
_low = (_low << 1) & (MASK >> 1);
^~~~
module_arithmeticcoding.cpp:236:52: error: 'TOP_MASK' was not declared in this scope
_high = ((_high << 1) & (MASK >> 1)) | TOP_MASK | 1;
^~~~~~~~
module_arithmeticcoding.cpp: At global scope:
module_arithmeticcoding.cpp:246:5: error: 'comint' does not name a type
comint num_underflow;
^~~~~~
module_arithmeticcoding.cpp:252:44: error: 'comint' has not been declared
void write(ModelFrequencyTable* freqs, comint symbol) {
^~~~~~
module_arithmeticcoding.cpp: In constructor 'ArithmeticEncoder::ArithmeticEncoder(BitOutputStream*)':
module_arithmeticcoding.cpp:249:9: error: 'num_underflow' was not declared in this scope
num_underflow = 0;
^~~~~~~~~~~~~
module_arithmeticcoding.cpp: In member function 'virtual void ArithmeticEncoder::shift()':
module_arithmeticcoding.cpp:261:9: error: 'comint' was not declared in this scope
comint bit = _low >> (STATE_SIZE - 1);
^~~~~~
module_arithmeticcoding.cpp:262:23: error: 'bit' was not declared in this scope
output->write(bit);
^~~
module_arithmeticcoding.cpp:263:29: error: 'num_underflow' was not declared in this scope
for (int i = 0; i < num_underflow; i++) {
^~~~~~~~~~~~~
module_arithmeticcoding.cpp:266:9: error: 'num_underflow' was not declared in this scope
num_underflow = 0;
^~~~~~~~~~~~~
module_arithmeticcoding.cpp: In member function 'virtual void ArithmeticEncoder::underflow()':
module_arithmeticcoding.cpp:270:9: error: 'num_underflow' was not declared in this scope
num_underflow++;
^~~~~~~~~~~~~
module_arithmeticcoding.cpp: At global scope:
module_arithmeticcoding.cpp:278:5: error: 'comint' does not name a type
comint code;
^~~~~~
module_arithmeticcoding.cpp:287:5: error: 'comint' does not name a type
comint read(ModelFrequencyTable freqs) {
^~~~~~
module_arithmeticcoding.cpp:358:5: error: 'comint' does not name a type
comint read_code_bit() {
^~~~~~
module_arithmeticcoding.cpp:364:5: error: 'comint' does not name a type
comint getlow() {return _low;}
^~~~~~
module_arithmeticcoding.cpp:365:5: error: 'comint' does not name a type
comint gethigh() {return _high;}
^~~~~~
module_arithmeticcoding.cpp: In constructor 'ArithmeticDecoder::ArithmeticDecoder(BitInputStream
)':
module_arithmeticcoding.cpp:281:9: error: 'code' was not declared in this scope
code = 0;
^~~~
module_arithmeticcoding.cpp:282:29: error: 'STATE_SIZE' was not declared in this scope
for (int i = 0; i < STATE_SIZE; i++) {
^~~~~~~~~~
module_arithmeticcoding.cpp:283:48: error: 'read_code_bit' was not declared in this scope
code = (code << 1) | read_code_bit();
^
module_arithmeticcoding.cpp: In member function 'virtual void ArithmeticDecoder::shift()':
module_arithmeticcoding.cpp:350:43: error: 'read_code_bit' was not declared in this scope
unsigned char bit = read_code_bit();
^
module_arithmeticcoding.cpp:351:9: error: 'code' was not declared in this scope
code = ((code << 1) & MASK ) | bit;
^~~~
module_arithmeticcoding.cpp:351:31: error: 'MASK' was not declared in this scope
code = ((code << 1) & MASK ) | bit;
^~~~
module_arithmeticcoding.cpp: In member function 'virtual void ArithmeticDecoder::underflow()':
module_arithmeticcoding.cpp:355:9: error: 'code' was not declared in this scope
code = ((code & TOP_MASK) | (code << 1) & (MASK >> 1)) | read_code_bit();
^~~~
module_arithmeticcoding.cpp:355:25: error: 'TOP_MASK' was not declared in this scope
code = ((code & TOP_MASK) | (code << 1) & (MASK >> 1)) | read_code_bit();
^~~~~~~~
module_arithmeticcoding.cpp:355:52: error: 'MASK' was not declared in this scope
code = ((code & TOP_MASK) | (code << 1) & (MASK >> 1)) | read_code_bit();
^~~~
module_arithmeticcoding.cpp:355:80: error: 'read_code_bit' was not declared in this scope
code = ((code & TOP_MASK) | (code << 1) & (MASK >> 1)) | read_code_bit();
^
module_arithmeticcoding.cpp: In function 'int main(int, char**)':
module_arithmeticcoding.cpp:423:32: error: 'class ArithmeticDecoder' has no member named 'read'
short symbol = dec.read(&freq);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions