From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avcodec/libaomenc: bump the minimum required version to 2.0.0 Date: Fri, 5 Apr 2024 14:16:21 -0300 Message-ID: <20240405171621.4320-1-jamrial@gmail.com> (raw) v2.0.0 is already four years old and available on stable distro releases. With this we stop setting codec capabilities during static data initialization. Signed-off-by: James Almer <jamrial@gmail.com> --- configure | 2 +- libavcodec/libaomenc.c | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/configure b/configure index 493fe3cffd..f511fbae49 100755 --- a/configure +++ b/configure @@ -6834,7 +6834,7 @@ enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gn enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa && require_headers "ladspa.h dlfcn.h" enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext -enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version +enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new || { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } || die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; } diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index d660afab4e..d2bdb622e0 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -155,27 +155,14 @@ static const char *const ctlidstr[] = { [AV1E_SET_TILE_COLUMNS] = "AV1E_SET_TILE_COLUMNS", [AV1E_SET_TILE_ROWS] = "AV1E_SET_TILE_ROWS", [AV1E_SET_ENABLE_RESTORATION] = "AV1E_SET_ENABLE_RESTORATION", -#ifdef AOM_CTRL_AV1E_SET_ROW_MT [AV1E_SET_ROW_MT] = "AV1E_SET_ROW_MT", -#endif -#ifdef AOM_CTRL_AV1E_SET_DENOISE_NOISE_LEVEL [AV1E_SET_DENOISE_NOISE_LEVEL] = "AV1E_SET_DENOISE_NOISE_LEVEL", -#endif -#ifdef AOM_CTRL_AV1E_SET_DENOISE_BLOCK_SIZE [AV1E_SET_DENOISE_BLOCK_SIZE] = "AV1E_SET_DENOISE_BLOCK_SIZE", -#endif -#ifdef AOM_CTRL_AV1E_SET_MAX_REFERENCE_FRAMES [AV1E_SET_MAX_REFERENCE_FRAMES] = "AV1E_SET_MAX_REFERENCE_FRAMES", -#endif -#ifdef AOM_CTRL_AV1E_SET_ENABLE_GLOBAL_MOTION [AV1E_SET_ENABLE_GLOBAL_MOTION] = "AV1E_SET_ENABLE_GLOBAL_MOTION", -#endif -#ifdef AOM_CTRL_AV1E_SET_ENABLE_INTRABC [AV1E_SET_ENABLE_INTRABC] = "AV1E_SET_ENABLE_INTRABC", -#endif [AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF", [AOME_SET_TUNING] = "AOME_SET_TUNING", -#if AOM_ENCODER_ABI_VERSION >= 22 [AV1E_SET_ENABLE_1TO4_PARTITIONS] = "AV1E_SET_ENABLE_1TO4_PARTITIONS", [AV1E_SET_ENABLE_AB_PARTITIONS] = "AV1E_SET_ENABLE_AB_PARTITIONS", [AV1E_SET_ENABLE_RECT_PARTITIONS] = "AV1E_SET_ENABLE_RECT_PARTITIONS", @@ -204,13 +191,10 @@ static const char *const ctlidstr[] = { [AV1E_SET_REDUCED_REFERENCE_SET] = "AV1E_SET_REDUCED_REFERENCE_SET", [AV1E_SET_ENABLE_SMOOTH_INTERINTRA] = "AV1E_SET_ENABLE_SMOOTH_INTERINTRA", [AV1E_SET_ENABLE_REF_FRAME_MVS] = "AV1E_SET_ENABLE_REF_FRAME_MVS", -#endif #ifdef AOM_CTRL_AV1E_GET_NUM_OPERATING_POINTS [AV1E_GET_NUM_OPERATING_POINTS] = "AV1E_GET_NUM_OPERATING_POINTS", #endif -#ifdef AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX [AV1E_GET_SEQ_LEVEL_IDX] = "AV1E_GET_SEQ_LEVEL_IDX", -#endif #ifdef AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX [AV1E_GET_TARGET_SEQ_LEVEL_IDX] = "AV1E_GET_TARGET_SEQ_LEVEL_IDX", #endif @@ -691,12 +675,9 @@ static av_cold int aom_init(AVCodecContext *avctx, AOMContext *ctx = avctx->priv_data; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); struct aom_codec_enc_cfg enccfg = { 0 }; -#ifdef AOM_FRAME_IS_INTRAONLY aom_codec_flags_t flags = (avctx->flags & AV_CODEC_FLAG_PSNR) ? AOM_CODEC_USE_PSNR : 0; -#else aom_codec_flags_t flags = 0; -#endif AVCPBProperties *cpb_props; int res; aom_img_fmt_t img_fmt; @@ -886,7 +867,6 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AV1E_SET_ENABLE_CDEF, ctx->enable_cdef); if (ctx->enable_restoration >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_RESTORATION, ctx->enable_restoration); -#if AOM_ENCODER_ABI_VERSION >= 22 if (ctx->enable_rect_partitions >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_RECT_PARTITIONS, ctx->enable_rect_partitions); if (ctx->enable_1to4_partitions >= 0) @@ -943,7 +923,6 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AV1E_SET_ENABLE_ONESIDED_COMP, ctx->enable_onesided_comp); if (ctx->enable_smooth_interintra >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_SMOOTH_INTERINTRA, ctx->enable_smooth_interintra); -#endif codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); if (ctx->crf >= 0) @@ -972,31 +951,19 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AV1E_SET_TILE_ROWS, ctx->tile_rows_log2); } -#ifdef AOM_CTRL_AV1E_SET_DENOISE_NOISE_LEVEL if (ctx->denoise_noise_level >= 0) codecctl_int(avctx, AV1E_SET_DENOISE_NOISE_LEVEL, ctx->denoise_noise_level); -#endif -#ifdef AOM_CTRL_AV1E_SET_DENOISE_BLOCK_SIZE if (ctx->denoise_block_size >= 0) codecctl_int(avctx, AV1E_SET_DENOISE_BLOCK_SIZE, ctx->denoise_block_size); -#endif -#ifdef AOM_CTRL_AV1E_SET_ENABLE_GLOBAL_MOTION if (ctx->enable_global_motion >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_GLOBAL_MOTION, ctx->enable_global_motion); -#endif -#ifdef AOM_CTRL_AV1E_SET_MAX_REFERENCE_FRAMES if (avctx->refs >= 3) { codecctl_int(avctx, AV1E_SET_MAX_REFERENCE_FRAMES, avctx->refs); } -#endif -#ifdef AOM_CTRL_AV1E_SET_ROW_MT if (ctx->row_mt >= 0) codecctl_int(avctx, AV1E_SET_ROW_MT, ctx->row_mt); -#endif -#ifdef AOM_CTRL_AV1E_SET_ENABLE_INTRABC if (ctx->enable_intrabc >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_INTRABC, ctx->enable_intrabc); -#endif #if AOM_ENCODER_ABI_VERSION >= 23 { @@ -1065,7 +1032,6 @@ static inline void cx_pktcpy(AOMContext *ctx, dst->flags = src->data.frame.flags; dst->sz = src->data.frame.sz; dst->buf = src->data.frame.buf; -#ifdef AOM_FRAME_IS_INTRAONLY dst->frame_number = ++ctx->frame_number; dst->have_sse = ctx->have_sse; if (ctx->have_sse) { @@ -1074,7 +1040,6 @@ static inline void cx_pktcpy(AOMContext *ctx, memcpy(dst->sse, ctx->sse, sizeof(dst->sse)); ctx->have_sse = 0; } -#endif } /** @@ -1101,7 +1066,6 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, if (!!(cx_frame->flags & AOM_FRAME_IS_KEY)) { pkt->flags |= AV_PKT_FLAG_KEY; -#ifdef AOM_FRAME_IS_INTRAONLY pict_type = AV_PICTURE_TYPE_I; } else if (cx_frame->flags & AOM_FRAME_IS_INTRAONLY) { pict_type = AV_PICTURE_TYPE_I; @@ -1118,7 +1082,6 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, avctx->error[i] += cx_frame->sse[i + 1]; } cx_frame->have_sse = 0; -#endif } if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { @@ -1221,7 +1184,6 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out) stats->sz += pkt->data.twopass_stats.sz; break; } -#ifdef AOM_FRAME_IS_INTRAONLY case AOM_CODEC_PSNR_PKT: { av_assert0(!ctx->have_sse); @@ -1232,7 +1194,6 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out) ctx->have_sse = 1; break; } -#endif case AOM_CODEC_CUSTOM_PKT: // ignore unsupported/unrecognized packet types break; @@ -1448,9 +1409,6 @@ static av_cold void av1_init_static(FFCodec *codec) else codec->p.pix_fmts = supports_monochrome ? av1_pix_fmts_with_gray : av1_pix_fmts; - - if (aom_codec_version_major() < 2) - codec->p.capabilities |= AV_CODEC_CAP_EXPERIMENTAL; } static av_cold int av1_init(AVCodecContext *avctx) -- 2.44.0 _______________________________________________ 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 reply other threads:[~2024-04-05 17:16 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-05 17:16 James Almer [this message] 2024-04-05 17:25 ` Anton Khirnov
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=20240405171621.4320-1-jamrial@gmail.com \ --to=jamrial@gmail.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