From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8FA5D474B2 for ; Fri, 8 Sep 2023 14:06:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D55868C882; Fri, 8 Sep 2023 17:06:36 +0300 (EEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2081.outbound.protection.outlook.com [40.92.90.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA6FB68C861 for ; Fri, 8 Sep 2023 17:06:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IUiIS11jUxL5+6tahdYekbMA5vnLXrw9UJzAKisVoJ3kbO7H4ER3CvLXUveBVf1k1S5Qb+cnq7H1J0t3mA1R3zup7MeG6EzUKDaLoOuIUziHHnwGwIkKeaMUaSd8tW5wz3rYGUuHHIDeHbQf31txvr4RwWwXSoAr8pa35KcyI5rukV32xiwDMLLVaHF2DuOd3Z/aD760hHyANPnzsuV6at3w3sy7wKlApbYisklML900uIo2DhcFkHcuv5upx8EGMPFp2+fiLMf+dWW0hcNFKvXgS56r5foqAZwsCxtxz3MQLDJh6lZugFFW+yxVR3kiCjtlUl0kjbOtmkvWboBSKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MzvsrGK2cSnAPeM3dqGkVsM3sNWwCaYTE10eg0CtzbM=; b=CPW8cotEiVhkAM8KuccpFPbBkUtai8fzXHH46n4NCU4PkLPk1FI5z4QGtQLj0FA5NnZIwP0mHc/ZyeEH55a/q5g33uhCL0ezwMFbn26LVSjo4QhDH31xV4cF2Y7ikAJ2c5zY9zcejhvHskiEsSZQaNGuskTT7LqGa1yWABlGtBJWTG7Ja8vCuR/I4MociR56C3uMYSXoy5Ln5CSgCJ3jLBlxjuqXtU1nObULXRG+bY0lcV7VRQ9l5pwt7lssNXuZf9uV2+4I2R/obocdU2UeoacinHM2lX/a31DpfkZgksUFoVhwJDddHKewHFliugnDuIFVpy+eegFhx0WmqoI4/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MzvsrGK2cSnAPeM3dqGkVsM3sNWwCaYTE10eg0CtzbM=; b=Ph81chRlQs69gUGEc4UDtAScpN+Zt2Ke3S9pzRua8e/2qLM1V5c2kl8+/wHrmyNorjOJM6K8ZQ7KBkNvx5+fvfHzx3XQqLr7/WoZVLXaP/Pck9Q61zHRoQIxgdFRKLAGJ6t403AsR2JPLLmLpiBCHmZaQbqaxUaYbsVA/zy6lltO7QifQZT3tANdwfG8ErqxlVZEuph61Ddy+B/waq3cShLAs94NgLS4h8pVMzhxTViFm46+eOoRQuyOVKKM6TDgY1Yu4VLpWBKCoG50Q+4Uvz3oQqIXFaHllka03kd4dTRaKvShmLS8J1YnUwyZ8Gyytivwf1mwmsg7UmI9Vwf6BQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0206.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:277::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Fri, 8 Sep 2023 14:06:24 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6768.029; Fri, 8 Sep 2023 14:06:24 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Sep 2023 16:07:24 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [h4WTptbPgz/fczN6Rok5UH4ITi7M9mmd] X-ClientProxiedBy: ZR2P278CA0069.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:52::15) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230908140727.2150730-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0206:EE_ X-MS-Office365-Filtering-Correlation-Id: fd908d7c-38f9-40fb-4b0f-08dbb074c952 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hzAQZGVW2IsEwU3nwd54rzUCVLZinGhFmHObDw9LDxZdBBtQcoo+2qJUVcJ6VgggU+G8lL1R5ZqDGrKkIQwexFLWq15FChrA+lbkXrBYl0Rh3d7ke586aLLMDn0omXokQaT7L3JQnvZw258mEnNnJIGPxgkrwR2w3eRDh4awvQPt47TlWiZzCliPrLPuHSwvF/SgtkU/j0/LJXIEFTXi3yQFW7f3UQU77ZDN68xddqPuoi/dXp+mN92x1BXvHKwq1SjgiQ4+CvTNjQ/hvcxKD1NcL56sob0WD44nAVG6koA3i9aWeWuTTipLMBQQEcHv6cth8mAuxj4KJAShJ6VIY2Qsx1xcD/iFujkos7iRys78OuEi7QxnYeqBOdvRTSXwDe8fcfuTOCnWaLzjfgNbq6JS2H6/FxWN28CZ4lWT39HseNstP1UUUVsMw3C8e7YE9qpYEO/Ygqxgn3gAZz3wPHkTStBDEuE2WffGWIUcLXJ3P2oQOUV8LizscnVAUV7K5DNxFcZbMxPhqv7HwdCGNZuB7qDx8WrzKTf+NxXcT8M9XHeq15ofnRAJASXOaboO3qBjKKJwUMnHw7S4TlP7BZ67GiH+MbrwyQztHGu8s7CFw9P4csD6qL6ksWdtbYLg X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+c9A8aVeW23oak1P+hL+wkp+3Qrji9MiJSioqhQpMMMrVzC+K5Y6WrYBt5bD?= =?us-ascii?Q?UI6tnFkmkYV2L1gp08l8l6IK9UiNmj9EyGL6McQFGIGuVXnSxSiKdtXQBeWa?= =?us-ascii?Q?i1t1lShfALNp+veBddVsX3h8+pNwDNodjpYP02tlfTaD1eExHL/Wr2aWNxt+?= =?us-ascii?Q?k5O43Bn+ZSWuqyVHrkWecwELDAjCNyYj1ohXaxUUIyhZbn84YPrZWj0fUx4h?= =?us-ascii?Q?bVor5q12oRgpxZbcnY9vMhP8V5OepmAOZBMcKrtG8mGPZ3ayiUC80DHnXE0f?= =?us-ascii?Q?HQmBs4rSKJSZmp2lW9/XNLt+dLg33o82lBMkwpBBpvNTdgrOqUr5cVw+g1xJ?= =?us-ascii?Q?CDlPh4xOC+ySATAjMtY+TptInjr8M3Q8OyMi45BtSshpSw9LzGESNTRWYiEG?= =?us-ascii?Q?IpnD3Vf1O9J1UMIW0olte960OtevnU25glQhedy+20BFDuuo0StP4oHNLu6P?= =?us-ascii?Q?UCoK9qqo/aLYTIQ478QwSDLRDd2ottlQgsmX6Uwo5HoZLC3M3um1IZbEqRLY?= =?us-ascii?Q?43eP2GEA4cJYcFY8f43xtPm7GINTJTLVqxB0/ZEyzFl6d2kT80YF1xOFJyOx?= =?us-ascii?Q?gwzWbtTyPigbkh8QJAxTGqFb2d9sE2eOBy4lzFR00amHiGgyPERpNdL/IPo/?= =?us-ascii?Q?kGzUs7qfVZCiD87l8cbbKATOvgwi+coQMTa0GVj/plRpLEDSk1I0osiGeD4I?= =?us-ascii?Q?isXnEaFFA4HeY+bKlyUMN9f6gaCu7kQrP+VNApydNUKMvkWNSbkl31e+5TsR?= =?us-ascii?Q?ellpHRNo7PkiForPHsHL4YPwRKhjZKeBXVZZk2hJe0EBeG9AUgTHN9V+S23x?= =?us-ascii?Q?17B3GsvnwSpqLg9qrJJCi7gtGlI7J5kgeqU8q0Undt5SJhrlsNcUmzrZrxg8?= =?us-ascii?Q?eAuwPJ7jjiejUwQIMQKkqXhuoqwGmPXIvJB4X4NOhdkFjw/+tlLgk/GLIoJ2?= =?us-ascii?Q?Mh4jh0EURE7W2vUQIq3inJhm2kHJ/ei9UCCpCR3Ff3XgfE39IgzgfiCtPWgp?= =?us-ascii?Q?P1gDyxIwGnwssP8DQnSGkJfTC3BS1UvRZZj14njQMIkgvvCquL0ML0DkpHpp?= =?us-ascii?Q?OZQT90iVNZ8E9aLqP0j8Ce7bdYTSZ3nA37IjnxEt5foi3R0ab1a7tM6eKgtt?= =?us-ascii?Q?4LLueT6MSg5kIxIetkusI9zj3KygzRG1uEhMMxGHWu7TyfZdZhJ4Khk3472o?= =?us-ascii?Q?1ItQ+4PgfCvHBLx9Wejk8MNkt7YymahZG9sfxohpUTtCGaF6MKPRl0AX2ZBU?= =?us-ascii?Q?ThHKD104u1t+Ws+9dpxG?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd908d7c-38f9-40fb-4b0f-08dbb074c952 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2023 14:06:24.5659 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0206 Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/vlc: Add documentation for ff_init_vlc_sparse() 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: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Mostly taken from the documentation for ff_init_vlc_from_lengths(); also remove the documentation in vlc.c. Signed-off-by: Andreas Rheinhardt --- libavcodec/vlc.c | 23 ----------------------- libavcodec/vlc.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c index 9656a9472c..1740b2f80f 100644 --- a/libavcodec/vlc.c +++ b/libavcodec/vlc.c @@ -247,29 +247,6 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, return 0; } -/* Build VLC decoding tables suitable for use with get_vlc(). - - 'nb_bits' sets the decoding table size (2^nb_bits) entries. The - bigger it is, the faster is the decoding. But it should not be too - big to save memory and L1 cache. '9' is a good compromise. - - 'nb_codes' : number of vlcs codes - - 'bits' : table which gives the size (in bits) of each vlc code. - - 'codes' : table which gives the bit pattern of of each vlc code. - - 'symbols' : table which gives the values to be returned from get_vlc(). - - 'xxx_wrap' : give the number of bytes between each entry of the - 'bits' or 'codes' tables. - - 'xxx_size' : gives the number of bytes of each entry of the 'bits' - or 'codes' tables. Currently 1,2 and 4 are supported. - - 'wrap' and 'size' make it possible to use any memory configuration and types - (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables. -*/ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h index 46063862f6..8f2f478f9b 100644 --- a/libavcodec/vlc.h +++ b/libavcodec/vlc.h @@ -62,6 +62,35 @@ typedef struct RL_VLC_ELEM { codes, codes_wrap, codes_size, \ NULL, 0, 0, flags) +/** + * Build VLC decoding tables suitable for use with get_vlc2(). + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * Corresponds to the `bits` parameter of get_vlc2(). + * @param[in] nb_codes The number of provided bits, codes and (if supplied) + * symbol entries. + * @param[in] bits The lengths (in bits) of the codes. Entries > 0 + * correspond to valid codes; entries == 0 will be skipped. + * @param[in] bits_wrap Stride (in bytes) of the bits table. + * @param[in] codes_size Size of the bits. 1, 2 and 4 are supported. + * @param[in] codes Table which gives the bit pattern of of each vlc code. + * @param[in] codes_wrap Stride (in bytes) of the codes table. + * @param[in] codes_size Size of the codes. 1, 2 and 4 are supported. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols table. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] flags A combination of the INIT_VLC_* flags. + * + * 'wrap' and 'size' make it possible to use any memory configuration and types + * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables. + */ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".