comparison h263dec.c @ 4967:6d45158e0249 libavcodec

disable reference to msmpeg4 and wmv2 code when those codecs are not compiled in
author aurel
date Thu, 10 May 2007 13:11:36 +0000
parents 3fcb2f0d9ef1
children 4dbe6578f811
comparison
equal deleted inserted replaced
4966:e6d4d3d478d6 4967:6d45158e0249
28 #include "avcodec.h" 28 #include "avcodec.h"
29 #include "dsputil.h" 29 #include "dsputil.h"
30 #include "mpegvideo.h" 30 #include "mpegvideo.h"
31 #include "h263_parser.h" 31 #include "h263_parser.h"
32 #include "mpeg4video_parser.h" 32 #include "mpeg4video_parser.h"
33 #include "msmpeg4.h"
33 34
34 //#define DEBUG 35 //#define DEBUG
35 //#define PRINT_FRAME_TIME 36 //#define PRINT_FRAME_TIME
36 37
37 int ff_h263_decode_init(AVCodecContext *avctx) 38 int ff_h263_decode_init(AVCodecContext *avctx)
108 /* for h263, we allocate the images after having read the header */ 109 /* for h263, we allocate the images after having read the header */
109 if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4) 110 if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
110 if (MPV_common_init(s) < 0) 111 if (MPV_common_init(s) < 0)
111 return -1; 112 return -1;
112 113
113 if (s->h263_msmpeg4) 114 if (ENABLE_MSMPEG4_DECODER && s->h263_msmpeg4)
114 ff_msmpeg4_decode_init(s); 115 ff_msmpeg4_decode_init(s);
115 else 116 else
116 h263_decode_init_vlc(s); 117 h263_decode_init_vlc(s);
117 118
118 return 0; 119 return 0;
386 int i= ff_find_unused_picture(s, 0); 387 int i= ff_find_unused_picture(s, 0);
387 s->current_picture_ptr= &s->picture[i]; 388 s->current_picture_ptr= &s->picture[i];
388 } 389 }
389 390
390 /* let's go :-) */ 391 /* let's go :-) */
391 if (s->msmpeg4_version==5) { 392 if (ENABLE_WMV2_DECODER && s->msmpeg4_version==5) {
392 ret= ff_wmv2_decode_picture_header(s); 393 ret= ff_wmv2_decode_picture_header(s);
393 } else if (s->msmpeg4_version) { 394 } else if (ENABLE_MSMPEG4_DECODER && s->msmpeg4_version) {
394 ret = msmpeg4_decode_picture_header(s); 395 ret = msmpeg4_decode_picture_header(s);
395 } else if (s->h263_pred) { 396 } else if (s->h263_pred) {
396 if(s->avctx->extradata_size && s->picture_number==0){ 397 if(s->avctx->extradata_size && s->picture_number==0){
397 GetBitContext gb; 398 GetBitContext gb;
398 399
620 ff_er_frame_start(s); 621 ff_er_frame_start(s);
621 622
622 //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type 623 //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type
623 //which isnt available before MPV_frame_start() 624 //which isnt available before MPV_frame_start()
624 if (s->msmpeg4_version==5){ 625 if (s->msmpeg4_version==5){
625 if(ff_wmv2_decode_secondary_picture_header(s) < 0) 626 if(!ENABLE_WMV2_DECODER || ff_wmv2_decode_secondary_picture_header(s) < 0)
626 return -1; 627 return -1;
627 } 628 }
628 629
629 /* decode each macroblock */ 630 /* decode each macroblock */
630 s->mb_x=0; 631 s->mb_x=0;
645 646
646 decode_slice(s); 647 decode_slice(s);
647 } 648 }
648 649
649 if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE) 650 if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE)
650 if(msmpeg4_decode_ext_header(s, buf_size) < 0){ 651 if(!ENABLE_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
651 s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR; 652 s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
652 } 653 }
653 654
654 /* divx 5.01+ bistream reorder stuff */ 655 /* divx 5.01+ bistream reorder stuff */
655 if(s->codec_id==CODEC_ID_MPEG4 && s->bitstream_buffer_size==0 && s->divx_packed){ 656 if(s->codec_id==CODEC_ID_MPEG4 && s->bitstream_buffer_size==0 && s->divx_packed){