aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vlc.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-08 14:10:10 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-11 00:26:34 +0200
commit7b98a1875d9d0229d647dcabd0bba5f97b6c4975 (patch)
treef8dae3497796144e8682f1fe51c6f5fbc056db18 /libavcodec/vlc.h
parenta84fe06112af4929a4f3d993373b4f3cf2725f9a (diff)
downloadffmpeg-7b98a1875d9d0229d647dcabd0bba5f97b6c4975.tar.gz
avcodec/vlc: Add documentation for ff_init_vlc_sparse()
Mostly taken from the documentation for ff_init_vlc_from_lengths(); also remove the documentation in vlc.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vlc.h')
-rw-r--r--libavcodec/vlc.h29
1 files changed, 29 insertions, 0 deletions
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,