Mercurial > libavcodec.hg
comparison mpegvideo.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 | 1f1a0e67b961 |
children | bde9b89ed72c |
comparison
equal
deleted
inserted
replaced
4966:e6d4d3d478d6 | 4967:6d45158e0249 |
---|---|
28 */ | 28 */ |
29 | 29 |
30 #include "avcodec.h" | 30 #include "avcodec.h" |
31 #include "dsputil.h" | 31 #include "dsputil.h" |
32 #include "mpegvideo.h" | 32 #include "mpegvideo.h" |
33 #include "msmpeg4.h" | |
33 #include "faandct.h" | 34 #include "faandct.h" |
34 #include <limits.h> | 35 #include <limits.h> |
35 | 36 |
36 #ifdef USE_FASTMEMCPY | 37 #ifdef USE_FASTMEMCPY |
37 #include "libvo/fastmemcpy.h" | 38 #include "libvo/fastmemcpy.h" |
1352 if (s->out_format == FMT_H261) | 1353 if (s->out_format == FMT_H261) |
1353 ff_h261_encode_init(s); | 1354 ff_h261_encode_init(s); |
1354 #endif | 1355 #endif |
1355 if (s->out_format == FMT_H263) | 1356 if (s->out_format == FMT_H263) |
1356 h263_encode_init(s); | 1357 h263_encode_init(s); |
1357 if(s->msmpeg4_version) | 1358 if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version) |
1358 ff_msmpeg4_encode_init(s); | 1359 ff_msmpeg4_encode_init(s); |
1359 if (s->out_format == FMT_MPEG1) | 1360 if (s->out_format == FMT_MPEG1) |
1360 ff_mpeg1_encode_init(s); | 1361 ff_mpeg1_encode_init(s); |
1361 | 1362 |
1362 /* init q matrix */ | 1363 /* init q matrix */ |
3550 }else if(s->quarter_sample){ | 3551 }else if(s->quarter_sample){ |
3551 qpel_motion(s, dest_y, dest_cb, dest_cr, | 3552 qpel_motion(s, dest_y, dest_cb, dest_cr, |
3552 0, 0, 0, | 3553 0, 0, 0, |
3553 ref_picture, pix_op, qpix_op, | 3554 ref_picture, pix_op, qpix_op, |
3554 s->mv[dir][0][0], s->mv[dir][0][1], 16); | 3555 s->mv[dir][0][0], s->mv[dir][0][1], 16); |
3555 }else if(s->mspel){ | 3556 }else if(ENABLE_WMV2 && s->mspel){ |
3556 ff_mspel_motion(s, dest_y, dest_cb, dest_cr, | 3557 ff_mspel_motion(s, dest_y, dest_cb, dest_cr, |
3557 ref_picture, pix_op, | 3558 ref_picture, pix_op, |
3558 s->mv[dir][0][0], s->mv[dir][0][1], 16); | 3559 s->mv[dir][0][0], s->mv[dir][0][1], 16); |
3559 }else | 3560 }else |
3560 { | 3561 { |
4074 add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize); | 4075 add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize); |
4075 } | 4076 } |
4076 } | 4077 } |
4077 }//fi gray | 4078 }//fi gray |
4078 } | 4079 } |
4079 else{ | 4080 else if (ENABLE_WMV2) { |
4080 ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr); | 4081 ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr); |
4081 } | 4082 } |
4082 } else { | 4083 } else { |
4083 /* dct only in intra block */ | 4084 /* dct only in intra block */ |
4084 if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){ | 4085 if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){ |
4579 case CODEC_ID_MPEG4: | 4580 case CODEC_ID_MPEG4: |
4580 mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; | 4581 mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; |
4581 case CODEC_ID_MSMPEG4V2: | 4582 case CODEC_ID_MSMPEG4V2: |
4582 case CODEC_ID_MSMPEG4V3: | 4583 case CODEC_ID_MSMPEG4V3: |
4583 case CODEC_ID_WMV1: | 4584 case CODEC_ID_WMV1: |
4585 if (ENABLE_MSMPEG4_ENCODER) | |
4584 msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; | 4586 msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; |
4585 case CODEC_ID_WMV2: | 4587 case CODEC_ID_WMV2: |
4588 if (ENABLE_WMV2_ENCODER) | |
4586 ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; | 4589 ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; |
4587 #ifdef CONFIG_H261_ENCODER | 4590 #ifdef CONFIG_H261_ENCODER |
4588 case CODEC_ID_H261: | 4591 case CODEC_ID_H261: |
4589 ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; | 4592 ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; |
4590 #endif | 4593 #endif |
5506 //printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb)); | 5509 //printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb)); |
5507 } | 5510 } |
5508 } | 5511 } |
5509 | 5512 |
5510 //not beautiful here but we must write it before flushing so it has to be here | 5513 //not beautiful here but we must write it before flushing so it has to be here |
5511 if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == I_TYPE) | 5514 if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == I_TYPE) |
5512 msmpeg4_encode_ext_header(s); | 5515 msmpeg4_encode_ext_header(s); |
5513 | 5516 |
5514 write_slice_end(s); | 5517 write_slice_end(s); |
5515 | 5518 |
5516 /* Send the last GOB if RTP */ | 5519 /* Send the last GOB if RTP */ |
5770 case FMT_H261: | 5773 case FMT_H261: |
5771 ff_h261_encode_picture_header(s, picture_number); | 5774 ff_h261_encode_picture_header(s, picture_number); |
5772 break; | 5775 break; |
5773 #endif | 5776 #endif |
5774 case FMT_H263: | 5777 case FMT_H263: |
5775 if (s->codec_id == CODEC_ID_WMV2) | 5778 if (ENABLE_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2) |
5776 ff_wmv2_encode_picture_header(s, picture_number); | 5779 ff_wmv2_encode_picture_header(s, picture_number); |
5777 else if (s->h263_msmpeg4) | 5780 else if (ENABLE_MSMPEG4_ENCODER && s->h263_msmpeg4) |
5778 msmpeg4_encode_picture_header(s, picture_number); | 5781 msmpeg4_encode_picture_header(s, picture_number); |
5779 else if (s->h263_pred) | 5782 else if (s->h263_pred) |
5780 mpeg4_encode_picture_header(s, picture_number); | 5783 mpeg4_encode_picture_header(s, picture_number); |
5781 #ifdef CONFIG_RV10_ENCODER | 5784 #ifdef CONFIG_RV10_ENCODER |
5782 else if (s->codec_id == CODEC_ID_RV10) | 5785 else if (s->codec_id == CODEC_ID_RV10) |