[FFmpeg-cvslog] avcodec/mpegutils: Move definitions to better places

Andreas Rheinhardt git at videolan.org
Mon Apr 8 16:18:19 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Oct 15 23:27:24 2023 +0200| [66923165d5b7cdb751e890813e6e8ed23986d820] | committer: Andreas Rheinhardt

avcodec/mpegutils: Move definitions to better places

FRAME_SKIPPED -> h263dec.h
CANDIDATE_MB_TYPE_* -> mpegvideoenc.h
INPLACE_OFFSET -> mpegvideoenc.h
enum OutputFormat -> mpegvideo.h

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66923165d5b7cdb751e890813e6e8ed23986d820
---

 libavcodec/h263dec.c       |  1 -
 libavcodec/h263dec.h       |  5 +++++
 libavcodec/intelh263dec.c  |  2 --
 libavcodec/mpeg4videoenc.c |  1 -
 libavcodec/mpegpicture.c   |  2 +-
 libavcodec/mpegutils.h     | 34 ----------------------------------
 libavcodec/mpegvideo.h     | 12 +++++++++---
 libavcodec/mpegvideoenc.h  | 19 +++++++++++++++++++
 libavcodec/nvdec_mpeg12.c  |  1 +
 libavcodec/ratecontrol.c   |  1 -
 libavcodec/rv10.c          |  1 -
 libavcodec/vc1dec.c        |  1 +
 12 files changed, 36 insertions(+), 44 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 910df7585f..48bd467f30 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -42,7 +42,6 @@
 #include "mpeg4video.h"
 #include "mpeg4videodec.h"
 #include "mpeg4videodefs.h"
-#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
 #include "msmpeg4dec.h"
diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h
index 89c5fcf58f..a01acc0834 100644
--- a/libavcodec/h263dec.h
+++ b/libavcodec/h263dec.h
@@ -23,6 +23,11 @@
 #include "mpegvideo.h"
 #include "vlc.h"
 
+/**
+ * Return value for header parsers if frame is not coded.
+ * */
+#define FRAME_SKIPPED 100
+
 // The defines below define the number of bits that are read at once for
 // reading vlc values. Changing these may improve speed and data cache needs
 // be aware though that decreasing them may need the number of stages that is
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index f8eeb6b44e..5d34892ef7 100644
--- a/libavcodec/intelh263dec.c
+++ b/libavcodec/intelh263dec.c
@@ -19,12 +19,10 @@
  */
 
 #include "codec_internal.h"
-#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
 #include "h263data.h"
 #include "h263dec.h"
-#include "mpegvideodata.h"
 
 /* don't understand why they choose a different header ! */
 int ff_intel_h263_decode_picture_header(MpegEncContext *s)
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index f806ad8a74..71dda802e2 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -26,7 +26,6 @@
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
 #include "codec_internal.h"
-#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "h263.h"
 #include "h263enc.h"
diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c
index 5bf85bb7fe..06b6daa01a 100644
--- a/libavcodec/mpegpicture.c
+++ b/libavcodec/mpegpicture.c
@@ -29,7 +29,7 @@
 #include "avcodec.h"
 #include "motion_est.h"
 #include "mpegpicture.h"
-#include "mpegutils.h"
+#include "mpegvideo.h"
 #include "refstruct.h"
 #include "threadframe.h"
 
diff --git a/libavcodec/mpegutils.h b/libavcodec/mpegutils.h
index 386110bb8c..3da1e7ed38 100644
--- a/libavcodec/mpegutils.h
+++ b/libavcodec/mpegutils.h
@@ -27,11 +27,6 @@
 
 #include "avcodec.h"
 
-/**
- * Return value for header parsers if frame is not coded.
- * */
-#define FRAME_SKIPPED 100
-
 /* picture type */
 #define PICT_TOP_FIELD     1
 #define PICT_BOTTOM_FIELD  2
@@ -93,35 +88,6 @@
 
 #define HAS_CBP(a)       ((a) & MB_TYPE_CBP)
 
-/* MB types for encoding */
-#define CANDIDATE_MB_TYPE_INTRA      (1 <<  0)
-#define CANDIDATE_MB_TYPE_INTER      (1 <<  1)
-#define CANDIDATE_MB_TYPE_INTER4V    (1 <<  2)
-#define CANDIDATE_MB_TYPE_SKIPPED    (1 <<  3)
-
-#define CANDIDATE_MB_TYPE_DIRECT     (1 <<  4)
-#define CANDIDATE_MB_TYPE_FORWARD    (1 <<  5)
-#define CANDIDATE_MB_TYPE_BACKWARD   (1 <<  6)
-#define CANDIDATE_MB_TYPE_BIDIR      (1 <<  7)
-
-#define CANDIDATE_MB_TYPE_INTER_I    (1 <<  8)
-#define CANDIDATE_MB_TYPE_FORWARD_I  (1 <<  9)
-#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10)
-#define CANDIDATE_MB_TYPE_BIDIR_I    (1 << 11)
-
-#define CANDIDATE_MB_TYPE_DIRECT0    (1 << 12)
-
-#define INPLACE_OFFSET 16
-
-enum OutputFormat {
-    FMT_MPEG1,
-    FMT_H261,
-    FMT_H263,
-    FMT_MJPEG,
-    FMT_SPEEDHQ,
-};
-
-
 /**
  * Draw a horizontal band if supported.
  *
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index d7c2f57682..215df0fd5b 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -28,7 +28,6 @@
 #ifndef AVCODEC_MPEGVIDEO_H
 #define AVCODEC_MPEGVIDEO_H
 
-#include "avcodec.h"
 #include "blockdsp.h"
 #include "error_resilience.h"
 #include "fdctdsp.h"
@@ -44,7 +43,6 @@
 #include "pixblockdsp.h"
 #include "put_bits.h"
 #include "ratecontrol.h"
-#include "mpegutils.h"
 #include "qpeldsp.h"
 #include "videodsp.h"
 
@@ -61,6 +59,14 @@ typedef struct ScanTable {
     uint8_t raster_end[64];
 } ScanTable;
 
+enum OutputFormat {
+    FMT_MPEG1,
+    FMT_H261,
+    FMT_H263,
+    FMT_MJPEG,
+    FMT_SPEEDHQ,
+};
+
 /**
  * MpegEncContext.
  */
@@ -283,7 +289,7 @@ typedef struct MpegEncContext {
     int mb_x, mb_y;
     int mb_skip_run;
     int mb_intra;
-    uint16_t *mb_type;  ///< Table for candidate MB types for encoding (defines in mpegutils.h)
+    uint16_t *mb_type;  ///< Table for candidate MB types for encoding (defines in mpegvideoenc.h)
 
     int block_index[6]; ///< index to current MB in block based arrays with edges
     int block_wrap[6];
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index 1e29782660..c20ea500eb 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -34,6 +34,25 @@
 #include "mpegvideo.h"
 
 #define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level))
+#define INPLACE_OFFSET 16
+
+/* MB types for encoding */
+#define CANDIDATE_MB_TYPE_INTRA      (1 <<  0)
+#define CANDIDATE_MB_TYPE_INTER      (1 <<  1)
+#define CANDIDATE_MB_TYPE_INTER4V    (1 <<  2)
+#define CANDIDATE_MB_TYPE_SKIPPED    (1 <<  3)
+
+#define CANDIDATE_MB_TYPE_DIRECT     (1 <<  4)
+#define CANDIDATE_MB_TYPE_FORWARD    (1 <<  5)
+#define CANDIDATE_MB_TYPE_BACKWARD   (1 <<  6)
+#define CANDIDATE_MB_TYPE_BIDIR      (1 <<  7)
+
+#define CANDIDATE_MB_TYPE_INTER_I    (1 <<  8)
+#define CANDIDATE_MB_TYPE_FORWARD_I  (1 <<  9)
+#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10)
+#define CANDIDATE_MB_TYPE_BIDIR_I    (1 << 11)
+
+#define CANDIDATE_MB_TYPE_DIRECT0    (1 << 12)
 
 /* mpegvideo_enc common options */
 #define FF_MPV_FLAG_SKIP_RD      0x0001
diff --git a/libavcodec/nvdec_mpeg12.c b/libavcodec/nvdec_mpeg12.c
index a4603c7ea7..139f287617 100644
--- a/libavcodec/nvdec_mpeg12.c
+++ b/libavcodec/nvdec_mpeg12.c
@@ -25,6 +25,7 @@
 #include "avcodec.h"
 #include "hwaccel_internal.h"
 #include "internal.h"
+#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "nvdec.h"
 #include "decode.h"
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 1ff209c00b..9ee08ecb88 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -32,7 +32,6 @@
 
 #include "avcodec.h"
 #include "ratecontrol.h"
-#include "mpegutils.h"
 #include "mpegvideoenc.h"
 #include "libavutil/eval.h"
 
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index d32faa628b..df487b24a9 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -38,7 +38,6 @@
 #include "h263data.h"
 #include "h263dec.h"
 #include "mpeg_er.h"
-#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
 #include "mpeg4video.h"
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 2c413e0bf1..3b5b016cf9 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -36,6 +36,7 @@
 #include "hwaccel_internal.h"
 #include "hwconfig.h"
 #include "mpeg_er.h"
+#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
 #include "msmpeg4_vc1_data.h"



More information about the ffmpeg-cvslog mailing list