comparison h263dec.c @ 6481:493dc59d469a libavcodec

add FF_ prefix to all (frame)_TYPE usage
author aurel
date Sun, 09 Mar 2008 23:31:02 +0000
parents 3cd8e50f4e1e
children 48759bfbd073
comparison
equal deleted inserted replaced
6480:6f01a499e785 6481:493dc59d469a
206 s->mv_type = MV_TYPE_16X16; 206 s->mv_type = MV_TYPE_16X16;
207 // s->mb_skipped = 0; 207 // s->mb_skipped = 0;
208 //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24)); 208 //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
209 ret= s->decode_mb(s, s->block); 209 ret= s->decode_mb(s, s->block);
210 210
211 if (s->pict_type!=B_TYPE) 211 if (s->pict_type!=FF_B_TYPE)
212 ff_h263_update_motion_val(s); 212 ff_h263_update_motion_val(s);
213 213
214 if(ret<0){ 214 if(ret<0){
215 const int xy= s->mb_x + s->mb_y*s->mb_stride; 215 const int xy= s->mb_x + s->mb_y*s->mb_stride;
216 if(ret==SLICE_END){ 216 if(ret==SLICE_END){
289 if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly 289 if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
290 int left= s->gb.size_in_bits - get_bits_count(&s->gb); 290 int left= s->gb.size_in_bits - get_bits_count(&s->gb);
291 int max_extra=7; 291 int max_extra=7;
292 292
293 /* no markers in M$ crap */ 293 /* no markers in M$ crap */
294 if(s->msmpeg4_version && s->pict_type==I_TYPE) 294 if(s->msmpeg4_version && s->pict_type==FF_I_TYPE)
295 max_extra+= 17; 295 max_extra+= 17;
296 296
297 /* buggy padding but the frame should still end approximately at the bitstream end */ 297 /* buggy padding but the frame should still end approximately at the bitstream end */
298 if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3) 298 if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3)
299 max_extra+= 48; 299 max_extra+= 48;
579 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) 579 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))
580 s->gob_index = ff_h263_get_gob_height(s); 580 s->gob_index = ff_h263_get_gob_height(s);
581 581
582 // for hurry_up==5 582 // for hurry_up==5
583 s->current_picture.pict_type= s->pict_type; 583 s->current_picture.pict_type= s->pict_type;
584 s->current_picture.key_frame= s->pict_type == I_TYPE; 584 s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
585 585
586 /* skip B-frames if we don't have reference frames */ 586 /* skip B-frames if we don't have reference frames */
587 if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size); 587 if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
588 /* skip b frames if we are in a hurry */ 588 /* skip b frames if we are in a hurry */
589 if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size); 589 if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return get_consumed_bytes(s, buf_size);
590 if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE) 590 if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
591 || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE) 591 || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
592 || avctx->skip_frame >= AVDISCARD_ALL) 592 || avctx->skip_frame >= AVDISCARD_ALL)
593 return get_consumed_bytes(s, buf_size); 593 return get_consumed_bytes(s, buf_size);
594 /* skip everything if we are in a hurry>=5 */ 594 /* skip everything if we are in a hurry>=5 */
595 if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size); 595 if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
596 596
597 if(s->next_p_frame_damaged){ 597 if(s->next_p_frame_damaged){
598 if(s->pict_type==B_TYPE) 598 if(s->pict_type==FF_B_TYPE)
599 return get_consumed_bytes(s, buf_size); 599 return get_consumed_bytes(s, buf_size);
600 else 600 else
601 s->next_p_frame_damaged=0; 601 s->next_p_frame_damaged=0;
602 } 602 }
603 603
604 if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==B_TYPE){ 604 if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==FF_B_TYPE){
605 s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab; 605 s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
606 s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab; 606 s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
607 }else if((!s->no_rounding) || s->pict_type==B_TYPE){ 607 }else if((!s->no_rounding) || s->pict_type==FF_B_TYPE){
608 s->me.qpel_put= s->dsp.put_qpel_pixels_tab; 608 s->me.qpel_put= s->dsp.put_qpel_pixels_tab;
609 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; 609 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
610 }else{ 610 }else{
611 s->me.qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab; 611 s->me.qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;
612 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; 612 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
647 ff_mpeg4_clean_buffers(s); 647 ff_mpeg4_clean_buffers(s);
648 648
649 decode_slice(s); 649 decode_slice(s);
650 } 650 }
651 651
652 if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE) 652 if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==FF_I_TYPE)
653 if(!ENABLE_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){ 653 if(!ENABLE_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
654 s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR; 654 s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
655 } 655 }
656 656
657 /* divx 5.01+ bistream reorder stuff */ 657 /* divx 5.01+ bistream reorder stuff */
688 688
689 MPV_frame_end(s); 689 MPV_frame_end(s);
690 690
691 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); 691 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
692 assert(s->current_picture.pict_type == s->pict_type); 692 assert(s->current_picture.pict_type == s->pict_type);
693 if (s->pict_type == B_TYPE || s->low_delay) { 693 if (s->pict_type == FF_B_TYPE || s->low_delay) {
694 *pict= *(AVFrame*)s->current_picture_ptr; 694 *pict= *(AVFrame*)s->current_picture_ptr;
695 } else if (s->last_picture_ptr != NULL) { 695 } else if (s->last_picture_ptr != NULL) {
696 *pict= *(AVFrame*)s->last_picture_ptr; 696 *pict= *(AVFrame*)s->last_picture_ptr;
697 } 697 }
698 698