Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 3/7] avcodec/idctdsp: Avoid inclusion of avcodec.h
Date: Fri,  8 Sep 2023 16:07:23 +0200
Message-ID: <AS8P250MB074488C6E4A8F9F8772C7B938FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB074429EE169A8357C6FC520C8FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

Not every user of idctdsp.h wants to initialize an IDCTDSPContext;
e.g. the proresdsp only uses ff_init_scantable_permutation()
and the IDCT permutation enum; similarly for cavsdsp and wmv2dsp.
Using a forward declaration here avoids an avcodec.h dependency
in the relevant files.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/alpha/idctdsp_alpha.c |  1 +
 libavcodec/idctdsp.h             | 21 +++++++++++----------
 libavcodec/ppc/idctdsp.c         |  1 +
 libavcodec/rtjpeg.c              |  2 +-
 libavcodec/rtjpeg.h              |  4 +++-
 tests/checkasm/idctdsp.c         |  1 +
 6 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/libavcodec/alpha/idctdsp_alpha.c b/libavcodec/alpha/idctdsp_alpha.c
index bd43842535..ff770c15fd 100644
--- a/libavcodec/alpha/idctdsp_alpha.c
+++ b/libavcodec/alpha/idctdsp_alpha.c
@@ -19,6 +19,7 @@
  */
 
 #include "libavutil/attributes.h"
+#include "libavcodec/avcodec.h"
 #include "libavcodec/idctdsp.h"
 #include "idctdsp_alpha.h"
 #include "asm.h"
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index 7224463349..c840a5186f 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -19,11 +19,12 @@
 #ifndef AVCODEC_IDCTDSP_H
 #define AVCODEC_IDCTDSP_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include "config.h"
 
-#include "avcodec.h"
+struct AVCodecContext;
 
 enum idct_permutation_type {
     FF_IDCT_PERM_NONE,
@@ -95,23 +96,23 @@ void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
 void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
                              ptrdiff_t line_size);
 
-void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
+void ff_idctdsp_init(IDCTDSPContext *c, struct AVCodecContext *avctx);
 
-void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_aarch64(IDCTDSPContext *c, struct AVCodecContext *avctx,
                              unsigned high_bit_depth);
-void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_alpha(IDCTDSPContext *c, struct AVCodecContext *avctx,
                            unsigned high_bit_depth);
-void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_arm(IDCTDSPContext *c, struct AVCodecContext *avctx,
                          unsigned high_bit_depth);
-void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_ppc(IDCTDSPContext *c, struct AVCodecContext *avctx,
                          unsigned high_bit_depth);
-void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_riscv(IDCTDSPContext *c, struct AVCodecContext *avctx,
                            unsigned high_bit_depth);
-void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_x86(IDCTDSPContext *c, struct AVCodecContext *avctx,
                          unsigned high_bit_depth);
-void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_mips(IDCTDSPContext *c, struct AVCodecContext *avctx,
                           unsigned high_bit_depth);
-void ff_idctdsp_init_loongarch(IDCTDSPContext *c, AVCodecContext *avctx,
+void ff_idctdsp_init_loongarch(IDCTDSPContext *c, struct AVCodecContext *avctx,
                                unsigned high_bit_depth);
 
 #endif /* AVCODEC_IDCTDSP_H */
diff --git a/libavcodec/ppc/idctdsp.c b/libavcodec/ppc/idctdsp.c
index 29f625a01c..a7acbc5ead 100644
--- a/libavcodec/ppc/idctdsp.c
+++ b/libavcodec/ppc/idctdsp.c
@@ -40,6 +40,7 @@
 #include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"
 
+#include "libavcodec/avcodec.h"
 #include "libavcodec/idctdsp.h"
 
 #if HAVE_ALTIVEC
diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c
index 8e02bce2e8..734e3875da 100644
--- a/libavcodec/rtjpeg.c
+++ b/libavcodec/rtjpeg.c
@@ -167,7 +167,7 @@ void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height,
     c->h = height;
 }
 
-void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx)
+void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx)
 {
     int i;
 
diff --git a/libavcodec/rtjpeg.h b/libavcodec/rtjpeg.h
index d4dc074408..14befb5489 100644
--- a/libavcodec/rtjpeg.h
+++ b/libavcodec/rtjpeg.h
@@ -24,6 +24,7 @@
 
 #include <stdint.h>
 
+#include "libavutil/frame.h"
 #include "libavutil/mem_internal.h"
 #include "idctdsp.h"
 
@@ -39,7 +40,8 @@ typedef struct RTJpegContext {
     DECLARE_ALIGNED(16, int16_t, block)[64];
 } RTJpegContext;
 
-void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx);
+struct AVCodecContext;
+void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx);
 
 void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height,
                            const uint32_t *lquant, const uint32_t *cquant);
diff --git a/tests/checkasm/idctdsp.c b/tests/checkasm/idctdsp.c
index c06e607d99..05aeddea45 100644
--- a/tests/checkasm/idctdsp.c
+++ b/tests/checkasm/idctdsp.c
@@ -22,6 +22,7 @@
 
 #include "checkasm.h"
 
+#include "libavcodec/avcodec.h"
 #include "libavcodec/idctdsp.h"
 
 #include "libavutil/common.h"
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2023-09-08 14:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 14:02 [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 2/7] avcodec/proresdsp: Pass necessary parameter directly Andreas Rheinhardt
2023-09-08 14:07 ` Andreas Rheinhardt [this message]
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 4/7] avcodec/vlc: Add documentation for ff_init_vlc_sparse() Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 5/7] tools/patcheck: Remove test for ancient INIT_VLC_USE_STATIC Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 6/7] avcodec/vlc: Use proper namespace Andreas Rheinhardt
2023-09-09 23:40   ` Michael Niedermayer
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 7/7] avcodec/truemotion2: Don't check before freeing VLC Andreas Rheinhardt
2023-09-08 18:11   ` Paul B Mahol
2023-09-10  8:50 ` [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P250MB074488C6E4A8F9F8772C7B938FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git