edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | use crate; |
| 2 | |
| 3 | pub const RATE_WINDOW_MS: u32 = 1000; |
| 4 | |
| 5 | /// The HRD buffer for a GOP of `gop_size` pictures, in milliseconds of the |
| 6 | /// requested bitrate. |
| 7 | /// |
| 8 | /// The buffer is what radeonsi's constant-bitrate loop works against, and it |
| 9 | /// must be short when pictures are mostly key frames. Measured at 720p, |
| 10 | /// testsrc2, 240 pictures, HEVC, requested 1, 3 and 8 Mb/s: |
| 11 | /// |
| 12 | /// | GOP | buffer | delivered (3 Mb/s request) | |
| 13 | /// |---|---|---| |
| 14 | /// | 1 | 1000 ms | 7.63 Mb/s (+154%) | |
| 15 | /// | 1 | 33 ms | 3.29 Mb/s (+9.5%) | |
| 16 | /// | 1 | 20 ms | 3.02 Mb/s (+0.7%) | |
| 17 | /// | 2 | 1000 ms | +9.4% | |
| 18 | /// | 5 | 1000 ms | +4.3% | |
| 19 | /// | 10 | 1000 ms | +1.8% | |
| 20 | /// | 30 | 1000 ms | +1.0%, 43.5 dB | |
| 21 | /// | 30 | 20 ms | +0.0%, 40.1 dB | |
| 22 | /// |
| 23 | /// So a GOP shorter than ten pictures gets a 20 ms buffer. A GOP of thirty keeps |
| 24 | /// the full rate window: the short buffer lands on the request there too, but |
| 25 | /// costs 3.4 dB at the same rate. |
| 26 | pub |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | /// Closed-loop correction of the driver's rate control, which lands off the ask |
| 35 | /// on detailed content (testsrc2: +12..19% on mesa 26.2.6, ffmpeg's VA-API |
| 36 | /// encoders too): once a second the bitrate sent is rescaled by the measured |
| 37 | /// bias, plus whatever was over- or under-spent so far. Variable bitrate is only |
| 38 | /// ever steered down: spending less on easy content is what it is for, and |
| 39 | /// steering that credit back up raised its peak past `max_bitrate`. |
| 40 | |
| 41 | pub |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 |