diff --git a/libavcodec/Makefile b/libavcodec/Makefile index d55e899c14..791fd5d5a4 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -158,7 +158,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \ motion_est.o ratecontrol.o OBJS-$(CONFIG_MPEGVIDEOENCDSP) += mpegvideoencdsp.o OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \ - msmpeg4_vc1_data.o + msmpeg4_vc1_data.o mpeg4videodec.o OBJS-$(CONFIG_MSMPEG4ENC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o \ msmpeg4_vc1_data.o OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o jpegquanttables.o @@ -576,7 +576,8 @@ OBJS-$(CONFIG_MPEG2_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_MPEG2_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER) += vaapi_encode_mpeg2.o OBJS-$(CONFIG_MPEG2_V4L2M2M_DECODER) += v4l2_m2m_dec.o -OBJS-$(CONFIG_MPEG4_DECODER) += mpeg4videodsp.o xvididct.o +OBJS-$(CONFIG_MPEG4_DECODER) += mpeg4videodec.o mpeg4videodsp.o \ + xvididct.o OBJS-$(CONFIG_MPEG4_ENCODER) += mpeg4videoenc.o OBJS-$(CONFIG_MPEG4_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index bacd258d53..697fe7e572 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -201,10 +201,12 @@ static int decode_slice(H263DecContext *const h) ff_set_qscale(&h->c, h->c.qscale); +#if CONFIG_MPEG4_DECODER if (h->c.studio_profile) { if ((ret = ff_mpeg4_decode_studio_slice_header(h)) < 0) return ret; } +#endif if (h->c.avctx->hwaccel) { const uint8_t *start = h->gb.buffer + get_bits_count(&h->gb) / 8; @@ -500,13 +502,15 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, avctx->has_b_frames = !h->c.low_delay; - if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { +#if CONFIG_MPEG4_DECODER + if (avctx->codec_id == AV_CODEC_ID_MPEG4) { if (h->c.pict_type != AV_PICTURE_TYPE_B && h->c.mb_num/2 > get_bits_left(&h->gb)) return AVERROR_INVALIDDATA; ff_mpeg4_workaround_bugs(avctx); if (h->c.studio_profile != (h->c.idsp.idct == NULL)) ff_mpv_idct_init(s); } +#endif /* After H.263 & MPEG-4 header decode we have the height, width, * and other parameters. So then we could init the picture. */ @@ -615,8 +619,10 @@ frame_end: ff_mpv_frame_end(s); - if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) +#if CONFIG_MPEG4_DECODER + if (avctx->codec_id == AV_CODEC_ID_MPEG4) ff_mpeg4_frame_end(avctx, avpkt); +#endif av_assert1(h->c.pict_type == h->c.cur_pic.ptr->f->pict_type); if (h->c.pict_type == AV_PICTURE_TYPE_B || h->c.low_delay) { diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 7a78b95c50..dc8847b53b 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -240,9 +240,11 @@ int ff_h263_resync(H263DecContext *const h) if (show_bits(&h->gb, 16) ==0) { pos = get_bits_count(&h->gb); - if(CONFIG_MPEG4_DECODER && h->c.codec_id==AV_CODEC_ID_MPEG4) +#if CONFIG_MPEG4_DECODER + if (h->c.codec_id == AV_CODEC_ID_MPEG4) ret = ff_mpeg4_decode_video_packet_header(h); else +#endif ret = h263_decode_gob_header(h); if(ret>=0) return pos; @@ -257,9 +259,11 @@ int ff_h263_resync(H263DecContext *const h) GetBitContext bak = h->gb; pos = get_bits_count(&h->gb); - if(CONFIG_MPEG4_DECODER && h->c.codec_id==AV_CODEC_ID_MPEG4) +#if CONFIG_MPEG4_DECODER + if (h->c.codec_id == AV_CODEC_ID_MPEG4) ret = ff_mpeg4_decode_video_packet_header(h); else +#endif ret = h263_decode_gob_header(h); if(ret>=0) return pos;