edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! benchp1: PGS (.sup) decode throughput for lanes/bench.md ("lane benchp1"). |
| 2 | //! |
| 3 | //! usage: |
| 4 | //! benchp1 gen <out.sup> <seconds> write a synthetic .sup: every second one display set |
| 5 | //! shows a 64x32 object, 0.8 s later a clear set follows |
| 6 | //! (2 display sets per second, 90 kHz pts). |
| 7 | //! benchp1 decode <file.sup> [reps] decode the whole file `reps` times (default 5) with a |
| 8 | //! fresh decoder each time; print the best time, MB/s, the |
| 9 | //! rendered frame count and the stream duration from the pts. |
| 10 | //! |
| 11 | //! The generator uses the same segment layout as the crate's tests (`tests/fuzz_regressions.rs`). |
| 12 | //! ffmpeg has no PGS encoder, so this is the input source for the row. |
| 13 | use black_box; |
| 14 | use Instant; |
| 15 | |
| 16 | use ; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | /// A 1920x1080 epoch-start composition with `objects` placed objects (0 or 1). |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | /// Palette entry 1 opaque white. |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | /// One 64x32 object, RLE: each row is 64 pixels of colour 1 then an end-of-line code. |
| 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 | /// (segment count, the last segment's pts in seconds), walking the segment headers. |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | /// One full decode with a fresh decoder: (rendered frames, push errors). The file is fed one |
| 93 | /// segment at a time and the finished frames are dropped after each push, as a streaming reader |
| 94 | /// would. A full 1920x1080 canvas is about 8 MB, so draining per segment keeps the decoder's |
| 95 | /// output queue at most one frame deep. |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 |