summaryrefslogtreecommitdiff
path: root/libavcodec/rl.c
Commit message (Collapse)AuthorAge
* avcodec/vlc: Use structure instead of VLC_TYPE array as VLC elementAndreas Rheinhardt2022-06-17
| | | | | | | | | | | | | | | | | | In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rl: Don't pretend ff_rl_init() initializes a RLTable twiceAndreas Rheinhardt2022-01-09
| | | | | | | | | | | | It can't any longer, because all users of ff_rl_init() are now behind ff_thread_once() or the global codec lock. Therefore the check for whether the RLTable is already initialized can be removed; as can the stack buffers that existed to make sure that nothing is ever set to a value different from its final value. Similarly, it is not necessary to check whether the VLCs associated with the RLTable are already initialized (they aren't). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary mem.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/rl: Allow to create only a few VLC tablesAndreas Rheinhardt2021-01-25
| | | | | | | It is not uncommon that only the first one is used; this is similar to ff_init_2d_vlc_rl(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/rl: Remove nonstatic storage of RL tablesAndreas Rheinhardt2020-12-31
| | | | | | | | ff_rl_free() was added in 324e50ee95929a9491b855c5e15451145bd5d1ec, but never used; nonstatic storage was not used long before that. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: fix previous mergeClément Bœsch2016-06-23
|
* Merge commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c'Clément Bœsch2016-06-23
|\ | | | | | | | | | | | | * commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c': Move VLC and RL_VLC_ELEM structure definitions to a separate header Merged-by: Clément Bœsch <u@pkh.me>
| * Move VLC and RL_VLC_ELEM structure definitions to a separate headerAlexandra Hájková2016-05-17
| | | | | | | | | | | | | | Use the newly created vlc.h directly instead of including get_bits when needed. The VLC and RL_VLC_ELEM structures are independent from the bitreader. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '1b1bb2c4efc126d74d44d8c421860c85f932ecb1'Michael Niedermayer2015-05-28
|\| | | | | | | | | | | | | | | | | | | * commit '1b1bb2c4efc126d74d44d8c421860c85f932ecb1': rl: Add error checking to ff_rl_init(). Conflicts: libavcodec/rl.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rl: Add error checking to ff_rl_init().Anton Khirnov2015-05-28
| |
* | Merge commit '324e50ee95929a9491b855c5e15451145bd5d1ec'Michael Niedermayer2015-05-28
|\| | | | | | | | | | | | | * commit '324e50ee95929a9491b855c5e15451145bd5d1ec': rl: Add a function for freeing dynamically allocated tables. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rl: Add a function for freeing dynamically allocated tables.Anton Khirnov2015-05-28
| | | | | | | | Such tables are not used anywhere currently, but that should change.
* | Merge commit '6f57375d707de40dcec28d3cef886c364e032c21'Michael Niedermayer2015-05-28
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '6f57375d707de40dcec28d3cef886c364e032c21': rl: Rename ff_*_rl() to ff_rl_*() Conflicts: libavcodec/mpeg4videodec.c libavcodec/rl.c libavcodec/rl.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rl: Rename ff_*_rl() to ff_rl_*()Anton Khirnov2015-05-28
| |
* | Merge commit 'fa1923f18205410a3b0aa6c0e77cb31443ef340d'Michael Niedermayer2015-05-28
|/ | | | | | | | | | * commit 'fa1923f18205410a3b0aa6c0e77cb31443ef340d': mpegvideo: Move ff_*_rl functions to a separate file Conflicts: libavcodec/mpegvideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* mpegvideo: Move ff_*_rl functions to a separate fileAnton Khirnov2015-05-28