comparison wmv2.c @ 5098:997c368e6433 libavcodec

Rename code012() to ff_code012(), and remove static qualifier: paves the way to vc1 encoder, as this function would be useful there. patch by Denis Fortin % fortin A nerim P net % Original thread: date: Jun 4, 2007 9:23 PM subject: Re: [FFmpeg-devel] [RFC] move wmv2.c to its own file
author gpoirier
date Tue, 05 Jun 2007 07:18:29 +0000
parents 665c61d35b52
children 4dbe6578f811
comparison
equal deleted inserted replaced
5097:e9a0c447dc73 5098:997c368e6433
142 if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type); 142 if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type);
143 143
144 if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table); 144 if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
145 145
146 if(!s->per_mb_rl_table){ 146 if(!s->per_mb_rl_table){
147 code012(&s->pb, s->rl_chroma_table_index); 147 ff_code012(&s->pb, s->rl_chroma_table_index);
148 code012(&s->pb, s->rl_table_index); 148 ff_code012(&s->pb, s->rl_table_index);
149 } 149 }
150 150
151 put_bits(&s->pb, 1, s->dc_table_index); 151 put_bits(&s->pb, 1, s->dc_table_index);
152 152
153 s->inter_intra_pred= 0; 153 s->inter_intra_pred= 0;
154 }else{ 154 }else{
155 int cbp_index; 155 int cbp_index;
156 156
157 put_bits(&s->pb, 2, SKIP_TYPE_NONE); 157 put_bits(&s->pb, 2, SKIP_TYPE_NONE);
158 158
159 code012(&s->pb, cbp_index=0); 159 ff_code012(&s->pb, cbp_index=0);
160 if(s->qscale <= 10){ 160 if(s->qscale <= 10){
161 int map[3]= {0,2,1}; 161 int map[3]= {0,2,1};
162 w->cbp_table_index= map[cbp_index]; 162 w->cbp_table_index= map[cbp_index];
163 }else if(s->qscale <= 20){ 163 }else if(s->qscale <= 20){
164 int map[3]= {1,0,2}; 164 int map[3]= {1,0,2};
171 if(w->mspel_bit) put_bits(&s->pb, 1, s->mspel); 171 if(w->mspel_bit) put_bits(&s->pb, 1, s->mspel);
172 172
173 if(w->abt_flag){ 173 if(w->abt_flag){
174 put_bits(&s->pb, 1, w->per_mb_abt^1); 174 put_bits(&s->pb, 1, w->per_mb_abt^1);
175 if(!w->per_mb_abt){ 175 if(!w->per_mb_abt){
176 code012(&s->pb, w->abt_type); 176 ff_code012(&s->pb, w->abt_type);
177 } 177 }
178 } 178 }
179 179
180 if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table); 180 if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
181 181
182 if(!s->per_mb_rl_table){ 182 if(!s->per_mb_rl_table){
183 code012(&s->pb, s->rl_table_index); 183 ff_code012(&s->pb, s->rl_table_index);
184 s->rl_chroma_table_index = s->rl_table_index; 184 s->rl_chroma_table_index = s->rl_table_index;
185 } 185 }
186 put_bits(&s->pb, 1, s->dc_table_index); 186 put_bits(&s->pb, 1, s->dc_table_index);
187 put_bits(&s->pb, 1, s->mv_table_index); 187 put_bits(&s->pb, 1, s->mv_table_index);
188 188