Commit f6993c9f authored by Aurelien Jacobs's avatar Aurelien Jacobs

make compilation of mjpeg.c optional

Originally committed as revision 9011 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cd61e407
...@@ -13,7 +13,6 @@ OBJS= bitstream.o \ ...@@ -13,7 +13,6 @@ OBJS= bitstream.o \
jrevdct.o \ jrevdct.o \
jfdctfst.o \ jfdctfst.o \
jfdctint.o\ jfdctint.o\
mjpeg.o \
resample.o \ resample.o \
resample2.o \ resample2.o \
dsputil.o \ dsputil.o \
...@@ -101,10 +100,15 @@ OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o ...@@ -101,10 +100,15 @@ OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_JPEGLS_ENCODER) += mjpeg.o
OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o
OBJS-$(CONFIG_LJPEG_ENCODER) += mjpeg.o
OBJS-$(CONFIG_LOCO_DECODER) += loco.o OBJS-$(CONFIG_LOCO_DECODER) += loco.o
OBJS-$(CONFIG_MACE3_DECODER) += mace.o OBJS-$(CONFIG_MACE3_DECODER) += mace.o
OBJS-$(CONFIG_MACE6_DECODER) += mace.o OBJS-$(CONFIG_MACE6_DECODER) += mace.o
OBJS-$(CONFIG_MJPEG_DECODER) += mjpeg.o
OBJS-$(CONFIG_MJPEG_ENCODER) += mjpeg.o mpegvideo.o
OBJS-$(CONFIG_MJPEGB_DECODER) += mjpeg.o
OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
OBJS-$(CONFIG_MP2_ENCODER) += mpegaudio.o OBJS-$(CONFIG_MP2_ENCODER) += mpegaudio.o
OBJS-$(CONFIG_MPC7_DECODER) += mpc.o OBJS-$(CONFIG_MPC7_DECODER) += mpc.o
...@@ -152,12 +156,14 @@ OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o ...@@ -152,12 +156,14 @@ OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
OBJS-$(CONFIG_SONIC_LS_DECODER) += sonic.o OBJS-$(CONFIG_SONIC_LS_DECODER) += sonic.o
OBJS-$(CONFIG_SP5X_DECODER) += mjpeg.o
OBJS-$(CONFIG_SVQ1_DECODER) += svq1.o OBJS-$(CONFIG_SVQ1_DECODER) += svq1.o
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1.o OBJS-$(CONFIG_SVQ1_ENCODER) += svq1.o
OBJS-$(CONFIG_SVQ3_DECODER) += h264.o OBJS-$(CONFIG_SVQ3_DECODER) += h264.o
OBJS-$(CONFIG_TARGA_DECODER) += targa.o OBJS-$(CONFIG_TARGA_DECODER) += targa.o
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
OBJS-$(CONFIG_THEORA_DECODER) += vp3.o xiph.o OBJS-$(CONFIG_THEORA_DECODER) += vp3.o xiph.o
OBJS-$(CONFIG_THP_DECODER) += mjpeg.o
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o
......
...@@ -1205,7 +1205,7 @@ int MPV_encode_init(AVCodecContext *avctx) ...@@ -1205,7 +1205,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s->mjpeg_hsample[0] = 2; s->mjpeg_hsample[0] = 2;
s->mjpeg_hsample[1] = 2>>chroma_h_shift; s->mjpeg_hsample[1] = 2>>chroma_h_shift;
s->mjpeg_hsample[2] = 2>>chroma_h_shift; s->mjpeg_hsample[2] = 2>>chroma_h_shift;
if (mjpeg_init(s) < 0) if (!(ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) || mjpeg_init(s) < 0)
return -1; return -1;
avctx->delay=0; avctx->delay=0;
s->low_delay=1; s->low_delay=1;
...@@ -1401,7 +1401,7 @@ int MPV_encode_end(AVCodecContext *avctx) ...@@ -1401,7 +1401,7 @@ int MPV_encode_end(AVCodecContext *avctx)
ff_rate_control_uninit(s); ff_rate_control_uninit(s);
MPV_common_end(s); MPV_common_end(s);
if (s->out_format == FMT_MJPEG) if ((ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) && s->out_format == FMT_MJPEG)
mjpeg_close(s); mjpeg_close(s);
av_freep(&avctx->extradata); av_freep(&avctx->extradata);
...@@ -2547,7 +2547,7 @@ vbv_retry: ...@@ -2547,7 +2547,7 @@ vbv_retry:
MPV_frame_end(s); MPV_frame_end(s);
if (s->out_format == FMT_MJPEG) if (ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
mjpeg_picture_trailer(s); mjpeg_picture_trailer(s);
if(avctx->rc_buffer_size){ if(avctx->rc_buffer_size){
...@@ -4599,6 +4599,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, ...@@ -4599,6 +4599,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
case CODEC_ID_RV20: case CODEC_ID_RV20:
h263_encode_mb(s, s->block, motion_x, motion_y); break; h263_encode_mb(s, s->block, motion_x, motion_y); break;
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
if (ENABLE_MJPEG_ENCODER)
mjpeg_encode_mb(s, s->block); break; mjpeg_encode_mb(s, s->block); break;
default: default:
assert(0); assert(0);
...@@ -4899,7 +4900,7 @@ static void write_slice_end(MpegEncContext *s){ ...@@ -4899,7 +4900,7 @@ static void write_slice_end(MpegEncContext *s){
} }
ff_mpeg4_stuffing(&s->pb); ff_mpeg4_stuffing(&s->pb);
}else if(s->out_format == FMT_MJPEG){ }else if(ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG){
ff_mjpeg_stuffing(&s->pb); ff_mjpeg_stuffing(&s->pb);
} }
...@@ -5768,6 +5769,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) ...@@ -5768,6 +5769,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->last_bits= put_bits_count(&s->pb); s->last_bits= put_bits_count(&s->pb);
switch(s->out_format) { switch(s->out_format) {
case FMT_MJPEG: case FMT_MJPEG:
if (ENABLE_MJPEG_ENCODER)
mjpeg_picture_header(s); mjpeg_picture_header(s);
break; break;
#ifdef CONFIG_H261_ENCODER #ifdef CONFIG_H261_ENCODER
...@@ -6939,6 +6941,7 @@ AVCodec wmv1_encoder = { ...@@ -6939,6 +6941,7 @@ AVCodec wmv1_encoder = {
.pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1}, .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
}; };
#ifdef CONFIG_MJPEG_ENCODER
AVCodec mjpeg_encoder = { AVCodec mjpeg_encoder = {
"mjpeg", "mjpeg",
CODEC_TYPE_VIDEO, CODEC_TYPE_VIDEO,
...@@ -6949,5 +6952,6 @@ AVCodec mjpeg_encoder = { ...@@ -6949,5 +6952,6 @@ AVCodec mjpeg_encoder = {
MPV_encode_end, MPV_encode_end,
.pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, -1}, .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, -1},
}; };
#endif
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
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