annotate cavs.h @ 5095:ed41cfae128d libavcodec

Codebook generator using the ELBG algorithm patch by Vitor: printf(vitor%d gmail com, 1001) original thread: Re: [FFmpeg-devel] [PATCH] Add a codebook generator (was: [PATCH] RoQ video encoder, take 2) date: 05/28/2007 01:21 PM
author benoit
date Mon, 04 Jun 2007 07:28:34 +0000
parents 5d4544d7cbbc
children 2b72f9bc4f06
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4944
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
1 /*
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
2 * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
3 * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
4 *
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
5 * This file is part of FFmpeg.
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
6 *
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
11 *
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
15 * Lesser General Public License for more details.
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
16 *
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
20 */
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
21
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
22 #ifndef CAVS_H
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
23 #define CAVS_H
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
24
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
25 #include "dsputil.h"
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
26
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
27 #define SLICE_MIN_START_CODE 0x00000101
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
28 #define SLICE_MAX_START_CODE 0x000001af
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
29 #define EXT_START_CODE 0x000001b5
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
30 #define USER_START_CODE 0x000001b2
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
31 #define CAVS_START_CODE 0x000001b0
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
32 #define PIC_I_START_CODE 0x000001b3
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
33 #define PIC_PB_START_CODE 0x000001b6
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
34
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
35 #define A_AVAIL 1
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
36 #define B_AVAIL 2
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
37 #define C_AVAIL 4
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
38 #define D_AVAIL 8
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
39 #define NOT_AVAIL -1
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
40 #define REF_INTRA -2
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
41 #define REF_DIR -3
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
42
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
43 #define ESCAPE_CODE 59
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
44
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
45 #define FWD0 0x01
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
46 #define FWD1 0x02
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
47 #define BWD0 0x04
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
48 #define BWD1 0x08
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
49 #define SYM0 0x10
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
50 #define SYM1 0x20
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
51 #define SPLITH 0x40
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
52 #define SPLITV 0x80
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
53
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
54 #define MV_BWD_OFFS 12
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
55 #define MV_STRIDE 4
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
56
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
57 enum mb_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
58 I_8X8 = 0,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
59 P_SKIP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
60 P_16X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
61 P_16X8,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
62 P_8X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
63 P_8X8,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
64 B_SKIP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
65 B_DIRECT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
66 B_FWD_16X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
67 B_BWD_16X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
68 B_SYM_16X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
69 B_8X8 = 29
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
70 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
71
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
72 enum sub_mb_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
73 B_SUB_DIRECT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
74 B_SUB_FWD,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
75 B_SUB_BWD,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
76 B_SUB_SYM
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
77 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
78
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
79 enum intra_luma_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
80 INTRA_L_VERT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
81 INTRA_L_HORIZ,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
82 INTRA_L_LP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
83 INTRA_L_DOWN_LEFT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
84 INTRA_L_DOWN_RIGHT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
85 INTRA_L_LP_LEFT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
86 INTRA_L_LP_TOP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
87 INTRA_L_DC_128
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
88 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
89
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
90 enum intra_chroma_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
91 INTRA_C_LP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
92 INTRA_C_HORIZ,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
93 INTRA_C_VERT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
94 INTRA_C_PLANE,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
95 INTRA_C_LP_LEFT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
96 INTRA_C_LP_TOP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
97 INTRA_C_DC_128,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
98 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
99
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
100 enum mv_pred_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
101 MV_PRED_MEDIAN,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
102 MV_PRED_LEFT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
103 MV_PRED_TOP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
104 MV_PRED_TOPRIGHT,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
105 MV_PRED_PSKIP,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
106 MV_PRED_BSKIP
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
107 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
108
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
109 enum block_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
110 BLK_16X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
111 BLK_16X8,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
112 BLK_8X16,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
113 BLK_8X8
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
114 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
115
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
116 enum mv_loc_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
117 MV_FWD_D3 = 0,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
118 MV_FWD_B2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
119 MV_FWD_B3,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
120 MV_FWD_C2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
121 MV_FWD_A1,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
122 MV_FWD_X0,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
123 MV_FWD_X1,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
124 MV_FWD_A3 = 8,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
125 MV_FWD_X2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
126 MV_FWD_X3,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
127 MV_BWD_D3 = MV_BWD_OFFS,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
128 MV_BWD_B2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
129 MV_BWD_B3,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
130 MV_BWD_C2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
131 MV_BWD_A1,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
132 MV_BWD_X0,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
133 MV_BWD_X1,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
134 MV_BWD_A3 = MV_BWD_OFFS+8,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
135 MV_BWD_X2,
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
136 MV_BWD_X3
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
137 };
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
138
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
139 DECLARE_ALIGNED_8(typedef, struct) {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
140 int16_t x;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
141 int16_t y;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
142 int16_t dist;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
143 int16_t ref;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
144 } vector_t;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
145
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
146 typedef struct residual_vlc_t {
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
147 int8_t rltab[59][3];
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
148 int8_t level_add[27];
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
149 int8_t golomb_order;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
150 int inc_limit;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
151 int8_t max_run;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
152 } residual_vlc_t;
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
153
5d4544d7cbbc move defines and enums out of cavsdata.h
aurel
parents:
diff changeset
154 #endif /* CAVS_H */