From patchwork Wed Jan 27 17:01:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25223 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 1504A44B1C6 for ; Wed, 27 Jan 2021 19:02:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D4D4B68A132; Wed, 27 Jan 2021 19:02:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E4FE680BD0 for ; Wed, 27 Jan 2021 19:01:55 +0200 (EET) Received: by mail-wm1-f42.google.com with SMTP id m2so2142164wmm.1 for ; Wed, 27 Jan 2021 09:01:55 -0800 (PST) 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=hPzLc0vc6ycMjKy+9KmCQZX8n0secjJcwX9o68Uo8s4=; b=PjBeAxJIBwdTLBUVBDLXU9xERaWDqckcTakP//CoceY78Y4FQo4cRdVT1oFA5jfsTB T/apvKXpeGWcGGDV7380vaGGf9W3GiGx9/Sa87KdB0dNPsWzme2dnJSIklnUhyN1zNjF tA0TEJ96t7K0V6UNWdCVzams2JYE6on3oU7zBLbY1vvuwLKr1ugtfcg1FITENRZyDvs9 ESfXr+8mJ/5zt0RPU2DKzhGaV9g6p+Sl4lvzQhPfSyQvLXMwGcIUPeYoaXqDw9JPJgY8 zrKey0mb034s6bhlcr7Ji0XEe/81mTbGNhXT4tz7z+eL/511IzE9OdRW69HL3khi5sHE MSsg== 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=hPzLc0vc6ycMjKy+9KmCQZX8n0secjJcwX9o68Uo8s4=; b=hvtmztB3JkhH2qDntwlPU92NBpDWu0b0Su/+4gwbIInMvwyt1HhunfbQ9f1h/HsVzu lYTC4yYJd11xProDug7AfVtaYYZV5Or8DZdmWq9PlCB22ftpSnkAzTD2lTUthOh9BOie l2/ZyB7hFt1AUeGcVeNagRPtmHYGyn+XoR0NTxWG0AaUU2U+58lGge/YAFkgqS4Xc0SL cMWKK8U+7q+w61ZRgOo1MKTucvXuHIl5siMuj7SlbjftTCxO9s5XxQeJ/+oHACR15Q2m uCEd2Ni0ThJ5Mf5/AQF0G5az2pirAX6wFCizQbCy0FHzyTDkk5PHAtA+HikL6EDEj/jF HRDw== X-Gm-Message-State: AOAM530Th/38TRhNDpNLO99R+H2WFiaI8ZhEQ176octL0cs58S3l54Rv 1AJlTJsKzF7BwZFPbVVsFzFw9D/D8Ro= X-Google-Smtp-Source: ABdhPJzoH6WdfqIjFpqvUqg6BzzWz5XmJBKWqYAM+o7C1bzBm6caR+TObDmZqOfkPrvZgNpw6FmDCQ== X-Received: by 2002:a7b:c8cb:: with SMTP id f11mr4986438wml.157.1611766914824; Wed, 27 Jan 2021 09:01:54 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id f6sm3125731wmq.33.2021.01.27.09.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 09:01:54 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Jan 2021 18:01:47 +0100 Message-Id: <20210127170147.2354748-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <161173869580.13638.9688842568373716709@lain.red.khirnov.net> References: <161173869580.13638.9688842568373716709@lain.red.khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/rl: Improve documentation of ff_rl_init/ff_rl_init_vlc 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" In particular, document that they initialize different parts of an RLTable and therefore need not be synchronized. Signed-off-by: Andreas Rheinhardt --- libavcodec/rl.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libavcodec/rl.h b/libavcodec/rl.h index 26e0b32a90..5aae698e31 100644 --- a/libavcodec/rl.h +++ b/libavcodec/rl.h @@ -49,10 +49,25 @@ typedef struct RLTable { } RLTable; /** + * Initialize index_run, max_level and max_run from n, last, table_vlc, + * table_run and table_level. * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] * to hold the level and run tables. + * @note This function does not touch rl_vlc at all, hence there is no need + * to synchronize calls to ff_rl_init() and ff_rl_init_vlc() using the + * same RLTable. */ void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); + +/** + * Initialize rl_vlc from n, last, table_vlc, table_run and table_level. + * All rl_vlc pointers to be initialized must already point to a static + * buffer of `static_size` RL_VLC_ELEM elements; if a pointer is NULL, + * initializing further VLCs stops. + * @note This function does not touch what ff_rl_init() initializes at all, + * hence there is no need to synchronize calls to ff_rl_init() and + * ff_rl_init_vlc() using the same RLTable. + */ void ff_rl_init_vlc(RLTable *rl, unsigned static_size); #define INIT_VLC_RL(rl, static_size)\