Forráskód Böngészése

avcodec/Makefile: Remove h263 decoder->mpeg4videodec.o dependency

Also prefer using #if CONFIG_MPEG4_DECODER checks in order not
to rely on DCE.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Andreas Rheinhardt 1 hónapja
szülő
commit
dad06a445f
3 módosított fájl, 17 hozzáadás és 6 törlés
  1. 3 2
      libavcodec/Makefile
  2. 8 2
      libavcodec/h263dec.c
  3. 6 2
      libavcodec/ituh263dec.c

+ 3 - 2
libavcodec/Makefile

@@ -158,7 +158,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC)            += mpegvideo_enc.o mpeg12data.o  \
                                           motion_est.o ratecontrol.o
                                           motion_est.o ratecontrol.o
 OBJS-$(CONFIG_MPEGVIDEOENCDSP)         += mpegvideoencdsp.o
 OBJS-$(CONFIG_MPEGVIDEOENCDSP)         += mpegvideoencdsp.o
 OBJS-$(CONFIG_MSMPEG4DEC)              += msmpeg4dec.o msmpeg4.o msmpeg4data.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 \
 OBJS-$(CONFIG_MSMPEG4ENC)              += msmpeg4enc.o msmpeg4.o msmpeg4data.o \
                                           msmpeg4_vc1_data.o
                                           msmpeg4_vc1_data.o
 OBJS-$(CONFIG_MSS34DSP)                += mss34dsp.o jpegquanttables.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_MEDIACODEC_DECODER) += mediacodecdec.o
 OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER)     += vaapi_encode_mpeg2.o
 OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER)     += vaapi_encode_mpeg2.o
 OBJS-$(CONFIG_MPEG2_V4L2M2M_DECODER)   += v4l2_m2m_dec.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_ENCODER)           += mpeg4videoenc.o
 OBJS-$(CONFIG_MPEG4_CUVID_DECODER)     += cuviddec.o
 OBJS-$(CONFIG_MPEG4_CUVID_DECODER)     += cuviddec.o
 OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o
 OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o

+ 8 - 2
libavcodec/h263dec.c

@@ -201,10 +201,12 @@ static int decode_slice(H263DecContext *const h)
 
 
     ff_set_qscale(&h->c, h->c.qscale);
     ff_set_qscale(&h->c, h->c.qscale);
 
 
+#if CONFIG_MPEG4_DECODER
     if (h->c.studio_profile) {
     if (h->c.studio_profile) {
         if ((ret = ff_mpeg4_decode_studio_slice_header(h)) < 0)
         if ((ret = ff_mpeg4_decode_studio_slice_header(h)) < 0)
             return ret;
             return ret;
     }
     }
+#endif
 
 
     if (h->c.avctx->hwaccel) {
     if (h->c.avctx->hwaccel) {
         const uint8_t *start = h->gb.buffer + get_bits_count(&h->gb) / 8;
         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;
     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))
         if (h->c.pict_type != AV_PICTURE_TYPE_B && h->c.mb_num/2 > get_bits_left(&h->gb))
             return AVERROR_INVALIDDATA;
             return AVERROR_INVALIDDATA;
         ff_mpeg4_workaround_bugs(avctx);
         ff_mpeg4_workaround_bugs(avctx);
         if (h->c.studio_profile != (h->c.idsp.idct == NULL))
         if (h->c.studio_profile != (h->c.idsp.idct == NULL))
             ff_mpv_idct_init(s);
             ff_mpv_idct_init(s);
     }
     }
+#endif
 
 
     /* After H.263 & MPEG-4 header decode we have the height, width,
     /* After H.263 & MPEG-4 header decode we have the height, width,
      * and other parameters. So then we could init the picture. */
      * and other parameters. So then we could init the picture. */
@@ -615,8 +619,10 @@ frame_end:
 
 
     ff_mpv_frame_end(s);
     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);
         ff_mpeg4_frame_end(avctx, avpkt);
+#endif
 
 
     av_assert1(h->c.pict_type == h->c.cur_pic.ptr->f->pict_type);
     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) {
     if (h->c.pict_type == AV_PICTURE_TYPE_B || h->c.low_delay) {

+ 6 - 2
libavcodec/ituh263dec.c

@@ -240,9 +240,11 @@ int ff_h263_resync(H263DecContext *const h)
 
 
     if (show_bits(&h->gb, 16) ==0) {
     if (show_bits(&h->gb, 16) ==0) {
         pos = get_bits_count(&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);
             ret = ff_mpeg4_decode_video_packet_header(h);
         else
         else
+#endif
             ret = h263_decode_gob_header(h);
             ret = h263_decode_gob_header(h);
         if(ret>=0)
         if(ret>=0)
             return pos;
             return pos;
@@ -257,9 +259,11 @@ int ff_h263_resync(H263DecContext *const h)
             GetBitContext bak = h->gb;
             GetBitContext bak = h->gb;
 
 
             pos = get_bits_count(&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);
                 ret = ff_mpeg4_decode_video_packet_header(h);
             else
             else
+#endif
                 ret = h263_decode_gob_header(h);
                 ret = h263_decode_gob_header(h);
             if(ret>=0)
             if(ret>=0)
                 return pos;
                 return pos;