From patchwork Mon Apr 22 21:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 48232 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:2d06:b0:1a9:af23:56c1 with SMTP id tw6csp40932pzb; Mon, 22 Apr 2024 14:42:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUg+E1PUkaD61H99asneO/whdd4fY9hyK6C6Awm0ktiAjVydWSR7P+Y3llnlM5P3W8S7VbmLOsk3a0BdKYhi6+Fp/mkHBLDsc2mfQ== X-Google-Smtp-Source: AGHT+IGZlI9FL19YhioDQMc2Hke1kaecx4/66IgzXv/mCbylXVDfCXayj7PFXEQHvoysq+bnn0MP X-Received: by 2002:a2e:9eca:0:b0:2de:dcf:f02d with SMTP id h10-20020a2e9eca000000b002de0dcff02dmr44047ljk.45.1713822144035; Mon, 22 Apr 2024 14:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713822144; cv=none; d=google.com; s=arc-20160816; b=CFWBGS+Db25wDeBg6zGVR+YdA1D9WP8g+Bp+8MtXo76mO+Gwvu1tYutyVlcbHIH1Me tIOUZi498GWMNxN6MGab5NgRk/VSNhm1EUjUVdzw+OzlL8Vl5nsJLJRT6uQKBpYwTWGl o66IE4iXZi8DzfaTC8EG5kn6D9fFslSlMSH8OPrhl11gr51siLZNLgRMaHEBnMMJxDhg tg86xBiWQXjSlBP4Gebq/V2Pbf+9fDG13FMiZN1W31gxhP1k+QPDHfJsZRsMNOph1Peb HhRdu/c0ZbDoOYLIqLD61utUst7xIJnDvZr9x18jaHjW7pbPKzBb3v1BmEM6MhB8wTVJ EK1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:in-reply-to:references:to:from:content-language :user-agent:mime-version:date:message-id:dkim-signature:delivered-to; bh=Nd5rMZI4j885mHmWrOfH+Z54hlonCCBkMgl1Ki47AIk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=L06h8jwtOO+10KIz9LoPB2YZTa3vVHq7Rg0MwRcJQPkjW+ODFKXHnojRQJ/f8PGTA5 yACHnXxQ5czzHq9H5BlNsMpsTRCZLJ4Ok2AErGBA89I6Mh9Q1Xu60NtEZdGsfnyAqkYq 9O8A1Mc4mcGcQwG+gyZl5JeQ9mHHvxdg7WifgGhmUAv41dauXLYxDuKFGHqPaLRhN96j qpf6TGxxvJpBzxmnbbvawr7exXmlCxtH5FfHRRCFDAouBYgEH+TsAv2T6cmITKmmUNka vO5cr7h5u8wuAuqqiVXSH96ndpPn6GKb1r3Reem1jldbbqZQIegU/cCrdZIs5L0NbCdU i2Lw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20230601.gappssmtp.com header.s=20230601 header.b="X5/T37lB"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v22-20020a2e9616000000b002d29308afdbsi3078062ljh.488.2024.04.22.14.42.23; Mon, 22 Apr 2024 14:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20230601.gappssmtp.com header.s=20230601 header.b="X5/T37lB"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B2B1A68D383; Tue, 23 Apr 2024 00:42:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0ECE468D180 for ; Tue, 23 Apr 2024 00:42:14 +0300 (EEST) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-34b1e35155aso1506730f8f.3 for ; Mon, 22 Apr 2024 14:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1713822133; x=1714426933; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UfW2fykZQjzTEb9DxBXk9XHvCJxiHJyYxlfla4FDJwY=; b=X5/T37lBBYZXmFIppxnsxHVgDp9YGxoiSAFuMJwTy0T732kIPSJgTjn2w6lbcAejKV l5nAZgIN+LczvJtCM2APZ2rqt9K/2orr0Yn5Ou8zuXknxAf/54ldByurl3o3pDWJzHtj bpk4gV8sjftEPDQA/w6nPmQ8vwbCBMVbQG3VjZhrj11mYSdfGpCB0KXjwWWgMTJcAvw7 bAwH3WqLDOUIaVZfezIRa/yReOd+nzsh7xCl/UIoUAX6msd0MfRxUQQ7slhMbQp5IZDT hJsgpvcWNv1da154CTW/6wB2FYS1js7KtdxUL1iVZsodvFvRlY3vYrbcN7A18PT/H/mK DETQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713822133; x=1714426933; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UfW2fykZQjzTEb9DxBXk9XHvCJxiHJyYxlfla4FDJwY=; b=G+/KRaHx5dGqpWyjxeWFF3wf7k1j6ATiXOrnXsyruoK4FD+YA3aJHenekE/oxZmk1D Wp7ifFAaI1SjiufuH6z+i6luHxlm3i/BwhcqCMmJt2xsZuG4MMKzm3hvBee5odJUtO4S lg24+/qx2UZVvybqrn7NSwi9KctUnYOMcLFCFhPW32rF3s+RjzOooLu+cmgOp/nbCDE2 Yp+6SeliqElViAB8JEvx6E+FNUi+3TKE7cu8FB6EntclgQwSGR7IRpWzKmooVJA3dqb8 huzqjTr9YIG0H+m6WH7K4zMnFHA1yfkW3RtN9HvPb6LFIvNdKPbk2fNShTAHTWlfzSzv arVQ== X-Gm-Message-State: AOJu0YxQ6/qrd2DeuemOqLf0neTeNNJpicpXDCthxYlCV/oHir/sYWU1 Lk7jnvun1VvjD3aXntQY/XSgCOGdTXAUoLUuTeWSWVVQbX1SgQ2uQcNewa9XOytz4sX9EpYFBIT 6 X-Received: by 2002:adf:f38f:0:b0:346:bc1b:4e7c with SMTP id m15-20020adff38f000000b00346bc1b4e7cmr8673968wro.35.1713822133185; Mon, 22 Apr 2024 14:42:13 -0700 (PDT) Received: from [192.168.0.15] (cpc92302-cmbg19-2-0-cust1183.5-4.cable.virginm.net. [82.1.212.160]) by smtp.gmail.com with ESMTPSA id r26-20020adfa15a000000b0034b6d40ecdbsm141771wrr.48.2024.04.22.14.42.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Apr 2024 14:42:12 -0700 (PDT) Message-ID: Date: Mon, 22 Apr 2024 22:42:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Mark Thompson To: FFmpeg development discussions and patches References: In-Reply-To: Subject: [FFmpeg-devel] [PATCH v3 2/4] lavc: Remove libva 1.x support 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0VSZXiPE9VSi libva 2.0 was released in 2017 and the 2.x versions are included in all supported distributions nowadays. --- Fixed some orphaned labels. libavcodec/vaapi_decode.c | 39 ++--------------- libavcodec/vaapi_encode.c | 78 ++++++---------------------------- libavcodec/vaapi_encode.h | 9 ---- libavcodec/vaapi_encode_h264.c | 18 -------- libavcodec/vaapi_encode_h265.c | 2 - 5 files changed, 15 insertions(+), 131 deletions(-) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 21b273cd0f..ef1ea27a08 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -191,16 +191,10 @@ int ff_vaapi_decode_issue(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode " "issue: %d (%s).\n", vas, vaErrorStr(vas)); err = AVERROR(EIO); - if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) - goto fail; - else - goto fail_at_end; + goto fail; } - if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) - ff_vaapi_decode_destroy_buffers(avctx, pic); + ff_vaapi_decode_destroy_buffers(avctx, pic); err = 0; goto exit; @@ -213,7 +207,6 @@ fail_with_picture: } fail: ff_vaapi_decode_destroy_buffers(avctx, pic); -fail_at_end: exit: pic->nb_param_buffers = 0; pic->nb_slices = 0; @@ -406,12 +399,10 @@ static const struct { H264ConstrainedBaseline), MAP(H264, H264_MAIN, H264Main ), MAP(H264, H264_HIGH, H264High ), -#if VA_CHECK_VERSION(0, 37, 0) MAP(HEVC, HEVC_MAIN, HEVCMain ), MAP(HEVC, HEVC_MAIN_10, HEVCMain10 ), MAP(HEVC, HEVC_MAIN_STILL_PICTURE, HEVCMain ), -#endif #if VA_CHECK_VERSION(1, 2, 0) && CONFIG_HEVC_VAAPI_HWACCEL MAP(HEVC, HEVC_REXT, None, ff_vaapi_parse_hevc_rext_scc_profile ), @@ -429,14 +420,10 @@ static const struct { MAP(VC1, VC1_COMPLEX, VC1Advanced ), MAP(VC1, VC1_ADVANCED, VC1Advanced ), MAP(VP8, UNKNOWN, VP8Version0_3 ), -#if VA_CHECK_VERSION(0, 38, 0) MAP(VP9, VP9_0, VP9Profile0 ), -#endif -#if VA_CHECK_VERSION(0, 39, 0) MAP(VP9, VP9_1, VP9Profile1 ), MAP(VP9, VP9_2, VP9Profile2 ), MAP(VP9, VP9_3, VP9Profile3 ), -#endif #if VA_CHECK_VERSION(1, 8, 0) MAP(AV1, AV1_MAIN, AV1Profile0), MAP(AV1, AV1_HIGH, AV1Profile1), @@ -599,27 +586,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, if (err < 0) goto fail; - if (CONFIG_VAAPI_1) - frames->initial_pool_size = 0; - else { - frames->initial_pool_size = 1; - // Add per-codec number of surfaces used for storing reference frames. - switch (avctx->codec_id) { - case AV_CODEC_ID_H264: - case AV_CODEC_ID_HEVC: - case AV_CODEC_ID_AV1: - frames->initial_pool_size += 16; - break; - case AV_CODEC_ID_VP9: - frames->initial_pool_size += 8; - break; - case AV_CODEC_ID_VP8: - frames->initial_pool_size += 3; - break; - default: - frames->initial_pool_size += 2; - } - } + frames->initial_pool_size = 0; } av_hwframe_constraints_free(&constraints); diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index f54b2579ec..6f062e8277 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -530,7 +530,6 @@ static int vaapi_encode_issue(AVCodecContext *avctx, } } -#if VA_CHECK_VERSION(1, 0, 0) sd = av_frame_get_side_data(pic->input_image, AV_FRAME_DATA_REGIONS_OF_INTEREST); if (sd && ctx->roi_allowed) { @@ -593,7 +592,6 @@ static int vaapi_encode_issue(AVCodecContext *avctx, if (err < 0) goto fail; } -#endif vas = vaBeginPicture(ctx->hwctx->display, ctx->va_context, pic->input_surface); @@ -618,26 +616,17 @@ static int vaapi_encode_issue(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "Failed to end picture encode issue: " "%d (%s).\n", vas, vaErrorStr(vas)); err = AVERROR(EIO); - // vaRenderPicture() has been called here, so we should not destroy - // the parameter buffers unless separate destruction is required. - if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) - goto fail; - else - goto fail_at_end; - } - - if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { - for (i = 0; i < pic->nb_param_buffers; i++) { - vas = vaDestroyBuffer(ctx->hwctx->display, - pic->param_buffers[i]); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to destroy " - "param buffer %#x: %d (%s).\n", - pic->param_buffers[i], vas, vaErrorStr(vas)); - // And ignore. - } + goto fail; + } + + for (i = 0; i < pic->nb_param_buffers; i++) { + vas = vaDestroyBuffer(ctx->hwctx->display, + pic->param_buffers[i]); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to destroy " + "param buffer %#x: %d (%s).\n", + pic->param_buffers[i], vas, vaErrorStr(vas)); + // And ignore. } } @@ -654,7 +643,6 @@ fail: for (i = 0; i < pic->nb_slices; i++) av_freep(&pic->slices[i].codec_slice_params); } -fail_at_end: av_freep(&pic->codec_picture_params); av_freep(&pic->param_buffers); av_freep(&pic->slices); @@ -1530,25 +1518,19 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = { { "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 }, { "XYUV", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 }, { "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 }, -#if VA_CHECK_VERSION(0, 38, 1) { "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 }, -#endif }; static const VAEntrypoint vaapi_encode_entrypoints_normal[] = { VAEntrypointEncSlice, VAEntrypointEncPicture, -#if VA_CHECK_VERSION(0, 39, 2) VAEntrypointEncSliceLP, -#endif 0 }; -#if VA_CHECK_VERSION(0, 39, 2) static const VAEntrypoint vaapi_encode_entrypoints_low_power[] = { VAEntrypointEncSliceLP, 0 }; -#endif static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) { @@ -1566,13 +1548,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) if (ctx->low_power) { -#if VA_CHECK_VERSION(0, 39, 2) usable_entrypoints = vaapi_encode_entrypoints_low_power; -#else - av_log(avctx, AV_LOG_ERROR, "Low-power encoding is not " - "supported with this VAAPI version.\n"); - return AVERROR(EINVAL); -#endif } else { usable_entrypoints = vaapi_encode_entrypoints_normal; } @@ -1623,11 +1599,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) avctx->profile != AV_PROFILE_UNKNOWN) continue; -#if VA_CHECK_VERSION(1, 0, 0) profile_string = vaProfileStr(profile->va_profile); -#else - profile_string = "(no profile names)"; -#endif for (j = 0; j < n; j++) { if (va_profiles[j] == profile->va_profile) @@ -1686,11 +1658,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) } ctx->va_entrypoint = va_entrypoints[i]; -#if VA_CHECK_VERSION(1, 0, 0) entrypoint_string = vaEntrypointStr(ctx->va_entrypoint); -#else - entrypoint_string = "(no entrypoint names)"; -#endif av_log(avctx, AV_LOG_VERBOSE, "Using VAAPI entrypoint %s (%d).\n", entrypoint_string, ctx->va_entrypoint); @@ -1807,16 +1775,10 @@ static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx) supported_va_rc_modes = rc_attr.value; if (ctx->blbrc) { -#if VA_CHECK_VERSION(0, 39, 2) if (!(supported_va_rc_modes & VA_RC_MB)) { ctx->blbrc = 0; av_log(avctx, AV_LOG_WARNING, "Driver does not support BLBRC.\n"); } -#else - ctx->blbrc = 0; - av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 0.39.2 " - "or above, which can support BLBRC.\n"); -#endif } for (i = 0; i < FF_ARRAY_ELEMS(vaapi_encode_rc_modes); i++) { @@ -2044,11 +2006,7 @@ rc_mode_found: ctx->config_attributes[ctx->nb_config_attributes++] = (VAConfigAttrib) { .type = VAConfigAttribRateControl, -#if VA_CHECK_VERSION(0, 39, 2) .value = ctx->blbrc ? ctx->va_rc_mode | VA_RC_MB : ctx->va_rc_mode, -#else - .value = ctx->va_rc_mode, -#endif }; } @@ -2081,9 +2039,7 @@ rc_mode_found: #if VA_CHECK_VERSION(1, 3, 0) .quality_factor = rc_quality, #endif -#if VA_CHECK_VERSION(0, 39, 2) .rc_flags.bits.mb_rate_control = ctx->blbrc ? 1 : 2, -#endif }; vaapi_encode_add_global_param(avctx, VAEncMiscParameterTypeRateControl, @@ -2119,12 +2075,10 @@ rc_mode_found: ctx->fr_params = (VAEncMiscParameterFrameRate) { .framerate = (unsigned int)fr_den << 16 | fr_num, }; -#if VA_CHECK_VERSION(0, 40, 0) vaapi_encode_add_global_param(avctx, VAEncMiscParameterTypeFrameRate, &ctx->fr_params, sizeof(ctx->fr_params)); -#endif return 0; } @@ -2338,11 +2292,9 @@ static av_cold int vaapi_encode_init_row_slice_structure(AVCodecContext *avctx, } ctx->nb_slices = (ctx->slice_block_rows + k - 1) / k; ctx->slice_size = k; -#if VA_CHECK_VERSION(1, 0, 0) } else if (slice_structure & VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS) { ctx->nb_slices = ctx->slice_block_rows; ctx->slice_size = 1; -#endif } else { av_log(avctx, AV_LOG_ERROR, "Driver does not support any usable " "slice structure modes (%#x).\n", slice_structure); @@ -2566,7 +2518,6 @@ static av_cold int vaapi_encode_init_packed_headers(AVCodecContext *avctx) static av_cold int vaapi_encode_init_quality(AVCodecContext *avctx) { -#if VA_CHECK_VERSION(0, 36, 0) VAAPIEncodeContext *ctx = avctx->priv_data; VAStatus vas; VAConfigAttrib attr = { VAConfigAttribEncQualityRange }; @@ -2603,17 +2554,12 @@ static av_cold int vaapi_encode_init_quality(AVCodecContext *avctx) &ctx->quality_params, sizeof(ctx->quality_params)); } -#else - av_log(avctx, AV_LOG_WARNING, "The encode quality option is " - "not supported with this VAAPI version.\n"); -#endif return 0; } static av_cold int vaapi_encode_init_roi(AVCodecContext *avctx) { -#if VA_CHECK_VERSION(1, 0, 0) VAAPIEncodeContext *ctx = avctx->priv_data; VAStatus vas; VAConfigAttrib attr = { VAConfigAttribEncROI }; @@ -2640,7 +2586,7 @@ static av_cold int vaapi_encode_init_roi(AVCodecContext *avctx) (ctx->va_rc_mode == VA_RC_CQP || roi.bits.roi_rc_qp_delta_support); } -#endif + return 0; } diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index 0eed9691ca..43f3b8cf82 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -22,10 +22,7 @@ #include #include - -#if VA_CHECK_VERSION(1, 0, 0) #include -#endif #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_vaapi.h" @@ -82,12 +79,8 @@ typedef struct VAAPIEncodePicture { void *opaque; AVBufferRef *opaque_ref; -#if VA_CHECK_VERSION(1, 0, 0) // ROI regions. VAEncROI *roi; -#else - void *roi; -#endif int type; int b_depth; @@ -293,9 +286,7 @@ typedef struct VAAPIEncodeContext { VAEncMiscParameterHRD hrd_params; VAEncMiscParameterFrameRate fr_params; VAEncMiscParameterBufferMaxFrameSize mfs_params; -#if VA_CHECK_VERSION(0, 36, 0) VAEncMiscParameterBufferQualityLevel quality_params; -#endif // Per-sequence parameter structure (VAEncSequenceParameterBuffer*). void *codec_sequence_params; diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index d656b1020f..bb4c250bb4 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -106,7 +106,6 @@ typedef struct VAAPIEncodeH264Context { int aud_needed; int sei_needed; - int sei_cbr_workaround_needed; } VAAPIEncodeH264Context; @@ -271,19 +270,6 @@ static int vaapi_encode_h264_write_extra_header(AVCodecContext *avctx, *type = VAEncPackedHeaderRawData; return 0; - -#if !CONFIG_VAAPI_1 - } else if (priv->sei_cbr_workaround_needed) { - // Insert a zero-length header using the old SEI type. This is - // required to avoid triggering broken behaviour on Intel platforms - // in CBR mode where an invalid SEI message is generated by the - // driver and inserted into the stream. - *data_len = 0; - *type = VAEncPackedHeaderH264_SEI; - priv->sei_cbr_workaround_needed = 0; - return 0; -#endif - } else { return AVERROR_EOF; } @@ -681,10 +667,6 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, if (priv->sei & SEI_IDENTIFIER && pic->encode_order == 0) priv->sei_needed |= SEI_IDENTIFIER; -#if !CONFIG_VAAPI_1 - if (ctx->va_rc_mode == VA_RC_CBR) - priv->sei_cbr_workaround_needed = 1; -#endif if (priv->sei & SEI_TIMING) { priv->sei_pic_timing = (H264RawSEIPicTiming) { diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 2f59161346..a85b514715 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -1302,10 +1302,8 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = { { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, -#if VA_CHECK_VERSION(0, 37, 0) { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, -#endif #if VA_CHECK_VERSION(1, 2, 0) { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },