comparison mpegvideo.c @ 197:21abf1b20016 libavcodec

different fix, s->mbintra_table used only if h263_pred set. - patch by Michael Niedermayer <michaelni@gmx.at>
author arpi_esp
date Fri, 11 Jan 2002 22:07:12 +0000
parents 9ffa69cd4ed6
children 82ba367b1827
comparison
equal deleted inserted replaced
196:9ffa69cd4ed6 197:21abf1b20016
178 178
179 /* cbp values */ 179 /* cbp values */
180 s->coded_block = av_mallocz(y_size); 180 s->coded_block = av_mallocz(y_size);
181 if (!s->coded_block) 181 if (!s->coded_block)
182 goto fail; 182 goto fail;
183 }
184 183
185 /* which mb is a intra block */ 184 /* which mb is a intra block */
186 s->mbintra_table = av_mallocz(s->mb_width * s->mb_height); 185 s->mbintra_table = av_mallocz(s->mb_width * s->mb_height);
187 if (!s->mbintra_table) 186 if (!s->mbintra_table)
188 goto fail; 187 goto fail;
189 memset(s->mbintra_table, 1, s->mb_width * s->mb_height); 188 memset(s->mbintra_table, 1, s->mb_width * s->mb_height);
189 }
190 /* default structure is frame */ 190 /* default structure is frame */
191 s->picture_structure = PICT_FRAME; 191 s->picture_structure = PICT_FRAME;
192 192
193 /* init macroblock skip table */ 193 /* init macroblock skip table */
194 if (!s->encoding) { 194 if (!s->encoding) {
207 if (s->ac_val[0]) 207 if (s->ac_val[0])
208 free(s->ac_val[0]); 208 free(s->ac_val[0]);
209 if (s->coded_block) 209 if (s->coded_block)
210 free(s->coded_block); 210 free(s->coded_block);
211 if (s->mbintra_table) 211 if (s->mbintra_table)
212 { free(s->mbintra_table);s->mbintra_table=NULL; } 212 free(s->mbintra_table);
213 if (s->mbskip_table) 213 if (s->mbskip_table)
214 free(s->mbskip_table); 214 free(s->mbskip_table);
215 for(i=0;i<3;i++) { 215 for(i=0;i<3;i++) {
216 if (s->last_picture_base[i]) 216 if (s->last_picture_base[i])
217 free(s->last_picture_base[i]); 217 free(s->last_picture_base[i]);
232 free(s->motion_val); 232 free(s->motion_val);
233 if (s->h263_pred) { 233 if (s->h263_pred) {
234 free(s->dc_val[0]); 234 free(s->dc_val[0]);
235 free(s->ac_val[0]); 235 free(s->ac_val[0]);
236 free(s->coded_block); 236 free(s->coded_block);
237 { free(s->mbintra_table);s->mbintra_table=NULL; } 237 free(s->mbintra_table);
238 } 238 }
239 if (s->mbskip_table) 239 if (s->mbskip_table)
240 free(s->mbskip_table); 240 free(s->mbskip_table);
241 for(i=0;i<3;i++) { 241 for(i=0;i<3;i++) {
242 free(s->last_picture_base[i]); 242 free(s->last_picture_base[i]);
746 s->last_dc[0] = 128 << s->intra_dc_precision; 746 s->last_dc[0] = 128 << s->intra_dc_precision;
747 s->last_dc[1] = 128 << s->intra_dc_precision; 747 s->last_dc[1] = 128 << s->intra_dc_precision;
748 s->last_dc[2] = 128 << s->intra_dc_precision; 748 s->last_dc[2] = 128 << s->intra_dc_precision;
749 } 749 }
750 } 750 }
751 else 751 else if (s->h263_pred)
752 s->mbintra_table[mb_x + mb_y*s->mb_width]=1; 752 s->mbintra_table[mb_x + mb_y*s->mb_width]=1;
753 753
754 /* update motion predictor */ 754 /* update motion predictor */
755 if (s->out_format == FMT_H263) { 755 if (s->out_format == FMT_H263) {
756 int x, y, wrap; 756 int x, y, wrap;