From patchwork Tue Jul 7 23:30:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongle Lin X-Patchwork-Id: 20863 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5AFC044B3B9 for ; Wed, 8 Jul 2020 02:30:42 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39F0B6881CD; Wed, 8 Jul 2020 02:30:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42A05680891 for ; Wed, 8 Jul 2020 02:30:36 +0300 (EEST) Received: by mail-pj1-f68.google.com with SMTP id md7so349696pjb.1 for ; Tue, 07 Jul 2020 16:30:36 -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=R4Sg5YA98muxd7OYuLQSaVLr0t4s7LbfeDR336VMQhv30o7UnPOD59sX+ee92X3ajt NC00l6GRuRdgvCqiqSjvNsU7SIFCkPMLiOjaVlIe/MI+pjmWhmRhOYQUWKVLww60BCR/ z9SBRv1pUjPfeoyTSkKN/GONljANDzx+WXlJDmYBZvE/jLb+WXaDVQ3tBhDzL7UjhweE MIA9Q3pVE25HiS6yb2qxd5JwwyHC2a1VyUVHtYOFOK1qFxl1Y/XxmL3UwEfidC0DgBlo lIuk7LKSsgPC3lMtrQNwvZhiwh/zprCFfBubBprey4CYbx6a2fShw7sYfAWlNpJa1IuQ zWqQ== 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=Hov8/BsqFfxnkoJE2PGKAGZWalha4XJEVJmvs3Jh0yA6jW54hNdy1Vx8Chcel8no0k SFGugjwzuvSxux5AnNAgpig98KM1Tk5vk30HvbaRu6km3g+8VLwAPKICdDRCMhaxp+Jw X4Qdh1ig9cKwIM1jeQu2TTSFV76VERKwLxXzMGBqQm+KvEQhYN1tvuwrSL3x7CcRZtKw MdJypva/wAlsJ2OJTDEDD9Zszb8AReb3YIiRZfc1VThdZT50rUIdf3OxmmIjzBOfHrSt JjCwnxpoF9ijj854KjowrP0F0Q7xt8nm0VhvW7//lil1N/kdKuppOfdWVX7Ryiuwdfip 0Wyg== X-Gm-Message-State: AOAM533laUOZEApQs9D/UGsGdffPE8c5Mq95f/fqiGvkaSuO2BUZJWCt qrPjM1AF3xtG/g6s/pXbbeYOukAv X-Google-Smtp-Source: ABdhPJyLhHMmx5pTrP3IbWBAKbkWZ0rvtff3fY/lg87QihiMqsVSTva5C0p1ljrJkBZxzTQcGyqIVg== X-Received: by 2002:a17:902:8348:: with SMTP id z8mr30608112pln.113.1594164633706; Tue, 07 Jul 2020 16:30:33 -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 u66sm6311428pfb.191.2020.07.07.16.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 16:30:33 -0700 (PDT) From: Yongle Lin X-Google-Original-From: Yongle Lin To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Jul 2020 23:30:13 +0000 Message-Id: <20200707233013.2796832-1-yonglel@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-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" 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; /*