From patchwork Tue Jul 23 07:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 50701 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a742:0:b0:482:c625:d099 with SMTP id f2csp2457418vqm; Tue, 23 Jul 2024 00:46:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUMUTdtjWN5z/6eCO/S81XbnxknSubgbxP9cnsxD3WuCmprI1eDwLy9prp5/4ijR5+n7MfLRV0gqctmIPBkHAwtpibx9icmPIQ8eQ== X-Google-Smtp-Source: AGHT+IFVm2/3p1MIyqGFbuc7Jo3jk4YWPocVyMu+ifj+lSfEnJTEvxq7BWxi8Q8pAy3xG2ECwcGP X-Received: by 2002:a05:651c:1a2c:b0:2ef:2b65:1d03 with SMTP id 38308e7fff4ca-2ef2b651e57mr66762721fa.49.1721720811401; Tue, 23 Jul 2024 00:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721720811; cv=none; d=google.com; s=arc-20160816; b=Ag8WRPBuK5hCo5mnDudgArizcmbvfxVxaZZ6ZU/65d8P2DJ4KrM8bBdXQN16bz0OKz 6UfXQ7/AW3gNO8/xGxio0gtaF1yaznz1jS76qfbXEkooWfT0vcGvsJW8sJUdavSCb1s4 Cp3FdN4jDmfAOThvVmLLKJiazmndNXU0sPfHmDxGrBP9WTQYEM1+7XkrAQKkXOGuX9Se 6OosW0MA8UCUOyqGLnFc2j11zxCpQXrU1w8Rdijlah7BcEKKhfrIBopYEXspra5NegFB YBxhGq2EtiRV+yCpFlFwaCB3SGWKUu0KGs3qE/DLAZuDh5/gvGa+I8xFXfyfycORgSu+ zOXg== 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:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=QX8gcli5Vth+Kss2rwjMS9j+sLjTTdWYEOayGcCkzog=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=LlYi7sDYcXPB5zyrWxcxlYmc6jczahyQjar2p5u/bq2I1wEqmkymII4jpD554roxLD VhW1PxTM/zXdLEHKn7PlX03q6UllfJ8lvzGfU7etY5gxP89PWjgIWavl6vny/vArfyEv jvrvP14u17nD0C1uL8fPCwen/86D7/pVx6WLget3ywPtmQgpEywf4V0gWs3GSdAmt+ME AEA4Jt6mdK2CPe19XC65oJE6SzdOSKZIIfxwFA5fpauihDLdS44yVoEZ5dYnuTfCVkvJ U7T46wcWx+QC54uGxXB4/lR1kt+cH4O5ccYww9jNfYP4VVlakHeFsiaHZVDBNK1T20TM FGQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=RQMBZOCP; 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 38308e7fff4ca-2ef1f42179asi16840471fa.346.2024.07.23.00.46.50; Tue, 23 Jul 2024 00:46:51 -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=@khirnov.net header.s=mail header.b=RQMBZOCP; 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 8920A68D5A7; Tue, 23 Jul 2024 10:37:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 734B668D361 for ; Tue, 23 Jul 2024 10:37:48 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=RQMBZOCP; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 947E04DDB for ; Tue, 23 Jul 2024 09:37:47 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Iy0pUCXUKNlT for ; Tue, 23 Jul 2024 09:37:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1721720266; bh=hn0NfbZjEg6EnMEjKBBzaLLqTy2I0QeBpShyH3EVRAM=; h=From:To:Subject:Date:From; b=RQMBZOCPcO34PMnamm+m8nw1FtZh1oZxwQysvw/H2l/9PQkyKPIT4IToIlNqU735z KgeX4k/0wia+i0snzoJJSBpPiy66BvZOs8WIWNXFDNq+HQVrJQOQkzoyuilTaQe9gC Lia3GiIC64zVfY/NsRZwAz3utqTMQ6nY+9AZhGnAOaEnMaTAHBLWQG4yT4r15Q7nv0 0ZJMdMvHGeWVvJfr3zEg35fg37zd3uHQNQhQKwiK6ZgCqYX2g5nQF1Jc7A7Wxbzbnn Qz60Eyez+77uKbN52X/ZZlJkAEC1sA3my/Dp7dVM7E1GdxrS3e5rD4qDoEo15DmG+2 ar4rT25IuBObg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 8472E998 for ; Tue, 23 Jul 2024 09:37:46 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5C3AE3A02B4 for ; Tue, 23 Jul 2024 09:37:46 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Jul 2024 09:36:15 +0200 Message-ID: <20240723073720.28871-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame 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: BeIDoYottR7g HEVCContext.output_frame will be removed in following commits. Reported-By: Max Bykov --- Untested, testing welcome. Cf. '[PATCH 37/39] lavc/hevcdec: use a ContainerFifo to hold frames scheduled for output' currently on ML. --- libavcodec/videotoolbox.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 3dd804bb0c..505483ef66 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -1053,6 +1053,14 @@ static int videotoolbox_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { + HEVCContext *h = avctx->priv_data; + AVFrame *frame = h->cur_frame->f; + + frame->crop_right = 0; + frame->crop_left = 0; + frame->crop_top = 0; + frame->crop_bottom = 0; + return 0; } @@ -1079,11 +1087,6 @@ static int videotoolbox_hevc_end_frame(AVCodecContext *avctx) VTContext *vtctx = avctx->internal->hwaccel_priv_data; int ret; - h->output_frame->crop_right = 0; - h->output_frame->crop_left = 0; - h->output_frame->crop_top = 0; - h->output_frame->crop_bottom = 0; - ret = ff_videotoolbox_common_end_frame(avctx, frame); vtctx->bitstream_size = 0; return ret;