annotate h263.h @ 10818:514dc1c87b2e libavcodec

Rename most non static h263 tables so their name contains h263.
author michael
date Fri, 08 Jan 2010 17:51:48 +0000
parents 4605bd2fdb7f
children d0657e337f91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
1 /*
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
2 * H263 internal header
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
3 *
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
4 * This file is part of FFmpeg.
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
5 *
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
10 *
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
14 * Lesser General Public License for more details.
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
15 *
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
19 */
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
20 #ifndef AVCODEC_H263_H
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
21 #define AVCODEC_H263_H
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
22
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
23 // The defines below define the number of bits that are read at once for
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
24 // reading vlc values. Changing these may improve speed and data cache needs
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
25 // be aware though that decreasing them may need the number of stages that is
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
26 // passed to get_vlc* to be increased.
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
27 #define INTRA_MCBPC_VLC_BITS 6
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
28 #define INTER_MCBPC_VLC_BITS 7
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
29 #define CBPY_VLC_BITS 6
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
30 #define TEX_VLC_BITS 9
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
31
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
32 extern const AVRational ff_h263_pixel_aspect[16];
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
33 extern const uint8_t ff_h263_cbpy_tab[16][2];
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
34
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
35 extern const uint8_t mvtab[33][2];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
36
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
37 extern const uint8_t ff_h263_intra_MCBPC_code[9];
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
38 extern const uint8_t ff_h263_intra_MCBPC_bits[9];
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
39
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
40 extern const uint8_t ff_h263_inter_MCBPC_code[28];
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
41 extern const uint8_t ff_h263_inter_MCBPC_bits[28];
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
42
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
43 extern VLC ff_h263_intra_MCBPC_vlc;
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
44 extern VLC ff_h263_inter_MCBPC_vlc;
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
45 extern VLC ff_h263_cbpy_vlc;
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
46
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
47 extern RLTable ff_h263_rl_inter;
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
48
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
49 int h263_decode_motion(MpegEncContext * s, int pred, int f_code);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
50 av_const int ff_h263_aspect_to_info(AVRational aspect);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
51
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
52 static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
53 int l, bit_size, code;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
54
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
55 if (val == 0) {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
56 return mvtab[0][1];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
57 } else {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
58 bit_size = f_code - 1;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
59 /* modulo encoding */
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
60 l= INT_BIT - 6 - bit_size;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
61 val = (val<<l)>>l;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
62 val--;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
63 code = (val >> bit_size) + 1;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
64
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
65 return mvtab[code][1] + 1 + bit_size;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
66 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
67 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
68
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
69 static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
70 if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
71 skip_put_bits(&s->pb,
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
72 h263_get_motion_length(s, x, f_code)
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
73 +h263_get_motion_length(s, y, f_code));
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
74 }else{
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
75 ff_h263_encode_motion(s, x, f_code);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
76 ff_h263_encode_motion(s, y, f_code);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
77 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
78 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
79
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
80 static inline int get_p_cbp(MpegEncContext * s,
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
81 DCTELEM block[6][64],
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
82 int motion_x, int motion_y){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
83 int cbp, i;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
84
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
85 if(s->flags & CODEC_FLAG_CBP_RD){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
86 int best_cbpy_score= INT_MAX;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
87 int best_cbpc_score= INT_MAX;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
88 int cbpc = (-1), cbpy= (-1);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
89 const int offset= (s->mv_type==MV_TYPE_16X16 ? 0 : 16) + (s->dquant ? 8 : 0);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
90 const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
91
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
92 for(i=0; i<4; i++){
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
93 int score= ff_h263_inter_MCBPC_bits[i + offset] * lambda;
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
94 if(i&1) score += s->coded_score[5];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
95 if(i&2) score += s->coded_score[4];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
96
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
97 if(score < best_cbpc_score){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
98 best_cbpc_score= score;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
99 cbpc= i;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
100 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
101 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
102
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
103 for(i=0; i<16; i++){
10818
514dc1c87b2e Rename most non static h263 tables so their name contains h263.
michael
parents: 10803
diff changeset
104 int score= ff_h263_cbpy_tab[i ^ 0xF][1] * lambda;
10803
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
105 if(i&1) score += s->coded_score[3];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
106 if(i&2) score += s->coded_score[2];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
107 if(i&4) score += s->coded_score[1];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
108 if(i&8) score += s->coded_score[0];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
109
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
110 if(score < best_cbpy_score){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
111 best_cbpy_score= score;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
112 cbpy= i;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
113 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
114 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
115 cbp= cbpc + 4*cbpy;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
116 if ((motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
117 if(best_cbpy_score + best_cbpc_score + 2*lambda >= 0)
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
118 cbp= 0;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
119 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
120
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
121 for (i = 0; i < 6; i++) {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
122 if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i))&1)==0 ){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
123 s->block_last_index[i]= -1;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
124 s->dsp.clear_block(s->block[i]);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
125 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
126 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
127 }else{
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
128 cbp= 0;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
129 for (i = 0; i < 6; i++) {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
130 if (s->block_last_index[i] >= 0)
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
131 cbp |= 1 << (5 - i);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
132 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
133 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
134 return cbp;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
135 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
136
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
137 static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
138 int motion_x, int motion_y, int mb_type){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
139 int cbp=0, i;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
140
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
141 if(s->flags & CODEC_FLAG_CBP_RD){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
142 int score=0;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
143 const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
144
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
145 for(i=0; i<6; i++){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
146 if(s->coded_score[i] < 0){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
147 score += s->coded_score[i];
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
148 cbp |= 1 << (5 - i);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
149 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
150 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
151
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
152 if(cbp){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
153 int zero_score= -6;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
154 if ((motion_x | motion_y | s->dquant | mb_type) == 0){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
155 zero_score-= 4; //2*MV + mb_type + cbp bit
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
156 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
157
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
158 zero_score*= lambda;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
159 if(zero_score <= score){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
160 cbp=0;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
161 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
162 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
163
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
164 for (i = 0; i < 6; i++) {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
165 if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i))&1)==0 ){
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
166 s->block_last_index[i]= -1;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
167 s->dsp.clear_block(s->block[i]);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
168 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
169 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
170 }else{
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
171 for (i = 0; i < 6; i++) {
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
172 if (s->block_last_index[i] >= 0)
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
173 cbp |= 1 << (5 - i);
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
174 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
175 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
176 return cbp;
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
177 }
4605bd2fdb7f Split the mpeg4 encoder and decoder off h263.c
michael
parents:
diff changeset
178 #endif