[FFmpeg-devel] [PATCH 16/21] avcodec/internal: Move ff_set_sar() to decode.h

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Aug 25 19:33:55 EEST 2022


Only used by decoders, as the SAR has to be set by the user
when encoding.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/av1dec.c     | 1 +
 libavcodec/decode.h     | 6 ++++++
 libavcodec/dvdec.c      | 1 +
 libavcodec/exr.c        | 1 +
 libavcodec/h264_slice.c | 1 +
 libavcodec/hevcdec.c    | 1 +
 libavcodec/internal.h   | 6 ------
 libavcodec/vc1.c        | 1 +
 libavcodec/vp3.c        | 1 +
 9 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 8abb7b3b34..7b5b2c996a 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -27,6 +27,7 @@
 #include "av1dec.h"
 #include "bytestream.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "hwconfig.h"
 #include "internal.h"
 #include "profiles.h"
diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index 25db4a9e4d..b82d953516 100644
--- a/libavcodec/decode.h
+++ b/libavcodec/decode.h
@@ -99,6 +99,12 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx);
  */
 int ff_decode_preinit(AVCodecContext *avctx);
 
+/**
+ * Check that the provided sample aspect ratio is valid and set it on the codec
+ * context.
+ */
+int ff_set_sar(AVCodecContext *avctx, AVRational sar);
+
 /**
  * Select the (possibly hardware accelerated) pixel format.
  * This is a wrapper around AVCodecContext.get_format() and should be used
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index f7423580aa..d1de9cd9e2 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -44,6 +44,7 @@
 
 #include "avcodec.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "dv.h"
 #include "dv_profile_internal.h"
 #include "dvdata.h"
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 859dd6fedd..a62cc95d28 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -51,6 +51,7 @@
 #endif
 
 #include "codec_internal.h"
+#include "decode.h"
 #include "exrdsp.h"
 #include "get_bits.h"
 #include "internal.h"
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 8f9d0a6231..6f0a7c1fb7 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -36,6 +36,7 @@
 #include "internal.h"
 #include "cabac.h"
 #include "cabac_functions.h"
+#include "decode.h"
 #include "error_resilience.h"
 #include "avcodec.h"
 #include "h264.h"
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 477d6d9d36..ed6cef6bfb 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -42,6 +42,7 @@
 #include "bytestream.h"
 #include "cabac_functions.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "golomb.h"
 #include "hevc.h"
 #include "hevc_data.h"
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 0c581a4cf3..13d33f0ad3 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -223,12 +223,6 @@ int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec);
  */
 int ff_set_dimensions(AVCodecContext *s, int width, int height);
 
-/**
- * Check that the provided sample aspect ratio is valid and set it on the codec
- * context.
- */
-int ff_set_sar(AVCodecContext *avctx, AVRational sar);
-
 /**
  * Add or update AV_FRAME_DATA_MATRIXENCODING side data.
  */
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 1070b8ca90..d46f551020 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -30,6 +30,7 @@
 #include "libavutil/thread.h"
 #include "internal.h"
 #include "avcodec.h"
+#include "decode.h"
 #include "mpegvideo.h"
 #include "vc1.h"
 #include "vc1data.h"
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 3f6b0100d9..0f040c338f 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -41,6 +41,7 @@
 
 #include "avcodec.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "get_bits.h"
 #include "hpeldsp.h"
 #include "internal.h"
-- 
2.34.1



More information about the ffmpeg-devel mailing list