From: Andreas Rheinhardt <ffmpegagent-at-gmail.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 20/47] configure: Relax svq1enc->mpegvideoenc dependency Date: Sun, 15 Jun 2025 16:54:11 +0000 Message-ID: <c9f8c538a07cd733623194e957304e27990bf23d.1750006479.git.ffmpegagent@gmail.com> (raw) In-Reply-To: <pull.98.ffstaging.FFmpeg.1750006478.ffmpegagent@gmail.com> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> It only needs mpegvideoencdsp, motion_est.o and some H.263 specific parts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- configure | 2 +- libavcodec/Makefile | 2 +- libavcodec/h263.c | 5 ++++- libavcodec/ituh263enc.c | 41 ++++++++++++++++++++++------------------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/configure b/configure index a32bbc3f90..2a1961b61a 100755 --- a/configure +++ b/configure @@ -3113,7 +3113,7 @@ speedhq_decoder_select="blockdsp idctdsp" speedhq_encoder_select="mpegvideoenc" srgc_decoder_select="inflate_wrapper" svq1_decoder_select="hpeldsp" -svq1_encoder_select="hpeldsp me_cmp mpegvideoenc" +svq1_encoder_select="hpeldsp me_cmp mpegvideoencdsp" svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp" svq3_decoder_suggest="zlib" tak_decoder_select="audiodsp" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index faffed1c34..8aa0309e09 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -721,7 +721,7 @@ OBJS-$(CONFIG_SBC_DECODER) += sbcdec.o sbc.o OBJS-$(CONFIG_SBC_ENCODER) += sbcenc.o sbc.o sbcdsp.o OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263data.o OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \ - h263.o ituh263enc.o + h263.o ituh263enc.o motion_est.o OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o mpegutils.o h264data.o OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o OBJS-$(CONFIG_TEXT_ENCODER) += srtenc.o ass_split.o diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 19eb3ba52f..6d2de715ab 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -27,17 +27,19 @@ * H.263/MPEG-4 codec. */ +#include "config.h" + #include "libavutil/thread.h" #include "mpegvideo.h" #include "h263.h" #include "h263data.h" #include "h263dsp.h" -#include "idctdsp.h" #include "mathops.h" #include "mpegpicture.h" #include "mpegutils.h" #include "rl.h" +#if CONFIG_MPEGVIDEO static av_cold void h263_init_rl_inter(void) { static uint8_t h263_rl_inter_table[2][2 * MAX_RUN + MAX_LEVEL + 3]; @@ -49,6 +51,7 @@ av_cold void ff_h263_init_rl_inter(void) static AVOnce init_static_once = AV_ONCE_INIT; ff_thread_once(&init_static_once, h263_init_rl_inter); } +#endif void ff_h263_update_motion_val(MpegEncContext * s){ const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index ab6edafd4d..ae67907722 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -53,21 +53,7 @@ */ static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV*2+1]; -/** - * Minimal fcode that a motion vector component would need in umv. - * All entries in this table are 1. - */ -static uint8_t umv_fcode_tab[MAX_MV*2+1]; - -//unified encoding tables for run length encoding of coefficients -//unified in the sense that the specification specifies the encoding in several steps. -static uint8_t uni_h263_intra_aic_rl_len [64*64*2*2]; -static uint8_t uni_h263_inter_rl_len [64*64*2*2]; -//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level)) -//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64) -#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level)) - -static av_cold void init_mv_penalty_and_fcode(void) +static av_cold void init_mv_penalty(void) { for (int f_code = 1; f_code <= MAX_FCODE; f_code++) { for (int mv = -MAX_DMV; mv <= MAX_DMV; mv++) { @@ -94,10 +80,23 @@ static av_cold void init_mv_penalty_and_fcode(void) mv_penalty[f_code][mv + MAX_DMV] = len; } } - - memset(umv_fcode_tab, 1, sizeof(umv_fcode_tab)); } +#if CONFIG_H263_ENCODER +/** + * Minimal fcode that a motion vector component would need in umv. + * All entries in this table are 1. + */ +static uint8_t umv_fcode_tab[MAX_MV*2+1]; + +//unified encoding tables for run length encoding of coefficients +//unified in the sense that the specification specifies the encoding in several steps. +static uint8_t uni_h263_intra_aic_rl_len [64*64*2*2]; +static uint8_t uni_h263_inter_rl_len [64*64*2*2]; +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level)) +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64) +#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level)) + static av_cold void init_uni_h263_rl_tab(const RLTable *rl, uint8_t *len_tab) { av_assert0(MAX_LEVEL >= 64); @@ -137,18 +136,22 @@ static av_cold void init_uni_h263_rl_tab(const RLTable *rl, uint8_t *len_tab) } } } +#endif static av_cold void h263_encode_init_static(void) { +#if CONFIG_H263_ENCODER static uint8_t rl_intra_table[2][2 * MAX_RUN + MAX_LEVEL + 3]; - ff_rl_init(&ff_rl_intra_aic, rl_intra_table); ff_h263_init_rl_inter(); init_uni_h263_rl_tab(&ff_rl_intra_aic, uni_h263_intra_aic_rl_len); init_uni_h263_rl_tab(&ff_h263_rl_inter, uni_h263_inter_rl_len); - init_mv_penalty_and_fcode(); + memset(umv_fcode_tab, 1, sizeof(umv_fcode_tab)); +#endif + + init_mv_penalty(); } av_cold const uint8_t (*ff_h263_get_mv_penalty(void))[MAX_DMV*2+1] -- ffmpeg-codebot _______________________________________________ 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:[~2025-06-15 16:58 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-06-15 16:53 [FFmpeg-devel] [PATCH 00/47] avcodec/mpeg4videodec: Don't zero blocks twice ffmpegagent 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 01/47] " Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 02/47] avcodec/rv10: Perform RV20 initialization during init Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 03/47] avcodec/rv10: Perform RV20 check only for RV20 Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 04/47] avcodec/ituh263dec: Don't process unnecessarily many coefficients Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 05/47] avcodec/ituh263dec: Remove redundant store Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 06/47] avcodec/ituh263enc: Don't use array unnecessarily Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 07/47] avcodec/ituh263enc: Fix indentation Andreas Rheinhardt 2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 08/47] avcodec/mpeg12dec: Don't store block_last_index unnecessarily Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 09/47] avcodec/rv10: Avoid indirection when reading VLC codes Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 10/47] avcodec/mpeg_er: Mark ff_mpeg_er_init() as av_cold Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 11/47] avcodec/mpegvideo_enc: Remove always-true branch Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 12/47] avcodec/motion_est: Fix indentation Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 13/47] avcodec/svq1enc: Don't free scratchbuf upon error Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 14/47] avcodec/svq1enc: Allocate motion_val{8, 16} during init Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 15/47] avcodec/svq1enc: Stop calling ff_mpv_common_init() Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 16/47] avcodec/svq1enc: Remove write-only c_block_{width, height} Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 17/47] avcodec/svq1enc: Set MpegEncContext.avctx only once Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 18/47] avcodec/svq1enc: Don't initialize unneeded block_index Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 19/47] configure: Factor mpegvideoencdsp out of mpegvideoenc Andreas Rheinhardt 2025-06-15 16:54 ` Andreas Rheinhardt [this message] 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 21/47] configure: Relax diracdec->mpegvideoenc dependency Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 22/47] configure: Relax snowenc->mpegvideoenc dependency Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 23/47] avcodec/mpegvideo: Don't reset thread_context ptrs unnecessarily Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 24/47] avcodec/mpegvideo: Don't zero unnecessarily Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 25/47] avcodec/mpegvideo: Defer init of enc slice ctxs in ff_mpv_common_init() Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 26/47] avcodec/mpegvideo_enc: Simplify allocating non-slice buffers Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 27/47] avcodec/ituh263dec: Simplify AIC handling Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 28/47] avcodec/ituh263enc: " Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 29/47] avcodec/flvenc: Combine writing bits Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 30/47] avcodec/flvenc: Move ff_flv2_encode_ac_esc() to ituh263enc.c Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 31/47] avcodec/mpegvideo: Redo resetting intra table entry Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 32/47] avcodec/mpegvideo: Avoid {a, d}c_val[{1, 2}] Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 33/47] avcodec/mpegvideo: Provide alignment hint to compiler Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 34/47] avcodec/mpegvideo: Don't reset AC values of upper-left luma block Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 35/47] avcodec/mpegvideo: Combine stores Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 36/47] avcodec/mpeg4video: Don't use ac_val[1], ac_val[2] when cleaning buffers Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 37/47] avcodec/mpegvideo: Only use a single ac_val pointer Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 38/47] avcodec/mpegvideo: Allocate ac_val jointly Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 39/47] avcodec/mpegvideo: Zero-init mbintra_table Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 40/47] avcodec/mpegvideo: Only keep MpegEncContext.dc_val[0] Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 41/47] avcodec/vc1: Only keep mb_type[0] Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 42/47] avcodec/mpegvideo: Allocate dc_val for each encoder slice Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 43/47] avcodec/{ituh263, mpeg4video}enc: Simplify out-of-slice DC prediction Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 44/47] avcodec/mpeg4video: Move ff_mpeg4_pred_dc() to decoder Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 45/47] avcodec/ituh263enc: Simplify encoding umotion vectors Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 46/47] avcodec/mpegvideo: Reduce stack usage when copying MpegEncContext Andreas Rheinhardt 2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 47/47] avcodec/mpeg4videoenc: Fix data race when using AC prediction 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=c9f8c538a07cd733623194e957304e27990bf23d.1750006479.git.ffmpegagent@gmail.com \ --to=ffmpegagent-at-gmail.com@ffmpeg.org \ --cc=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