From patchwork Wed Jul 15 17:43:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongle Lin X-Patchwork-Id: 21114 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:80ca:0:0:0:0:0 with SMTP id c10csp637642ybm; Wed, 15 Jul 2020 10:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxcaxYEoE0KkCTTwagfBovAZTB4PRtmznXDq0FW6SBrmCuVAh0Jpy85d+SbIY+2yy95GDr X-Received: by 2002:a5d:4dc2:: with SMTP id f2mr501760wru.399.1594835563179; Wed, 15 Jul 2020 10:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594835563; cv=none; d=google.com; s=arc-20160816; b=e1NEf33npbZrBLQVhs5T2eXVRtXh4BsNKRnpLifi1FOIhgXA9mAENEYMCWxF0ByoJV 31SF4fY6N7ftM/goYUbna/YQnwJBOyxK6Qy2ePbfruVWO7Ig7vwerSaoKFxCICXVOu1l qjGMhGdt0/TfZATSlTMbpFn7HmJvKGDWB4hR4sq7/bDWrDvTITuP2w+ilR/T3TZU1osR Syuts/ueRQ8flVHoLpWeIznQl+WVhn/sv2AY6tRy9Es5XbWxD3PxlcfTYBqc8AAkje32 yT4w5pxeXKf9IbaIem1ouw2zRnzoDiyQhpymKSsFAt16VrUeI06nonCvBQut1s/H37Ub +PxQ== 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=zNAebu6pTYXE24vrguBdoJa0a5KRfILHHWdTHfbgkyE=; b=Us+08apMTjU/cyLFbNWGZR+9QuuyHbwTeoVaFm4Rsghz4F6EFwYT3EfndmTzylOaoA k5QW5i4l461AkHOqCEQAOnRSmMPibwE76cET9jPrjmqsHGI+5ZL2jqFc9SDmDwjBfQvL uZKjnI3I5ss4d8GGXPuBDvwZ3CfHQXoM2wJiOjUzT0vYupGIiaiaKF9wBPmbgxeVTMk3 1oPHVBem1meSm3fTa20VkspjxUMJaeq7h2E8JZXu4FxywDezVSn/dArxSn3+EQxFrXpy 7YyWRw9hEkG9WKH49cZ1NYe2qJ+lcm1ZdP1IdNzxssG5Ih+Nai5tawedwuvKxXGufe+4 UyWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="n/CFMJ0K"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a18si2289417wrq.521.2020.07.15.10.52.42; Wed, 15 Jul 2020 10:52:43 -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=@gmail.com header.s=20161025 header.b="n/CFMJ0K"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7CD968B0F4; Wed, 15 Jul 2020 20:52:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 053D4688076 for ; Wed, 15 Jul 2020 20:52:34 +0300 (EEST) Received: by mail-pl1-f196.google.com with SMTP id 72so2698903ple.0 for ; Wed, 15 Jul 2020 10:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TKau8D/5MZjAG83KTiLZAQ9U71bnk4VWKfkF8/lhDzs=; b=n/CFMJ0Kqmujbcug5lC1RzAnG7mPPhQ5BOw6QIOaPLJWIhK1UsK9qO9ezsQ0qB85F9 MsqE+Kauab0TWkJNBgGUqt2sEOjO85zPTrLRbSsEwipaA7CSsBbbRHFkNrUKEG9B5chZ vKGWVvA34ehAirRShubI5bKXSVWWpii417VAqVry0S5G6TF3jInpDfiZ26Cn9e5sryWT ozfU8p/4iTPjuFPr0I1OvSNTCCklLqiP2Q83zzrMioy5NHMwW3O2VOiP+FsQat7iMDf0 lDchj0CEcCVzOQp2HW/6j4z53vEnISjA+BkV6lWP4helol2RJV4SRSkGxjKp76BSA3Rg QHOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TKau8D/5MZjAG83KTiLZAQ9U71bnk4VWKfkF8/lhDzs=; b=LaKo/fGO1Zdf3VeOVaBI0QrshbQFElYVamORATlVN+5RRo/3jjIEvAvYj5wGwT6yQD ddMGQHkra2qloJKhxS9wa9UWcY6SrW478Mi0E4yyYC/pu2d/IVZD6BUqOw536kGsy6hL pxpC2hJzxtRAdAayzD54WIj8af9dfSFwOqf2XeTWiGSVZRkx0yLfkgtVVjbBHYbl7f6f mu7iID80X0gDpPZG1FbDIJe6CbKW4r7g69p8ujuWsqTitcGfMrkwAydksCQHjT2FR7qF pBp6U+WYFDttpWGgkyCGUpqOP3gsn/anGENzdTO80huVPadxr5Gz43QNKyoKUNOAI3Kd iM5w== X-Gm-Message-State: AOAM531hn1s2+O5w+Bc+BoZIn7EsxqLZ/R0yPgXm9hj2N1mg8yg+Gtxo IfwY2Ixinc3tX/DKTyuQyVtSyQ+K X-Received: by 2002:a17:902:6bca:: with SMTP id m10mr480244plt.210.1594835047706; Wed, 15 Jul 2020 10:44:07 -0700 (PDT) Received: from yonglel.c.googlers.com.com (197.59.83.34.bc.googleusercontent.com. [34.83.59.197]) by smtp.gmail.com with ESMTPSA id lx9sm2978820pjb.52.2020.07.15.10.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 10:44:07 -0700 (PDT) From: Yongle Lin X-Google-Original-From: Yongle Lin To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jul 2020 17:43:11 +0000 Message-Id: <20200715174312.748254-1-yonglel@google.com> X-Mailer: git-send-email 2.27.0.389.gc38d7665816-goog In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavutil/video_enc_params: add block type X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Yongle Lin Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: SOaG/llKB2a6 Content-Length: 2339 add block type field to AVVideoBlockParams so we could either export or visualize it later. --- libavutil/video_enc_params.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h index 43fa443154..8bf5f240c9 100644 --- a/libavutil/video_enc_params.h +++ b/libavutil/video_enc_params.h @@ -57,6 +57,11 @@ enum AVVideoEncParamsType { AV_VIDEO_ENC_PARAMS_H264, }; +enum AVVideoBlockFlags { + AV_VIDEO_ENC_BLOCK_INTRA = 1ULL << 0, /* Indicates block uses intra prediction */ + AV_VIDEO_ENC_BLOCK_SKIP = 1ULL << 1, /* Indicates block is not coded (skipped) */ +}; + /** * Video encoding parameters for a given frame. This struct is allocated along * with an optional array of per-block AVVideoBlockParams descriptors. @@ -126,6 +131,20 @@ typedef struct AVVideoBlockParams { * corresponding per-frame value. */ int32_t delta_qp; + + /** + * Type flag of the block + * Each bit field indicates a type flag + */ + enum AVVideoBlockFlags flags; + + /** + * Reference frames used for prediction + * Each entry specifies the first/second/third/etc. reference frame the current frame uses. + * The value at each entry specifies the index inside the reference frame array for that current frame. + * Any entry that is unused will be set to -1 + */ + int8_t ref[8]; } AVVideoBlockParams; /*