From patchwork Mon May 20 23:02:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 13206 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 C970D44627B for ; Tue, 21 May 2019 02:02:38 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B12AA68A7C4; Tue, 21 May 2019 02:02:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DF7B568A70E for ; Tue, 21 May 2019 02:02:32 +0300 (EEST) Received: by mail-wr1-f48.google.com with SMTP id r4so16324652wro.10 for ; Mon, 20 May 2019 16:02:32 -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=v0IZFKKEftaKmY/8Iz31EftkwA6oAa/GGLiLCwgd7dE=; b=1YUTDJCGE4PjwVLSta1qGCmdY3Lu16flqVKSu48rjosjmFX2H8SPDXWrK8tMuUAJyT WclyCn2qXaPboL+hVR2g+DpK2ZizuS3SJwZzMzpk/8qrO7lpIwLr+yX7vgtkwwn31XJA rRs3Sr3f1BjUmJPswb3pC5AYJ0g9aSRXXEPz00UvXh5s24HpVYxvTxEyLsDbgvncPKNy 7q8BSHowe5dnSA2RUtZmeff6J0Px5Z8ABbaZYA0tEwW2nuZ3pshT1taYuBkopuBULaLz naZmqeKm/5366Pcu64nFVvccBXrtx5y2aYeUxAG9OPNF3A+y/PFHpZQ8NBIc3+nM8u5C gErQ== 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=v0IZFKKEftaKmY/8Iz31EftkwA6oAa/GGLiLCwgd7dE=; b=aANgoNoPBi29wMgohGevSImKmvlhUnjaocllnv+F05/9wSHK+CboeuiRYXiP1Ont50 I1ZSkrSxx2eV5I3r/cndv3mzX9Dp756uAzaCyv6QJwr7Rn4t4nylayZe98MBRcDpTh/S oTt2kQpfOPb00yE+5Ot+hwSlhhqTNVFzNB9lx/GzhfaEUWb0Sculbtvy/Y3KHjcXFRDb UAGL0PC5rGnP2QI2X23JZkcnN9l0RW3rCGyJKUSoIzxUugYz5YKRrcyhgS9d360JmPWb 0jtPDZcwzYFmxuYwQxfe9J+qtEmN7n203oZWHieFYKC2Xt9MmsDqp2TszpLpMCOYLQAQ FTEg== X-Gm-Message-State: APjAAAXAJGg7MQ5efEpbQewoXVNA375V8ZMly0u2kteTjefBaa2iMNEg 923nQSFt2XAXBiSOpIQuzmVDG7/Fe+s= X-Google-Smtp-Source: APXvYqy7cA7OKvaIAOUPotKzOYD/Ih/YtCkOzAbi6/Du2TXWHD0eyo6cecNKEi2DVTKpHqt0pWHCKg== X-Received: by 2002:adf:9301:: with SMTP id 1mr49070879wro.231.1558393352222; Mon, 20 May 2019 16:02:32 -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 z14sm13858538wrq.22.2019.05.20.16.02.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 16:02:31 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 May 2019 00:02:17 +0100 Message-Id: <20190520230224.19221-4-sw@jkqxz.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520230224.19221-1-sw@jkqxz.net> References: <20190520230224.19221-1-sw@jkqxz.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 04/11] 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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index 06a8f9b979..439fa7934b 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -140,6 +140,27 @@ 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) { \ + .unit_type = type, \ + .content_type = CBS_CONTENT_TYPE_POD, \ + .content_size = sizeof(structure), \ + } +#define CBS_UNIT_TYPE_INTERNAL_REFS(type, structure, nb_offsets, offsets) { \ + .unit_type = type, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .nb_ref_offsets = nb_offsets, \ + .ref_offsets = offsets, \ + } +#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) { \ + .unit_type = type, \ + .content_type = CBS_CONTENT_TYPE_COMPLEX, \ + .content_size = sizeof(structure), \ + .content_free = free_func, \ + } +#define CBS_UNIT_TYPE_END_OF_LIST { CBS_INVALID_UNIT_TYPE } + + extern const CodedBitstreamType ff_cbs_type_av1; extern const CodedBitstreamType ff_cbs_type_h264; extern const CodedBitstreamType ff_cbs_type_h265;