From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6667B45DA0 for ; Fri, 9 Jun 2023 11:21:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14E0668C30A; Fri, 9 Jun 2023 14:21:19 +0300 (EEST) Received: from out162-62-57-87.mail.qq.com (out162-62-57-87.mail.qq.com [162.62.57.87]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0FE1668C0FB for ; Fri, 9 Jun 2023 14:21:11 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1686309669; bh=dlx1s38ZnpcfRJFZOMAyRAKymVWz8KAmFRHiJWnQ8f0=; h=From:To:Cc:Subject:Date; b=YJLUnvLhQvZxn/1x1VdURGbXeSHAHk/tMi+UJixMu61AfK6mKNqguaK1L/OsYvqF0 BOmZaAAG+TbTBRB74lpHHdZLWz5oxC8qFy8h2DR598LOeyOmwoHLRPOWHE9cPSbt1D YyETabEq+AzGpdTTycrUlPlpX3xbMx/BGqI74ZAE= Received: from ZHILIZHAO-MB2.tencent.com ([113.108.77.55]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 3C02EA18; Fri, 09 Jun 2023 19:15:00 +0800 X-QQ-mid: xmsmtpt1686309300tcbgdmdxf Message-ID: X-QQ-XMAILINFO: NrI1OKqG5KOqz8bZWjMMFQ3ONWcQrqWUL/CH2pHY1PVMxBeDlmGlQeJLFFsDy/ Iw+WrCaL5iorM7lAkPCXe3DdtJidByO2vmsGSF7p6Z22YTZRBXw0E/vxm9HsBxGb/FWhQx/rFNiw zpchO9jXbnEZ54N3cQ8qvIHX2ggSfUYQiKqnf19mT1H1G34zifN+w/YJ2CRdx8Sl/VIRxmFhnIEB 63zyvHX1V21Tm9UJwQ2lf/euxka+zCtPYu05Tlsi2a0HAV2G90Q81KJ8udx449VzlYU7fILyoRDL yqYDsFAUc/7AlmOIgmYKj00+2/vXIFVTuKea3OwgiYa4CXf6IxXPrPHRqpytzu0dvSL/g0brA+cC I2D0iULBRwe3/N0SCYjqiKxI/uPBmRiRysfeXoavuhQQK2cnnTqD45ZxA29XvWsxNMVuu8+OQs8R SwivQpIMFHdHsGwRVEYjpgqzdzVZyOXCKW2O/+9TIHKItfYIZqxz/7Ak80HFo+5YuS9zmnLtftB2 /EFV0cwHwDKssTM8eoELMZuOCR3bP8yR/9UR0fU/K1WV/K3wTNhp21oaChYmxR92gi7qyB0iNTOJ C7Lidcn9up56Tkbmmf6f+1ekIHt+TRtnjo3zmgFkc+901tkOU/CqPGNsPneSjXQvXYPJVp5Zaaws KnJyxkAizID5cluaiD9YDcq8OyThHitpfXmoy8SdNEv42/or+nWu8X6MHbZBbkxRedj/DzYzEPde 7sL59mebMStsXEzIplcez0cczVpkpPnQgcgRXc7wac1EBj3OtPVInpB060jOXklfkQaZzEr+pTrM IvXZV1pZKth9lgNyRvmXuSUQIm4dp/Bgu/xvW0F/Qq1CUldrtCVMbmLSnWkBMCoqO4rbqaOQal5t pyG25sAkYRVYvOSa7NmNZ5yUY8G4rSiZwv5p8+/c3F3w5wwKahA1Lb0r2wiGtSnWXW6unwqeHhFs c+fbUdug3c0bd8h/bA6JrM2Bq9t+r9leGZVP3etz60ujxg4pyGSQ== From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Jun 2023 19:14:53 +0800 X-OQ-MSGID: <20230609111455.17989-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/videotoolboxenc: use int as the type of profile X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Zhao Zhili Other than save a few bytes, it also has the benefit to show the AV_OPT_TYPE_CONST value in help, e.g., -profile E..V....... Profile (from 0 to INT_MAX) (default 0) baseline 66 E..V....... Baseline Profile ... --- libavcodec/videotoolboxenc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 9719e0bf54..26485a3dea 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -252,7 +252,7 @@ typedef struct VTEncContext { int64_t first_pts; int64_t dts_delta; - int64_t profile; + int profile; int level; int entropy; int realtime; @@ -443,7 +443,7 @@ static int count_nalus(size_t length_code_size, } static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, - int64_t profile, + int profile, double alpha_quality) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX ? avctx->sw_pix_fmt : avctx->pix_fmt); @@ -470,7 +470,7 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ default: - av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %"PRId64", using auto\n", profile); + av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile); case FF_PROFILE_UNKNOWN: if (desc && ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) || @@ -735,7 +735,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, CFStringRef *profile_level_val) { VTEncContext *vtctx = avctx->priv_data; - int64_t profile = vtctx->profile; + int profile = vtctx->profile; if (profile == AUTO_PROFILE && vtctx->level) { //Need to pick a profile if level is not auto-selected. @@ -864,7 +864,7 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx, CFStringRef *profile_level_val) { VTEncContext *vtctx = avctx->priv_data; - int64_t profile = vtctx->profile; + int profile = vtctx->profile; *profile_level_val = NULL; @@ -2891,7 +2891,7 @@ static const enum AVPixelFormat prores_pix_fmts[] = { #define OFFSET(x) offsetof(VTEncContext, x) static const AVOption h264_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = AUTO_PROFILE }, 0, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AUTO_PROFILE }, 0, INT_MAX, VE, "profile" }, { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, @@ -2948,7 +2948,7 @@ const FFCodec ff_h264_videotoolbox_encoder = { }; static const AVOption hevc_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = AUTO_PROFILE }, 0, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AUTO_PROFILE }, 0, INT_MAX, VE, "profile" }, { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, @@ -2985,7 +2985,7 @@ const FFCodec ff_hevc_videotoolbox_encoder = { }; static const AVOption prores_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, -- 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".