edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Debug switches the VP9 decoder reads from the environment, with a |
| 2 | //! per-thread override that tests set instead of editing the process |
| 3 | //! environment (which is `unsafe` in Rust 2024). |
| 4 | //! |
| 5 | //! The decoder reads these on the thread that calls `decode`: tile workers |
| 6 | //! and the loop-filter threads never read them. An override set on a test's |
| 7 | //! own thread therefore covers exactly that test's decodes. With no override |
| 8 | //! set, each reader answers from the environment exactly as it always has. |
| 9 | |
| 10 | use Cell; |
| 11 | use LocalKey; |
| 12 | |
| 13 | thread_local! |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | /// Restores the value a knob had before the guard was created, when dropped. |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | /// `EC_VP9_SKIP_LF`: when set, the loop-filter post-pass is skipped. |
| 41 | pub |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | /// `EC_VP9_FORCE_TAIL`: overrides the keyframe tail start offset, if set and |
| 48 | /// parseable. |
| 49 | pub |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | /// Forces `EC_VP9_SKIP_LF` on (`Some(true)`), off (`Some(false)`) or back to |
| 58 | /// the environment (`None`) on this thread, until the guard drops. |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | /// Forces `EC_VP9_FORCE_TAIL` to `tail` on this thread, until the guard drops. |
| 65 | /// `None` returns the knob to the environment. |
| 66 | |
| 67 | |
| 68 | |
| 69 |