comparison h264.c @ 2758:a7925aaeea1e libavcodec

10l (dont read variables before they have been set)
author michael
date Sun, 05 Jun 2005 15:51:20 +0000
parents fa1c8955e291
children 64333ef1ca21
comparison
equal deleted inserted replaced
2757:fa1c8955e291 2758:a7925aaeea1e
2996 // set defaults 2996 // set defaults
2997 // s->decode_mb= ff_h263_decode_mb; 2997 // s->decode_mb= ff_h263_decode_mb;
2998 s->low_delay= 1; 2998 s->low_delay= 1;
2999 avctx->pix_fmt= PIX_FMT_YUV420P; 2999 avctx->pix_fmt= PIX_FMT_YUV420P;
3000 3000
3001 if(s->dsp.h264_idct_add == ff_h264_idct_add_c){ //FIXME little ugly
3002 memcpy(h->zigzag_scan, zigzag_scan, 16*sizeof(uint8_t));
3003 memcpy(h-> field_scan, field_scan, 16*sizeof(uint8_t));
3004 }else{
3005 int i;
3006 for(i=0; i<16; i++){
3007 #define T(x) (x>>2) | ((x<<2) & 0xF)
3008 h->zigzag_scan[i] = T(zigzag_scan[i]);
3009 h-> field_scan[i] = T( field_scan[i]);
3010 }
3011 }
3012
3013 decode_init_vlc(h); 3001 decode_init_vlc(h);
3014 3002
3015 if(avctx->extradata_size > 0 && avctx->extradata && 3003 if(avctx->extradata_size > 0 && avctx->extradata &&
3016 *(char *)avctx->extradata == 1){ 3004 *(char *)avctx->extradata == 1){
3017 h->is_avc = 1; 3005 h->is_avc = 1;
4171 MPV_common_end(s); 4159 MPV_common_end(s);
4172 } 4160 }
4173 if (!s->context_initialized) { 4161 if (!s->context_initialized) {
4174 if (MPV_common_init(s) < 0) 4162 if (MPV_common_init(s) < 0)
4175 return -1; 4163 return -1;
4164
4165 if(s->dsp.h264_idct_add == ff_h264_idct_add_c){ //FIXME little ugly
4166 memcpy(h->zigzag_scan, zigzag_scan, 16*sizeof(uint8_t));
4167 memcpy(h-> field_scan, field_scan, 16*sizeof(uint8_t));
4168 }else{
4169 int i;
4170 for(i=0; i<16; i++){
4171 #define T(x) (x>>2) | ((x<<2) & 0xF)
4172 h->zigzag_scan[i] = T(zigzag_scan[i]);
4173 h-> field_scan[i] = T( field_scan[i]);
4174 }
4175 }
4176 4176
4177 alloc_tables(h); 4177 alloc_tables(h);
4178 4178
4179 s->avctx->width = s->width; 4179 s->avctx->width = s->width;
4180 s->avctx->height = s->height; 4180 s->avctx->height = s->height;