From patchwork Mon Apr 25 22:54:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Degawa X-Patchwork-Id: 35438 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b9e:b0:7d:cfb5:dc7c with SMTP id b30csp2112959pzh; Mon, 25 Apr 2022 15:55:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2XoJsBOyww9g0d+QQMHp2lMbh1nIcmrSQfdldcfgEWuPlTVmlzQeUt82FfQgSI6VNehpx X-Received: by 2002:a17:906:4fcb:b0:6e8:74db:6b04 with SMTP id i11-20020a1709064fcb00b006e874db6b04mr18846360ejw.676.1650927309998; Mon, 25 Apr 2022 15:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650927309; cv=none; d=google.com; s=arc-20160816; b=JBJwSvhnsagd/+VY7OCRGzTsi55PYtW5llpfUy5oReVN9moGHMVj5HrQ0gzLROBvtZ BOBE5NDmM35ceiZv9kkdKg0BaLnUZuwiCRUnUB9o8YiD+ibVejjnLOFKYjd/X7NIF61H h3g6CIJtqJxRd+9WeuSESTI0yWGPkhgJSPGal0wB1qOy3Sw0fFjkjvr8GvlxcIX3VJYC hXWavsFha7mVXa664uBtuGO368iMWmKZNE7dZJNDp+K6xF0Bvop4+LKjwYpep3MW+r75 jTLdQjh6/BpdHj0DMfbUpJDBixZwdA0nHWYeX52BCtKli4fVc3GDg1S4sQ8n1y8PSjsb n6AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=G07OAjIXsnVrFp0oQI8WXFlxm/e+/qs81PtRnpZIjcQ=; b=euS1y0dzP0GIjsUYdieXKsFdVTeEvzCB5xCLtiWpTcIlBso5sP3XCoRxp22Ke4DIPy FT88tQXulz8IVU9YB0CwBfU4EavgJsIfmD/jQ/7nBB2gNofUB6D/00VPIfjJrrLrkjxC T/aO9uel47ZwgKErRApLb37LafWMhSRJF8X0sqPrTPvTGB0CTa5KaDCv60b3YtNxOkKS 5QTzNdaNfF6kftFLIrmXhyLkJ3mQSEDpd5VIJPRALAlUafbNqohfP3p6SKUO7t/CoziB jdEDTpFllIYP4kYNppnCpz4LAX99YA4Bkm9o99l0XbYn7A5nzn4rTGi149MEuf5X8jmF nZww== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@randomderp.com header.s=default header.b=HPKE3sVZ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=randomderp.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g17-20020a170906521100b006e8b37b2f82si12873994ejm.118.2022.04.25.15.55.09; Mon, 25 Apr 2022 15:55:09 -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=@randomderp.com header.s=default header.b=HPKE3sVZ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=randomderp.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A802668A410; Tue, 26 Apr 2022 01:55:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from degawa.com (unknown [174.127.109.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3DD5168029F for ; Tue, 26 Apr 2022 01:54:59 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomderp.com; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=as2VOkHrXTSRx6uuvhFMYK6ECAmLi1ZhYUwATKMYvqw=; b=HPKE3sVZfDbY1M+WScYV0lHpPJ cWN+tEu85El8gcj9TYfjVS0I0HIn/gt2nyBbC0G2/OW1ySJhXIt8oDGvILZLS7PyDEAw7fmvhT/75 QwPSfHN9ASbN+XTZvnlCgq2lxliL8AK8h9K2sxfjrfWUAz+X3FY7MZNYNE5g1aaLctE3SEdwbUQ8a FkpAydwbsrNK1b/Sbugen7OYmFneYxgx3Ij7m6ZBZEW0JPFNULMEzHkNZ//oHH0L7E4WYkKdB1C6J bogQLcQMuJBWEffLjLWZDSeojgYF4NX6RqHh3g+asn316FczI1I+1pVPTc68vZq7Y4XnKUfGdWky+ mtpiCFiA==; Received: from 108-216-168-194.lightspeed.mmphtn.sbcglobal.net ([108.216.168.194]:55132 helo=localhost.localdomain) by slmp-550-1.slc.westdc.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nj7be-0006z6-2A; Mon, 25 Apr 2022 16:54:57 -0600 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Apr 2022 17:54:38 -0500 Message-Id: <20220425225438.434800-1-ccom@randomderp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220425223719.432161-1-ccom@randomderp.com> References: <20220425223719.432161-1-ccom@randomderp.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - slmp-550-1.slc.westdc.net X-AntiAbuse: Original Domain - ffmpeg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - randomderp.com X-Get-Message-Sender-Via: slmp-550-1.slc.westdc.net: authenticated_id: ccom/from_h X-Authenticated-Sender: slmp-550-1.slc.westdc.net: ccom@randomderp.com X-Source: X-Source-Args: X-Source-Dir: Subject: [FFmpeg-devel] [PATCH v2] avcodec/libsvtav1: pass pict_type to library 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: Christopher Degawa Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: jk09BHgY4G5G match the behavior of SvtAv1EncApp to ensure pic_type is always set before passing it to the library. The other options for pic_type aren't currently used inside the library, so they aren't introduced in this patch. Signed-off-by: Christopher Degawa --- libavcodec/libsvtav1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 2e3d96ce37..088b9bab02 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -404,6 +404,16 @@ static int eb_send_frame(AVCodecContext *avctx, const AVFrame *frame) headerPtr->p_app_private = NULL; headerPtr->pts = frame->pts; + switch (frame->pict_type) { + case AV_PICTURE_TYPE_I: + headerPtr->pic_type = EB_AV1_KEY_PICTURE; + break; + default: + // Actually means auto, or default. + headerPtr->pic_type = EB_AV1_INVALID_PICTURE; + break; + } + svt_av1_enc_send_picture(svt_enc->svt_handle, headerPtr); return 0;