From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 27/28] avcodec/mpegvideoencdsp: Pass bitexact flag directly Date: Mon, 6 May 2024 23:52:26 +0200 Message-ID: <GV1P250MB07375EC49AC86F83FD1ACBDD8F1C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB0744D14E6CEB1A5AD911A3398F1D2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> Don't pass an AVCodecContext*. This avoids inclusions of avcodec.h and makes it clearer which parameter affect the returned function pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/arm/mpegvideoencdsp_init_arm.c | 3 +-- libavcodec/dnxhdenc.c | 2 +- libavcodec/mips/mpegvideoencdsp_init_mips.c | 2 +- libavcodec/mpegvideo_enc.c | 2 +- libavcodec/mpegvideoencdsp.c | 11 +++++------ libavcodec/mpegvideoencdsp.h | 17 +++++------------ libavcodec/ppc/mpegvideoencdsp.c | 2 +- libavcodec/svq1enc.c | 2 +- libavcodec/x86/mpegvideoencdsp_init.c | 13 ++++--------- 9 files changed, 20 insertions(+), 34 deletions(-) diff --git a/libavcodec/arm/mpegvideoencdsp_init_arm.c b/libavcodec/arm/mpegvideoencdsp_init_arm.c index a95b5bebe9..842079267b 100644 --- a/libavcodec/arm/mpegvideoencdsp_init_arm.c +++ b/libavcodec/arm/mpegvideoencdsp_init_arm.c @@ -21,14 +21,13 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/arm/cpu.h" -#include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" int ff_pix_norm1_armv6(const uint8_t *pix, int line_size); int ff_pix_sum_armv6(const uint8_t *pix, int line_size); av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, - AVCodecContext *avctx) + int bitexact) { int cpu_flags = av_get_cpu_flags(); diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 0cb25d7714..6417dc48b9 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -423,7 +423,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ff_blockdsp_init(&ctx->bdsp); ff_fdctdsp_init(&ctx->m.fdsp, avctx); ff_mpv_idct_init(&ctx->m); - ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx); + ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx->flags & AV_CODEC_FLAG_BITEXACT); ff_pixblockdsp_init(&ctx->m.pdsp, avctx); ff_dct_encode_init(&ctx->m); diff --git a/libavcodec/mips/mpegvideoencdsp_init_mips.c b/libavcodec/mips/mpegvideoencdsp_init_mips.c index 3efbeec34a..4a279e9942 100644 --- a/libavcodec/mips/mpegvideoencdsp_init_mips.c +++ b/libavcodec/mips/mpegvideoencdsp_init_mips.c @@ -24,7 +24,7 @@ #include "h263dsp_mips.h" av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, - AVCodecContext *avctx) + int bitexact) { int cpu_flags = av_get_cpu_flags(); diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index ab14538b33..cfdd8fa3c4 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -809,7 +809,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) ff_fdctdsp_init(&s->fdsp, avctx); ff_me_cmp_init(&s->mecc, avctx); - ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); + ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx->flags & AV_CODEC_FLAG_BITEXACT); ff_drawedgesdsp_init(&s->drawedges); ff_pixblockdsp_init(&s->pdsp, avctx); diff --git a/libavcodec/mpegvideoencdsp.c b/libavcodec/mpegvideoencdsp.c index a6de93456d..b8f740630a 100644 --- a/libavcodec/mpegvideoencdsp.c +++ b/libavcodec/mpegvideoencdsp.c @@ -22,7 +22,6 @@ #include "libavutil/avassert.h" #include "libavutil/attributes.h" #include "libavutil/imgutils.h" -#include "avcodec.h" #include "me_cmp.h" #include "mpegvideoencdsp.h" @@ -200,7 +199,7 @@ static void shrink88(uint8_t *dst, int dst_wrap, } av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, - AVCodecContext *avctx) + int bitexact) { c->try_8x8basis = try_8x8basis_c; c->add_8x8basis = add_8x8basis_c; @@ -214,12 +213,12 @@ av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, c->pix_norm1 = pix_norm1_c; #if ARCH_ARM - ff_mpegvideoencdsp_init_arm(c, avctx); + ff_mpegvideoencdsp_init_arm(c, bitexact); #elif ARCH_PPC - ff_mpegvideoencdsp_init_ppc(c, avctx); + ff_mpegvideoencdsp_init_ppc(c, bitexact); #elif ARCH_X86 - ff_mpegvideoencdsp_init_x86(c, avctx); + ff_mpegvideoencdsp_init_x86(c, bitexact); #elif ARCH_MIPS - ff_mpegvideoencdsp_init_mips(c, avctx); + ff_mpegvideoencdsp_init_mips(c, bitexact); #endif } diff --git a/libavcodec/mpegvideoencdsp.h b/libavcodec/mpegvideoencdsp.h index 46b40cf30e..08dd758494 100644 --- a/libavcodec/mpegvideoencdsp.h +++ b/libavcodec/mpegvideoencdsp.h @@ -21,8 +21,6 @@ #include <stdint.h> -#include "avcodec.h" - #define BASIS_SHIFT 16 #define RECON_SHIFT 6 @@ -38,15 +36,10 @@ typedef struct MpegvideoEncDSPContext { int src_wrap, int width, int height); } MpegvideoEncDSPContext; -void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, - AVCodecContext *avctx); -void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, - AVCodecContext *avctx); -void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, - AVCodecContext *avctx); -void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, - AVCodecContext *avctx); -void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, - AVCodecContext *avctx); +void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, int bitexact); +void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, int bitexact); +void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, int bitexact); +void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, int bitexact); +void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, int bitexact); #endif /* AVCODEC_MPEGVIDEOENCDSP_H */ diff --git a/libavcodec/ppc/mpegvideoencdsp.c b/libavcodec/ppc/mpegvideoencdsp.c index 07d3e76ee0..1ec35196f1 100644 --- a/libavcodec/ppc/mpegvideoencdsp.c +++ b/libavcodec/ppc/mpegvideoencdsp.c @@ -149,7 +149,7 @@ static int pix_sum_altivec(const uint8_t *pix, int line_size) #endif /* HAVE_ALTIVEC */ av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, - AVCodecContext *avctx) + int bitexact) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index d71ad07b86..3232803dae 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -591,7 +591,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_me_cmp_init(&s->mecc, avctx); - ff_mpegvideoencdsp_init(&s->m.mpvencdsp, avctx); + ff_mpegvideoencdsp_init(&s->m.mpvencdsp, avctx->flags & AV_CODEC_FLAG_BITEXACT); s->current_picture = av_frame_alloc(); s->last_picture = av_frame_alloc(); diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c index c816ca2ee7..5b4be0e7bc 100644 --- a/libavcodec/x86/mpegvideoencdsp_init.c +++ b/libavcodec/x86/mpegvideoencdsp_init.c @@ -19,7 +19,6 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" -#include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" int ff_pix_sum16_sse2(const uint8_t *pix, int line_size); @@ -95,8 +94,7 @@ int ff_pix_norm1_sse2(const uint8_t *pix, int line_size); #endif /* HAVE_SSSE3_INLINE */ #endif /* HAVE_INLINE_ASM */ -av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, - AVCodecContext *avctx) +av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, int bitexact) { int cpu_flags = av_get_cpu_flags(); @@ -112,24 +110,21 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, #if HAVE_INLINE_ASM if (INLINE_MMX(cpu_flags)) { - if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) { + if (!bitexact) c->try_8x8basis = try_8x8basis_mmx; - } c->add_8x8basis = add_8x8basis_mmx; } if (INLINE_AMD3DNOW(cpu_flags)) { - if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) { + if (!bitexact) c->try_8x8basis = try_8x8basis_3dnow; - } c->add_8x8basis = add_8x8basis_3dnow; } #if HAVE_SSSE3_INLINE if (INLINE_SSSE3(cpu_flags)) { - if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) { + if (!bitexact) c->try_8x8basis = try_8x8basis_ssse3; - } c->add_8x8basis = add_8x8basis_ssse3; } #endif /* HAVE_SSSE3_INLINE */ -- 2.40.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".
next prev parent reply other threads:[~2024-05-06 21:53 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-05 8:25 [FFmpeg-devel] [PATCH 1/9] configure: Add missing dirac_decoder->qpeldsp dependency Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 2/9] configure: Add missing pdv decoder->inflate_wrapper dependency Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 3/9] configure: Add missing atrac3p(al) decoder->sinewin dependency Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 4/9] configure: Add missing ftr decoder->adts_header dependency Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 5/9] avcodec/Makefile, v408(dec|enc): Remove remnants of AYUV codecs Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 6/9] Remove remnants of prores_lgpl decoder Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 7/9] avcodec/Makefile: Correct name of cbd2_dpcm decoder Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 8/9] configure: Add wmv2dsp->qpeldsp dependency Andreas Rheinhardt 2024-05-05 8:27 ` [FFmpeg-devel] [PATCH 9/9] avcodec/Makefile: Fix intrax8 objects Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 10/24] avformat/Makefile: Add asf_muxer->asf_tags.o dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 11/24] avfilter/Makefile: Add missing tiltshelf entry Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 12/24] avfilter/Makefile: Add missing colormap->framesync dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 13/24] avfilter/vf_xmedian: Define OFFSET, FLAGS macros unconditionally Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 14/24] avfilter/Makefile: Add scale(2ref)->framesync dependency Andreas Rheinhardt 2024-05-07 21:11 ` Frank Plowman 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 15/24] avfilter/vsrc_testsrc: Fix compilation of colorchart filter Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 16/24] avfilter/Makefile: Add missing guided->framesync dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 17/24] avfilter/vf_convolution: Fix compilation with sobel disabled Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 18/24] avfilter/x86/Makefile: Add missing dependencies for sobel filter Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 19/24] avfilter/Makefile: Add missing multiply->framesync dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 20/24] avfilter/vf_lut3d: Fix standalone build of lut1d Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 21/24] avfilter/x86/Makefile: Fix standalone build of haldclut filter Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 22/24] avfilter/Makefile: Add missing identity->framesync dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 23/24] configure: Add missing identity filter->scene_sad dependency Andreas Rheinhardt 2024-05-05 13:40 ` [FFmpeg-devel] [PATCH 24/24] avfilter/Makefile: Add missing morpho->framesync dependency Andreas Rheinhardt 2024-05-06 21:52 ` [FFmpeg-devel] [PATCH 25/28] avcodec/x86/mpegvideoencdsp_init: Remove bits_per_raw_sample check Andreas Rheinhardt 2024-05-07 0:10 ` Michael Niedermayer 2024-05-07 8:49 ` Andreas Rheinhardt 2024-05-06 21:52 ` [FFmpeg-devel] [PATCH 26/28] avcodec/mpegvideoencdsp: Factor draw_edges out in its own context Andreas Rheinhardt 2024-05-06 22:52 ` Lynne 2024-05-06 21:52 ` Andreas Rheinhardt [this message] 2024-05-06 21:52 ` [FFmpeg-devel] [PATCH 28/28] avcodec/diracdec: Don't use EDGE_WIDTH from mpegpicture.h Andreas Rheinhardt 2024-05-07 8:55 ` [FFmpeg-devel] [PATCH 1/9] configure: Add missing dirac_decoder->qpeldsp dependency 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=GV1P250MB07375EC49AC86F83FD1ACBDD8F1C2@GV1P250MB0737.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