From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/vlc: Add documentation for ff_init_vlc_sparse() Date: Fri, 8 Sep 2023 16:07:24 +0200 Message-ID: <AS8P250MB07449039B5BC356F17BB2E4F8FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB074429EE169A8357C6FC520C8FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> 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> --- 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".
next prev parent reply other threads:[~2023-09-08 14:06 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-08 14:02 [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt 2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 2/7] avcodec/proresdsp: Pass necessary parameter directly Andreas Rheinhardt 2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 3/7] avcodec/idctdsp: Avoid inclusion of avcodec.h Andreas Rheinhardt 2023-09-08 14:07 ` Andreas Rheinhardt [this message] 2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 5/7] tools/patcheck: Remove test for ancient INIT_VLC_USE_STATIC Andreas Rheinhardt 2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 6/7] avcodec/vlc: Use proper namespace Andreas Rheinhardt 2023-09-09 23:40 ` Michael Niedermayer 2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 7/7] avcodec/truemotion2: Don't check before freeing VLC Andreas Rheinhardt 2023-09-08 18:11 ` Paul B Mahol 2023-09-10 8:50 ` [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS8P250MB07449039B5BC356F17BB2E4F8FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git