decode.c

来自「视频编码的码率控制」· C语言 代码 · 共 30 行

C
30
字号
/* DECODE.C - MAIN PROGRAM FOR DECODING. */

#include <stdio.h>

#define global

#include "code.h"
#include "model.h"

void main(void)
{
    int symbol;			/* Character to decoded as a symbol index    */
    int ch; 			/* Character to decoded as a character code  */

    start_model();				/* Set up other modules.    */
    start_inputing_bits();
    start_decoding();

    for (;;) {					/* Loop through characters. */

        symbol = decode_symbol(cum_freq);	/* Decode next symbol.      */
        if (symbol==EOF_symbol) break;		/* Exit loop if EOF symbol. */
        ch = index_to_char[symbol];		/* Translate to a character.*/
        putc(ch,stdout);			/* Write that character.    */
        update_model(symbol);			/* Update the model.        */
    }

    exit(0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?