From patchwork Wed Oct 2 23:04:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 15477 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 902D644A22E for ; Thu, 3 Oct 2019 02:11:07 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C9DE688190; Thu, 3 Oct 2019 02:11:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98938687F5A for ; Thu, 3 Oct 2019 02:11:06 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id i1so810847wro.4 for ; Wed, 02 Oct 2019 16:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=chLjlNRtSv/Sm2KtLRae3k2oP9YPX9MPZBGogwJtXUg=; b=L3nbEjf9X+f6ZGOE9Zgm99y9SZ4xJ3FpBEvS4enoFvch6uApwNl1xm590vTH5UbIKd PPeLzSN3dpUryicB6LXZwdq37YHkAtbaMe3cG6CRRipmMaMv/zUo4aZqiLK8p1bhKS58 v1/30pF60MID2fAiGh1sWUL4ag9vXOcXib+EJ4Sb7uG1smhJ2oFHp1Jy6D0O2ByfYZIg J51Op7LzW8rWOUgVkdUjvzoQ3ffPBdc5qCM7Qq52/ghdXOR6pwb+t+DMmm0ax+jJR1PN /ueF+xxX9vU/p5dFcChNlKdSxrHMlG4JMOYmmZYbKjmqvyxqjMHIZE1cpAesRXlgYMgh VGvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=chLjlNRtSv/Sm2KtLRae3k2oP9YPX9MPZBGogwJtXUg=; b=T+qh5KKBdz+TRtid47uD/3suvFnqwJgRdKxujWd/J7PO4KUA9XfIPj/BEYxCE3yuYU wdUGBauzOou4cp4Pv9i5Ilbu2uRtxcD7uNxjf8lxHsAPNTOsV9hVRn7J0LpUwTL59FrQ r1QOaviM/kNfK+e541iK5ZTSFWcMuAem3Ex0FDz7D/4mD1n8sQjCcGXNexsrpHi/74gV gl4sisUZaiEKP4e5QaTpvbYGBh+hDBE/q7ZuOw3HoJlSWBYwP4PLMXfgsWlfpek4pSCW dD98GaEjTNx5wX4LLi5/crFaLo3gvBCbP6JqOWEJCsRnCo6ZVurbr+PgUPtXRN4VNWK2 vg5A== X-Gm-Message-State: APjAAAUhisqlyGW2k2CXnXtVYGd13v+ElovjGjAt7nZ2DhuZCYkQPj0i R2qVkCpvotEB5nClTaJsPdtt4z83jZ0= X-Google-Smtp-Source: APXvYqym5olYw0YBr5iO1NliUPshIH2VSsm9T+lUPYZjPkTSgeHUAcj7ViPqdwABCZUjwKtGStVPBg== X-Received: by 2002:a5d:5111:: with SMTP id s17mr4138291wrt.59.1570057500275; Wed, 02 Oct 2019 16:05:00 -0700 (PDT) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id o9sm1489808wrh.46.2019.10.02.16.04.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 16:04:59 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Thu, 3 Oct 2019 00:04:39 +0100 Message-Id: <20191002230453.6462-4-sw@jkqxz.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191002230453.6462-1-sw@jkqxz.net> References: <20191002230453.6462-1-sw@jkqxz.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 04/18] cbs: Add macros to support defining unit type tables 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/cbs_internal.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index 7ed8ea0049..2b83c03408 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -146,6 +146,30 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) +#define CBS_UNIT_TYPE_POD(type, structure) { \ + .nb_unit_types = 1, \ + .unit_types = { type }, \ + .content_type = CBS_CONTENT_TYPE_POD, \ + .content_size = sizeof(structure), \ + } +#define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field) { \ + .nb_unit_types = 1, \ + .unit_types = { type }, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .nb_ref_offsets = 1, \ + .ref_offsets = { offsetof(structure, ref_field) }, \ + } +#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) { \ + .nb_unit_types = 1, \ + .unit_types = { type }, \ + .content_type = CBS_CONTENT_TYPE_COMPLEX, \ + .content_size = sizeof(structure), \ + .content_free = free_func, \ + } +#define CBS_UNIT_TYPE_END_OF_LIST { .nb_unit_types = 0 } + + extern const CodedBitstreamType ff_cbs_type_av1; extern const CodedBitstreamType ff_cbs_type_h264; extern const CodedBitstreamType ff_cbs_type_h265;