[FFmpeg-devel] [PATCH v2 21/69] avcodec/mpeg12.h: Move encoder-only stuff into a new header
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Tue Feb 1 15:06:18 EET 2022
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/mpeg12.h | 8 --------
libavcodec/mpeg12enc.c | 2 +-
libavcodec/mpeg12enc.h | 38 ++++++++++++++++++++++++++++++++++++++
libavcodec/mpegvideo_enc.c | 1 +
libavcodec/speedhqenc.c | 3 +--
5 files changed, 41 insertions(+), 11 deletions(-)
create mode 100644 libavcodec/mpeg12enc.h
diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h
index a405db6c2d..e0406b32d9 100644
--- a/libavcodec/mpeg12.h
+++ b/libavcodec/mpeg12.h
@@ -36,19 +36,11 @@
void ff_mpeg12_common_init(MpegEncContext *s);
-void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len);
-
void ff_mpeg1_clean_buffers(MpegEncContext *s);
#if FF_API_FLAG_TRUNCATED
int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s);
#endif
-void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64],
- int motion_x, int motion_y);
-void ff_mpeg1_encode_init(MpegEncContext *s);
-void ff_mpeg1_encode_slice_header(MpegEncContext *s);
-
void ff_mpeg12_find_best_frame_rate(AVRational frame_rate,
int *code, int *ext_n, int *ext_d,
int nonstandard);
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 9c0be69ded..3acb82ac9d 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -37,10 +37,10 @@
#include "libavutil/stereo3d.h"
#include "avcodec.h"
-#include "bytestream.h"
#include "mathops.h"
#include "mpeg12.h"
#include "mpeg12data.h"
+#include "mpeg12enc.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "profiles.h"
diff --git a/libavcodec/mpeg12enc.h b/libavcodec/mpeg12enc.h
new file mode 100644
index 0000000000..fbbc43f891
--- /dev/null
+++ b/libavcodec/mpeg12enc.h
@@ -0,0 +1,38 @@
+/*
+ * MPEG-1/2 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_MPEG12ENC_H
+#define AVCODEC_MPEG12ENC_H
+
+#include <stdint.h>
+
+#include "mpegvideo.h"
+#include "rl.h"
+
+void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len);
+
+void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
+void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64],
+ int motion_x, int motion_y);
+void ff_mpeg1_encode_init(MpegEncContext *s);
+void ff_mpeg1_encode_slice_header(MpegEncContext *s);
+
+#endif /* AVCODEC_MPEG12ENC_H */
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7c5d013200..aaa1488977 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -46,6 +46,7 @@
#include "idctdsp.h"
#include "mpeg12.h"
#include "mpeg12data.h"
+#include "mpeg12enc.h"
#include "mpegvideo.h"
#include "mpegvideodata.h"
#include "h261enc.h"
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 6df0316611..2a310a6c4f 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -27,12 +27,11 @@
* SpeedHQ encoder.
*/
-#include "libavutil/pixdesc.h"
#include "libavutil/thread.h"
#include "avcodec.h"
-#include "mpeg12.h"
#include "mpeg12data.h"
+#include "mpeg12enc.h"
#include "mpegvideo.h"
#include "speedhqenc.h"
--
2.32.0
More information about the ffmpeg-devel
mailing list