Revision 15025553

View differences:

libavcodec/h263dec.c
30 30
#include "mpegvideo.h"
31 31
#include "h263_parser.h"
32 32
#include "mpeg4video_parser.h"
33
#include "msmpeg4.h"
33 34

  
34 35
//#define DEBUG
35 36
//#define PRINT_FRAME_TIME
......
110 111
        if (MPV_common_init(s) < 0)
111 112
            return -1;
112 113

  
113
    if (s->h263_msmpeg4)
114
    if (ENABLE_MSMPEG4_DECODER && s->h263_msmpeg4)
114 115
        ff_msmpeg4_decode_init(s);
115 116
    else
116 117
        h263_decode_init_vlc(s);
......
388 389
    }
389 390

  
390 391
    /* let's go :-) */
391
    if (s->msmpeg4_version==5) {
392
    if (ENABLE_WMV2_DECODER && s->msmpeg4_version==5) {
392 393
        ret= ff_wmv2_decode_picture_header(s);
393
    } else if (s->msmpeg4_version) {
394
    } else if (ENABLE_MSMPEG4_DECODER && s->msmpeg4_version) {
394 395
        ret = msmpeg4_decode_picture_header(s);
395 396
    } else if (s->h263_pred) {
396 397
        if(s->avctx->extradata_size && s->picture_number==0){
......
622 623
    //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type
623 624
    //which isnt available before MPV_frame_start()
624 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 627
            return -1;
627 628
    }
628 629

  
......
647 648
    }
648 649

  
649 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 652
            s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
652 653
        }
653 654

  
libavcodec/mpegvideo.c
30 30
#include "avcodec.h"
31 31
#include "dsputil.h"
32 32
#include "mpegvideo.h"
33
#include "msmpeg4.h"
33 34
#include "faandct.h"
34 35
#include <limits.h>
35 36

  
......
1354 1355
#endif
1355 1356
    if (s->out_format == FMT_H263)
1356 1357
        h263_encode_init(s);
1357
    if(s->msmpeg4_version)
1358
    if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version)
1358 1359
        ff_msmpeg4_encode_init(s);
1359 1360
    if (s->out_format == FMT_MPEG1)
1360 1361
        ff_mpeg1_encode_init(s);
......
3552 3553
                        0, 0, 0,
3553 3554
                        ref_picture, pix_op, qpix_op,
3554 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 3557
            ff_mspel_motion(s, dest_y, dest_cb, dest_cr,
3557 3558
                        ref_picture, pix_op,
3558 3559
                        s->mv[dir][0][0], s->mv[dir][0][1], 16);
......
4076 4077
                    }
4077 4078
                }//fi gray
4078 4079
            }
4079
            else{
4080
            else if (ENABLE_WMV2) {
4080 4081
                ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr);
4081 4082
            }
4082 4083
        } else {
......
4581 4582
    case CODEC_ID_MSMPEG4V2:
4582 4583
    case CODEC_ID_MSMPEG4V3:
4583 4584
    case CODEC_ID_WMV1:
4585
        if (ENABLE_MSMPEG4_ENCODER)
4584 4586
        msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
4585 4587
    case CODEC_ID_WMV2:
4588
        if (ENABLE_WMV2_ENCODER)
4586 4589
         ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break;
4587 4590
#ifdef CONFIG_H261_ENCODER
4588 4591
    case CODEC_ID_H261:
......
5508 5511
    }
5509 5512

  
5510 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 5515
        msmpeg4_encode_ext_header(s);
5513 5516

  
5514 5517
    write_slice_end(s);
......
5772 5775
        break;
5773 5776
#endif
5774 5777
    case FMT_H263:
5775
        if (s->codec_id == CODEC_ID_WMV2)
5778
        if (ENABLE_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2)
5776 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 5781
            msmpeg4_encode_picture_header(s, picture_number);
5779 5782
        else if (s->h263_pred)
5780 5783
            mpeg4_encode_picture_header(s, picture_number);
libavcodec/msmpeg4.h
1
/*
2
 * MSMPEG4 backend for ffmpeg encoder and decoder
3
 * copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
4
 *
5
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * FFmpeg is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with FFmpeg; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 */
21

  
22
/**
23
 * @file msmpeg4.h
24
 */
25

  
26
#ifndef MSMPEG4_H
27
#define MSMPEG4_H
28

  
29
#include "config.h"
30

  
31
#define ENABLE_MSMPEG4_DECODER (ENABLE_MSMPEG4V1_DECODER || \
32
                                ENABLE_MSMPEG4V2_DECODER || \
33
                                ENABLE_MSMPEG4V3_DECODER || \
34
                                ENABLE_WMV2_DECODER)
35
#define ENABLE_MSMPEG4_ENCODER (ENABLE_MSMPEG4V1_ENCODER || \
36
                                ENABLE_MSMPEG4V2_ENCODER || \
37
                                ENABLE_MSMPEG4V3_ENCODER || \
38
                                ENABLE_WMV2_ENCODER)
39
#define ENABLE_MSMPEG4 (ENABLE_MSMPEG4_DECODER || ENABLE_MSMPEG4_ENCODER)
40
#define ENABLE_WMV2 (ENABLE_WMV2_DECODER || ENABLE_WMV2_ENCODER)
41

  
42
#endif /* MSMPEG4_H */

Also available in: Unified diff