1 /*
2 * H263 internal header
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 #ifndef AVCODEC_H263_H
21 #define AVCODEC_H263_H
22
23 #include <stdint.h>
28
29 #if !FF_API_ASPECT_EXTENDED
30 #define FF_ASPECT_EXTENDED 15
31 #endif
32 #define INT_BIT (CHAR_BIT * sizeof(int))
33
34 // The defines below define the number of bits that are read at once for
35 // reading vlc values. Changing these may improve speed and data cache needs
36 // be aware though that decreasing them may need the number of stages that is
37 // passed to get_vlc* to be increased.
38 #define INTRA_MCBPC_VLC_BITS 6
39 #define INTER_MCBPC_VLC_BITS 7
40 #define CBPY_VLC_BITS 6
41 #define TEX_VLC_BITS 9
42
45
47
49
52
56
60
64
66
68
73
75
77
78
83 void *
data,
int *got_frame,
88 int motion_x, int motion_y);
92 int *px, int *py);
104
105
106 /**
107 * Print picture info if FF_DEBUG_PICT_INFO is set.
108 */
110
113 int16_t
block[6][64]);
114
115 /**
116 * Return the value of the 3bit "source format" syntax element.
117 * This represents some standard picture dimensions or indicates that
118 * width&height are explicitly stored later.
119 */
121
126
127
129 int l, bit_size, code;
130
131 if (val == 0) {
133 } else {
134 bit_size = f_code - 1;
135 /* modulo encoding */
137 val = (val<<l)>>l;
138 val--;
139 code = (val >> bit_size) + 1;
140
141 return ff_mvtab[code][1] + 1 + bit_size;
142 }
143 }
144
150 }else{
153 }
154 }
155
157 int16_t
block[6][64],
158 int motion_x, int motion_y){
159 int cbp, i;
160
162 int best_cbpy_score= INT_MAX;
163 int best_cbpc_score= INT_MAX;
164 int cbpc = (-1), cbpy= (-1);
167
168 for(i=0; i<4; i++){
172
173 if(score < best_cbpc_score){
174 best_cbpc_score= score;
175 cbpc= i;
176 }
177 }
178
179 for(i=0; i<16; i++){
185
186 if(score < best_cbpy_score){
187 best_cbpy_score= score;
188 cbpy= i;
189 }
190 }
191 cbp= cbpc + 4*cbpy;
193 if(best_cbpy_score + best_cbpc_score + 2*lambda >= 0)
194 cbp= 0;
195 }
196
197 for (i = 0; i < 6; i++) {
201 }
202 }
203 }else{
204 cbp= 0;
205 for (i = 0; i < 6; i++) {
207 cbp |= 1 << (5 - i);
208 }
209 }
210 return cbp;
211 }
212
214 {
215 int i;
217 tab[i] = val;
218 }
219
220 #endif /* AVCODEC_H263_H */