vld.h
来自「著名的 helix realplayer 基于手机 symbian 系统的 播放」· C头文件 代码 · 共 1,347 行 · 第 1/4 页
H
1,347 行
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file, are
* subject to the current version of the RealNetworks Public Source License
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
* in which case the RCSL will apply. You may also obtain the license terms
* directly from RealNetworks. You may not use this file except in
* compliance with the RPSL or, if you have a valid RCSL with RealNetworks
* applicable to this file, the RCSL. Please see the applicable RPSL or
* RCSL for the rights, obligations and limitations governing use of the
* contents of the file.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the portions
* it created.
*
* This file, and the files included with this file, is distributed and made
* available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _INC_VLD
#define _INC_VLD 1
/* DECTABENTRY - Description of each entry in the decode tables
* An entry in the decode table contains the following information:
* sym - a) If bits > 0, sym contains decoded symbol
* If sym.type = SYM_EXIT, we find the reason in sym.value
* b) bits < 0 indicates that long codeword was encountered.
* We continue decoding using table indicated by sym.value.
* sym.type is not defined.
* statechange Add to state to get the new state
* bits - abs(bits) is # of parsed bits. bits < 0 indicates code > 8 bits
*/
typedef struct {
SYMBOL sym;
S8 statechange;
S8 bits;
} DECTABENTRY;
#define DECTABBITS 8 /* Look up DECTABBITS bits at a time */
#define DECTABSIZE 256 /* 2 ** DECTABBITS */
DECTABENTRY dectable[NUMTABS][DECTABSIZE];
U8 selectdectab[NUMSTATES] = {
TAB_ILLEGAL_STATE, /* State 0 is not used */
TAB_MVD, TAB_MVD, /* ST_MC_NOCBP_MVD */
TAB_MBA_STARTCODE,
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 6 */
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 5 */
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 4 */
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 3 */
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 2 */
TAB_DCT_NEXT, TAB_DCT_FIRST, /* Block 1 */
TAB_LAST_INTRA_DC, /* INTRA Block 6 */
TAB_DCT_NEXT, TAB_INTRA_DC, /* INTRA Block 5 */
TAB_DCT_NEXT, TAB_INTRA_DC, /* INTRA Block 4 */
TAB_DCT_NEXT, TAB_INTRA_DC, /* INTRA Block 3 */
TAB_DCT_NEXT, TAB_INTRA_DC, /* INTRA Block 2 */
TAB_DCT_NEXT, TAB_INTRA_DC, /* INTRA Block 1 */
TAB_MVD, TAB_MVD, /* ST_MC_CBP_MVD */
TAB_CBP,
TAB_QUANT_TR, /* ST_INTRA_MQUANT */
TAB_QUANT_TR, /* ST_MC_CBP_MQUANT */
TAB_ESCAPE_LEVEL,
TAB_QUANT_TR, /* ST_INTER_MQUANT */
TAB_ESCAPE_LEVEL,
TAB_MTYPE,
TAB_ESCAPE_LEVEL,
TAB_GEI_PEI,
TAB_ESCAPE_LEVEL,
TAB_PTYPE,
TAB_ESCAPE_LEVEL,
TAB_QUANT_TR, /* ST_GQUANT */
TAB_ESCAPE_LEVEL,
TAB_QUANT_TR, /* ST_TR */
TAB_GN, /* ST_AFTER_STARTCODE */
TAB_ESCAPE_LEVEL,
TAB_ILLEGAL_STATE, /* State 46 is not used */
TAB_ESCAPE_LEVEL,
TAB_ILLEGAL_STATE, /* State 48 is not used */
TAB_ESCAPE_LEVEL,
TAB_ILLEGAL_STATE, /* State 50 is not used */
TAB_ESCAPE_LEVEL,
TAB_ILLEGAL_STATE, /* State 52 is not used */
TAB_ESCAPE_LEVEL,
// H.263 states start at item 54
TAB263_FINISHED, // Done with last block
TAB263_ESCAPE_LEVEL, // ESCAPE-RUN-LEVEL as last TCOEF of last block
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 6
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 5
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 4
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 3
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 2
TAB263_TCOEF, TAB263_ESCAPE_LEVEL, // Block 1
TAB263_INTRA_DC, // INTRA-DC only
TAB_ILLEGAL_STATE, // State 69 is not used
TAB263_INTRA_DC // INTRA-DC followed by AC coefficients
#ifdef DO_H263_PLUS
,
TAB263_FINISHED, // Done with last block
TAB263_ESCAPE_LEVEL, // ESCAPE-RUN-LEVEL as last TCOEF of last block
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL, // Block 6
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL, // Block 5
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL, // Block 4
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL, // Block 3
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL, // Block 2
TAB263PLUS_TCOEF, TAB263_ESCAPE_LEVEL // Block 1
#endif
};
#define MAX_STRING_VLD (DECTABBITS + 4)
struct vlc_entry {
char vlc[MAX_STRING_VLD]; /* Flawfinder: ignore */
int type;
int value;
int statechange;
int last_value; /* Only used for fixed-length codes */
};
//////////////// Tables for H.261 //////////////////
static struct vlc_entry dct_next[] = {
{"0000 01", SYM_ESCAPE, TAB_ESCAPE_RUN, 0},
{"0010 0", SYM_ESCAPE, TAB_DCT_00100, 0},
{"0000 00", SYM_ESCAPE, TAB_DCT_000000, 0},
{"10", SYM_EOB, 0, (ST_FIRST_BLK_2 - ST_NEXT_BLK_1)},
{"110", 0, 1, 0},
{"111", 0, -1, 0},
{"0110", 1, 1, 0},
{"0111", 1, -1, 0},
{"0100 0", 0, 2, 0},
{"0100 1", 0, -2, 0},
{"0101 0", 2, 1, 0},
{"0101 1", 2, -1, 0},
{"0010 10", 0, 3, 0},
{"0010 11", 0, -3, 0},
{"0011 10", 3, 1, 0},
{"0011 11", 3, -1, 0},
{"0011 00", 4, 1, 0},
{"0011 01", 4, -1, 0},
{"0001 100", 1, 2, 0},
{"0001 101", 1, -2, 0},
{"0001 110", 5, 1, 0},
{"0001 111", 5, -1, 0},
{"0001 010", 6, 1, 0},
{"0001 011", 6, -1, 0},
{"0001 000", 7, 1, 0},
{"0001 001", 7, -1, 0},
{"0000 1100", 0, 4, 0},
{"0000 1101", 0, -4, 0},
{"0000 1000", 2, 2, 0},
{"0000 1001", 2, -2, 0},
{"0000 1110", 8, 1, 0},
{"0000 1111", 8, -1, 0},
{"0000 1010", 9, 1, 0},
{"0000 1011", 9, -1, 0},
{"End"}
};
static struct vlc_entry dct_first[] = {
{"0000 01", SYM_ESCAPE, TAB_ESCAPE_RUN, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0010 0", SYM_ESCAPE, TAB_DCT_00100, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 00", SYM_ESCAPE, TAB_DCT_000000, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"10", 0, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"11", 0, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0110", 1, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0111", 1, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0100 0", 0, 2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0100 1", 0, -2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0101 0", 2, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0101 1", 2, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0010 10", 0, 3, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0010 11", 0, -3, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0011 10", 3, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0011 11", 3, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0011 00", 4, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0011 01", 4, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 100", 1, 2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 101", 1, -2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 110", 5, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 111", 5, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 010", 6, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 011", 6, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 000", 7, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0001 001", 7, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1100", 0, 4, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1101", 0, -4, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1000", 2, 2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1001", 2, -2, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1110", 8, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1111", 8, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1010", 9, 1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"0000 1011", 9, -1, (ST_NEXT_BLK_1 - ST_FIRST_BLK_1)},
{"End"}
};
static struct vlc_entry dct_00100[] = {
{"110 0", 0, 5, 0},
{"110 1", 0, -5, 0},
{"001 0", 0, 6, 0},
{"001 1", 0, -6, 0},
{"101 0", 1, 3, 0},
{"101 1", 1, -3, 0},
{"100 0", 3, 2, 0},
{"100 1", 3, -2, 0},
{"111 0", 10, 1, 0},
{"111 1", 10, -1, 0},
{"011 0", 11, 1, 0},
{"011 1", 11, -1, 0},
{"010 0", 12, 1, 0},
{"010 1", 12, -1, 0},
{"000 0", 13, 1, 0},
{"000 1", 13, -1, 0},
{"End"}
};
static struct vlc_entry dct_000000[] = {
{"10 100", 0, 7, 0},
{"10 101", 0, -7, 0},
{"11 000", 1, 4, 0},
{"11 001", 1, -4, 0},
{"10 110", 2, 3, 0},
{"10 111", 2, -3, 0},
{"11 110", 4, 2, 0},
{"11 111", 4, -2, 0},
{"10 010", 5, 2, 0},
{"10 011", 5, -2, 0},
{"11 100", 14, 1, 0},
{"11 101", 14, -1, 0},
{"11 010", 15, 1, 0},
{"11 011", 15, -1, 0},
{"10 000", 16, 1, 0},
{"10 001", 16, -1, 0},
{"01 1101 0", 0, 8, 0},
{"01 1101 1", 0, -8, 0},
{"01 1000 0", 0, 9, 0},
{"01 1000 1", 0, -9, 0},
{"01 0011 0", 0, 10, 0},
{"01 0011 1", 0, -10, 0},
{"01 0000 0", 0, 11, 0},
{"01 0000 1", 0, -11, 0},
{"01 1011 0", 1, 5, 0},
{"01 1011 1", 1, -5, 0},
{"01 0100 0", 2, 4, 0},
{"01 0100 1", 2, -4, 0},
{"01 1100 0", 3, 3, 0},
{"01 1100 1", 3, -3, 0},
{"01 0010 0", 4, 3, 0},
{"01 0010 1", 4, -3, 0},
{"01 1110 0", 6, 2, 0},
{"01 1110 1", 6, -2, 0},
{"01 0101 0", 7, 2, 0},
{"01 0101 1", 7, -2, 0},
{"01 0001 0", 8, 2, 0},
{"01 0001 1", 8, -2, 0},
{"01 1111 0", 17, 1, 0},
{"01 1111 1", 17, -1, 0},
{"01 1010 0", 18, 1, 0},
{"01 1010 1", 18, -1, 0},
{"01 1001 0", 19, 1, 0},
{"01 1001 1", 19, -1, 0},
{"01 0111 0", 20, 1, 0},
{"01 0111 1", 20, -1, 0},
{"01 0110 0", 21, 1, 0},
{"01 0110 1", 21, -1, 0},
{"00 1101 00", 0, 12, 0},
{"00 1101 01", 0, -12, 0},
{"00 1100 10", 0, 13, 0},
{"00 1100 11", 0, -13, 0},
{"00 1100 00", 0, 14, 0},
{"00 1100 01", 0, -14, 0},
{"00 1011 10", 0, 15, 0},
{"00 1011 11", 0, -15, 0},
{"00 1011 00", 1, 6, 0},
{"00 1011 01", 1, -6, 0},
{"00 1010 10", 1, 7, 0},
{"00 1010 11", 1, -7, 0},
{"00 1010 00", 2, 5, 0},
{"00 1010 01", 2, -5, 0},
{"00 1001 10", 3, 4, 0},
{"00 1001 11", 3, -4, 0},
{"00 1001 00", 5, 3, 0},
{"00 1001 01", 5, -3, 0},
{"00 1000 10", 9, 2, 0},
{"00 1000 11", 9, -2, 0},
{"00 1000 00", 10, 2, 0},
{"00 1000 01", 10, -2, 0},
{"00 1111 10", 22, 1, 0},
{"00 1111 11", 22, -1, 0},
{"00 1111 00", 23, 1, 0},
{"00 1111 01", 23, -1, 0},
{"00 1110 10", 24, 1, 0},
{"00 1110 11", 24, -1, 0},
{"00 1110 00", 25, 1, 0},
{"00 1110 01", 25, -1, 0},
{"00 1101 10", 26, 1, 0},
{"00 1101 11", 26, -1, 0},
{"End"}
};
static struct vlc_entry escape_run[] = {
{"FLC"},
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?