comparison h264.c @ 2674:58fb8e1efcae libavcodec

10l (mb_type uninitalized and then changed and overwritten)
author michael
date Fri, 13 May 2005 08:17:25 +0000
parents 6f04c7a5bf24
children c6aa5585954f
comparison
equal deleted inserted replaced
2673:6f04c7a5bf24 2674:58fb8e1efcae
4189 * decodes a P_SKIP or B_SKIP macroblock 4189 * decodes a P_SKIP or B_SKIP macroblock
4190 */ 4190 */
4191 static void decode_mb_skip(H264Context *h){ 4191 static void decode_mb_skip(H264Context *h){
4192 MpegEncContext * const s = &h->s; 4192 MpegEncContext * const s = &h->s;
4193 const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; 4193 const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
4194 int mb_type; 4194 int mb_type=0;
4195 4195
4196 memset(h->non_zero_count[mb_xy], 0, 16); 4196 memset(h->non_zero_count[mb_xy], 0, 16);
4197 memset(h->non_zero_count_cache + 8, 0, 8*5); //FIXME ugly, remove pfui 4197 memset(h->non_zero_count_cache + 8, 0, 8*5); //FIXME ugly, remove pfui
4198 4198
4199 if(h->mb_aff_frame && s->mb_skip_run==0 && (s->mb_y&1)==0){ 4199 if(h->mb_aff_frame && s->mb_skip_run==0 && (s->mb_y&1)==0){
4200 h->mb_field_decoding_flag= get_bits1(&s->gb); 4200 h->mb_field_decoding_flag= get_bits1(&s->gb);
4201 } 4201 }
4202 if(h->mb_field_decoding_flag) 4202 if(h->mb_field_decoding_flag)
4203 mb_type|= MB_TYPE_INTERLACED; 4203 mb_type|= MB_TYPE_INTERLACED;
4204 4204
4205 if( h->slice_type == B_TYPE ) 4205 if( h->slice_type == B_TYPE )
4206 { 4206 {
4207 // just for fill_caches. pred_direct_motion will set the real mb_type 4207 // just for fill_caches. pred_direct_motion will set the real mb_type
4208 mb_type= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; 4208 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
4209 4209
4210 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... 4210 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ...
4211 pred_direct_motion(h, &mb_type); 4211 pred_direct_motion(h, &mb_type);
4212 if(h->pps.cabac){ 4212 if(h->pps.cabac){
4213 fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4); 4213 fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4);
4215 } 4215 }
4216 } 4216 }
4217 else 4217 else
4218 { 4218 {
4219 int mx, my; 4219 int mx, my;
4220 mb_type= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP; 4220 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
4221 4221
4222 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... 4222 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ...
4223 pred_pskip_motion(h, &mx, &my); 4223 pred_pskip_motion(h, &mx, &my);
4224 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1); 4224 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
4225 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4); 4225 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4);