Commit 8b975b7c authored by Michael Niedermayer's avatar Michael Niedermayer

put most codecs under ifdefs

Originally committed as revision 4173 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5cc9a6dc
......@@ -14,17 +14,166 @@ OBJS= bitstream.o utils.o mem.o allcodecs.o \
mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \
motion_est.o imgconvert.o imgresample.o \
mpeg12.o mpegaudiodec.o pcm.o simple_idct.o \
ratecontrol.o adpcm.o eval.o dv.o error_resilience.o \
fft.o mdct.o mace.o huffyuv.o cyuv.o raw.o h264.o golomb.o \
vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o \
roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o \
msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o \
smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o \
flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o h264idct.o \
qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o h261.o \
msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o shorten.o loco.o \
alac.o wnv1.o ws-snd1.o aasc.o indeo2.o
ratecontrol.o adpcm.o eval.o error_resilience.o \
fft.o mdct.o raw.o golomb.o cabac.o\
dpcm.o adx.o rational.o faandct.o parser.o g726.o \
vp3dsp.o integer.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o
ifeq ($(CONFIG_AASC_DECODER),yes)
OBJS+= aasc.o
endif
ifeq ($(CONFIG_ALAC_DECODER),yes)
OBJS+= alac.o
endif
ifneq ($(CONFIG_ASV1_DECODER)$(CONFIG_ASV1_ENCODER)$(CONFIG_ASV2_DECODER)$(CONFIG_ASV2_ENCODER),)
OBJS+= asv1.o
endif
ifeq ($(CONFIG_CINEPAK_DECODER),yes)
OBJS+= cinepak.o
endif
ifneq ($(CONFIG_CLJR_DECODER)$(CONFIG_CLJR_ENCODER),)
OBJS+= cljr.o
endif
ifeq ($(CONFIG_CYUV_DECODER),yes)
OBJS+= cyuv.o
endif
ifneq ($(CONFIG_DVVIDEO_DECODER)$(CONFIG_DVVIDEO_ENCODER),)
OBJS+= dv.o
endif
ifeq ($(CONFIG_EIGHTBPS_DECODER),yes)
OBJS+= 8bps.o
endif
ifneq ($(CONFIG_FFV1_DECODER)$(CONFIG_FFV1_ENCODER),)
OBJS+= ffv1.o
endif
ifeq ($(CONFIG_FLAC_DECODER),yes)
OBJS+= flac.o
endif
ifeq ($(CONFIG_FLIC_DECODER),yes)
OBJS+= flicvideo.o
endif
ifeq ($(CONFIG_FOURXM_DECODER),yes)
OBJS+= 4xm.o
endif
ifneq ($(CONFIG_H261_DECODER)$(CONFIG_H261_ENCODER),)
OBJS+= h261.o
endif
ifneq ($(CONFIG_H264_DECODER)$(CONFIG_SVQ3_DECODER),)
OBJS+= h264.o
endif
ifneq ($(CONFIG_HUFFYUV_DECODER)$(CONFIG_HUFFYUV_ENCODER)$(CONFIG_FFVHUFF_DECODER)$(CONFIG_FFVHUFF_ENCODER),)
OBJS+= huffyuv.o
endif
ifeq ($(CONFIG_IDCIN_DECODER),yes)
OBJS+= idcinvideo.o
endif
ifeq ($(CONFIG_INDEO2_DECODER),yes)
OBJS+= indeo2.o
endif
ifeq ($(CONFIG_INDEO3_DECODER),yes)
OBJS+= indeo3.o
endif
ifeq ($(CONFIG_INTERPLAY_VIDEO_DECODER),yes)
OBJS+= interplayvideo.o
endif
ifneq ($(CONFIG_MSZH_DECODER)$(CONFIG_ZLIB_DECODER)$(CONFIG_ZLIB_ENCODER),)
OBJS+= lcl.o
endif
ifeq ($(CONFIG_LOCO_DECODER),yes)
OBJS+= loco.o
endif
ifneq ($(CONFIG_MACE3_DECODER)$(CONFIG_MACE6_DECODER),)
OBJS+= mace.o
endif
ifeq ($(CONFIG_MSRLE_DECODER),yes)
OBJS+= msrle.o
endif
ifeq ($(CONFIG_MSVIDEO1_DECODER),yes)
OBJS+= msvideo1.o
endif
ifneq ($(CONFIG_PNG_DECODER)$(CONFIG_PNG_ENCODER),)
OBJS+= png.o
endif
ifeq ($(CONFIG_QDRAW_DECODER),yes)
OBJS+= qdrw.o
endif
ifeq ($(CONFIG_QPEG_DECODER),yes)
OBJS+= qpeg.o
endif
ifeq ($(CONFIG_QTRLE_DECODER),yes)
OBJS+= qtrle.o
endif
ifeq ($(CONFIG_RA_144_DECODER),yes)
OBJS+= ra144.o
endif
ifeq ($(CONFIG_RA_288_DECODER),yes)
OBJS+= ra288.o
endif
ifeq ($(CONFIG_ROQ_DECODER),yes)
OBJS+= roqvideo.o
endif
ifeq ($(CONFIG_RPZA_DECODER),yes)
OBJS+= rpza.o
endif
ifneq ($(CONFIG_RV10_DECODER)$(CONFIG_RV20_DECODER)$(CONFIG_RV10_ENCODER)$(CONFIG_RV20_ENCODER),)
OBJS+= rv10.o
endif
ifeq ($(CONFIG_SHORTEN_DECODER),yes)
OBJS+= shorten.o
endif
ifeq ($(CONFIG_SMC_DECODER),yes)
OBJS+= smc.o
endif
ifneq ($(CONFIG_SNOW_DECODER)$(CONFIG_Snow_ENCODER),)
OBJS+= snow.o
endif
ifneq ($(CONFIG_SONIC_DECODER)$(CONFIG_SONIC_ENCODER)$(CONFIG_SONIC_LS_ENCODER),)
OBJS+= sonic.o
endif
ifneq ($(CONFIG_SVQ1_DECODER)$(CONFIG_SVQ1_ENCODER),)
OBJS+= svq1.o
endif
ifeq ($(CONFIG_TRUEMOTION1_DECODER),yes)
OBJS+= truemotion1.o
endif
ifeq ($(CONFIG_TSCC_DECODER),yes)
OBJS+= tscc.o
endif
ifeq ($(CONFIG_ULTI_DECODER),yes)
OBJS+= ulti.o
endif
ifneq ($(CONFIG_VC9_DECODER)$(CONFIG_WMV3_DECODER),)
OBJS+= vc9.o
endif
ifneq ($(CONFIG_VCR1_DECODER)$(CONFIG_VCR1_ENCODER),)
OBJS+= vcr1.o
endif
ifneq ($(CONFIG_VMDVIDEO_DECODER)$(CONFIG_VMDAUDIO_DECODER),)
OBJS+= vmdav.o
endif
ifneq ($(CONFIG_VP3_DECODER)$(CONFIG_THEORA_DECODER),)
OBJS+= vp3.o
endif
ifeq ($(CONFIG_VQA_DECODER),yes)
OBJS+= vqavideo.o
endif
ifneq ($(CONFIG_WMAV1_DECODER)$(CONFIG_WMAV2_DECODER),)
OBJS+= wmadec.o
endif
ifeq ($(CONFIG_WNV1_DECODER),yes)
OBJS+= wnv1.o
endif
ifeq ($(CONFIG_WS_SND1_DECODER),yes)
OBJS+= ws-snd1.o
endif
ifneq ($(CONFIG_XAN_WC3_DECODER)$(CONFIG_XAN_WC4_DECODER),)
OBJS+= xan.o
endif
ifeq ($(CONFIG_XL_DECODER),yes)
OBJS+= xl.o
endif
AMROBJS=
ifeq ($(AMR_NB),yes)
ifeq ($(AMR_NB_FIXED),yes)
......
......@@ -542,9 +542,13 @@ PCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
/* parsers */
av_register_codec_parser(&mpegvideo_parser);
av_register_codec_parser(&mpeg4video_parser);
#if defined(CONFIG_H261_DECODER) || defined(CONFIG_H261_ENCODER)
av_register_codec_parser(&h261_parser);
#endif
av_register_codec_parser(&h263_parser);
#ifdef CONFIG_H264_DECODER
av_register_codec_parser(&h264_parser);
#endif
av_register_codec_parser(&mjpeg_parser);
av_register_codec_parser(&pnm_parser);
......
......@@ -292,6 +292,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){
#ifdef CONFIG_SNOW_ENCODER //idwt is in snow.c
int s, i, j;
const int dec_count= w==8 ? 3 : 4;
int tmp[16*16];
......@@ -338,6 +339,7 @@ static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, in
pix1 += line_size;
pix2 += line_size;
}
ff_spatial_dwt(tmp, w, h, 16, type, dec_count);
s=0;
......@@ -369,6 +371,7 @@ static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, in
assert(s>=0);
return s>>2;
#endif
}
static int w53_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
......
......@@ -4567,6 +4567,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
} else if (s->mb_intra) {
/* DC coef */
if(s->codec_id == CODEC_ID_RV10){
#ifdef CONFIG_RV10_DECODER
if (s->rv10_version == 3 && s->pict_type == I_TYPE) {
int component, diff;
component = (n <= 3 ? 0 : n - 4 + 1);
......@@ -4586,6 +4587,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
if (level == 255)
level = 128;
}
#endif
}else{
level = get_bits(&s->gb, 8);
if((level&0x7F) == 0){
......
......@@ -1258,8 +1258,10 @@ int MPV_encode_init(AVCodecContext *avctx)
ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
#ifdef CONFIG_H261_ENCODER
if (s->out_format == FMT_H261)
ff_h261_encode_init(s);
#endif
if (s->out_format == FMT_H263)
h263_encode_init(s);
if(s->msmpeg4_version)
......@@ -2821,9 +2823,11 @@ if(s->quarter_sample)
pix_op[s->chroma_x_shift][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
pix_op[s->chroma_x_shift][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
}
#if defined(CONFIG_H261_ENCODER) || defined(CONFIG_H261_DECODER)
if(s->out_format == FMT_H261){
ff_h261_loop_filter(s);
}
#endif
}
/* apply one mpeg motion vector to the three components */
......@@ -4289,8 +4293,10 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
case CODEC_ID_WMV2:
ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break;
#ifdef CONFIG_H261_ENCODER
case CODEC_ID_H261:
ff_h261_encode_mb(s, s->block, motion_x, motion_y); break;
#endif
case CODEC_ID_H263:
case CODEC_ID_H263P:
case CODEC_ID_FLV1:
......@@ -4684,11 +4690,13 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->mb_y = mb_y; // moved into loop, can get changed by H.261
ff_update_block_index(s);
#ifdef CONFIG_H261_ENCODER
if(s->codec_id == CODEC_ID_H261){
ff_h261_reorder_mb_index(s);
xy= s->mb_y*s->mb_stride + s->mb_x;
mb_type= s->mb_type[xy];
}
#endif
/* write gob / video packet header */
if(s->rtp_mode){
......@@ -5391,9 +5399,11 @@ static void encode_picture(MpegEncContext *s, int picture_number)
case FMT_MJPEG:
mjpeg_picture_header(s);
break;
#ifdef CONFIG_H261_ENCODER
case FMT_H261:
ff_h261_encode_picture_header(s, picture_number);
break;
#endif
case FMT_H263:
if (s->codec_id == CODEC_ID_WMV2)
ff_wmv2_encode_picture_header(s, picture_number);
......@@ -5401,10 +5411,14 @@ static void encode_picture(MpegEncContext *s, int picture_number)
msmpeg4_encode_picture_header(s, picture_number);
else if (s->h263_pred)
mpeg4_encode_picture_header(s, picture_number);
#ifdef CONFIG_RV10_ENCODER
else if (s->codec_id == CODEC_ID_RV10)
rv10_encode_picture_header(s, picture_number);
#endif
#ifdef CONFIG_RV20_ENCODER
else if (s->codec_id == CODEC_ID_RV20)
rv20_encode_picture_header(s, picture_number);
#endif
else if (s->codec_id == CODEC_ID_FLV1)
ff_flv_encode_picture_header(s, picture_number);
else
......
......@@ -177,10 +177,12 @@ static void common_init(MpegEncContext * s)
s->y_dc_scale_table= wmv1_y_dc_scale_table;
s->c_dc_scale_table= wmv1_c_dc_scale_table;
break;
#if defined(CONFIG_WMV3_DECODER)||defined(CONFIG_VC9_DECODER)
case 6:
s->y_dc_scale_table= wmv3_dc_scale_table;
s->c_dc_scale_table= wmv3_dc_scale_table;
break;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment