[FFmpeg-devel] [PATCH 10/41] avcodec/msmpeg4.h: Move encoder-only stuff to a new header

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Jan 30 08:27:18 EET 2022


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mpegvideo_enc.c |  2 +-
 libavcodec/msmpeg4.h       | 15 -------------
 libavcodec/msmpeg4enc.c    |  1 +
 libavcodec/msmpeg4enc.h    | 45 ++++++++++++++++++++++++++++++++++++++
 libavcodec/wmv2enc.c       |  1 +
 5 files changed, 48 insertions(+), 16 deletions(-)
 create mode 100644 libavcodec/msmpeg4enc.h

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6df2a46eaa..4bc78841ac 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -56,7 +56,7 @@
 #include "mpegutils.h"
 #include "mjpegenc.h"
 #include "speedhqenc.h"
-#include "msmpeg4.h"
+#include "msmpeg4enc.h"
 #include "pixblockdsp.h"
 #include "qpeldsp.h"
 #include "faandct.h"
diff --git a/libavcodec/msmpeg4.h b/libavcodec/msmpeg4.h
index 483c965b9d..dbe650cbbc 100644
--- a/libavcodec/msmpeg4.h
+++ b/libavcodec/msmpeg4.h
@@ -28,7 +28,6 @@
 #include "avcodec.h"
 #include "mpegvideo.h"
 #include "msmpeg4data.h"
-#include "put_bits.h"
 
 #define INTER_INTRA_VLC_BITS 3
 #define MB_NON_INTRA_VLC_BITS 9
@@ -42,20 +41,10 @@
 extern VLC ff_mb_non_intra_vlc[4];
 extern VLC ff_inter_intra_vlc;
 
-void ff_msmpeg4_code012(PutBitContext *pb, int n);
 void ff_msmpeg4_common_init(MpegEncContext *s);
-void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
-void ff_msmpeg4_handle_slices(MpegEncContext *s);
-void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
 int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n,
                                 uint8_t **coded_block_ptr);
 
-void ff_msmpeg4_encode_init(MpegEncContext *s);
-void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_msmpeg4_encode_ext_header(MpegEncContext *s);
-void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
-                          int motion_x, int motion_y);
-
 int ff_msmpeg4_decode_init(AVCodecContext *avctx);
 int ff_msmpeg4_decode_picture_header(MpegEncContext *s);
 int ff_msmpeg4_decode_ext_header(MpegEncContext *s, int buf_size);
@@ -72,9 +61,5 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
                                 CONFIG_WMV1_DECODER      || \
                                 CONFIG_WMV2_DECODER      || \
                                 CONFIG_VC1_DECODER)
-#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \
-                                CONFIG_MSMPEG4V3_ENCODER || \
-                                CONFIG_WMV1_ENCODER      || \
-                                CONFIG_WMV2_ENCODER)
 
 #endif /* AVCODEC_MSMPEG4_H */
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 2c619e1210..31920b7f0d 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -39,6 +39,7 @@
 #include "mpeg4video.h"
 #include "msmpeg4.h"
 #include "msmpeg4data.h"
+#include "msmpeg4enc.h"
 #include "put_bits.h"
 #include "rl.h"
 #include "vc1data.h"
diff --git a/libavcodec/msmpeg4enc.h b/libavcodec/msmpeg4enc.h
new file mode 100644
index 0000000000..12f8f44232
--- /dev/null
+++ b/libavcodec/msmpeg4enc.h
@@ -0,0 +1,45 @@
+/*
+ * MSMPEG4 encoder header
+ * copyright (c) 2007 Aurelien Jacobs <aurel at gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MSMPEG4ENC_H
+#define AVCODEC_MSMPEG4ENC_H
+
+#include "config.h"
+#include "mpegvideo.h"
+#include "put_bits.h"
+
+void ff_msmpeg4_encode_init(MpegEncContext *s);
+void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
+void ff_msmpeg4_encode_ext_header(MpegEncContext *s);
+void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
+                          int motion_x, int motion_y);
+void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
+void ff_msmpeg4_handle_slices(MpegEncContext *s);
+void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
+
+void ff_msmpeg4_code012(PutBitContext *pb, int n);
+
+#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \
+                                CONFIG_MSMPEG4V3_ENCODER || \
+                                CONFIG_WMV1_ENCODER      || \
+                                CONFIG_WMV2_ENCODER)
+
+#endif
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index a7827f3194..6036a0dec9 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -22,6 +22,7 @@
 #include "h263.h"
 #include "mpegvideo.h"
 #include "msmpeg4.h"
+#include "msmpeg4enc.h"
 #include "msmpeg4data.h"
 #include "wmv2.h"
 
-- 
2.32.0



More information about the ffmpeg-devel mailing list