edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB6828b15Tahinli3 months ago393 commits
| 1 | //! Drop-in replacement for the `flacenc` 0.5.1 surface the replica consumes, |
| 2 | //! implemented over [`ec_flac`]. |
| 3 | //! |
| 4 | //! It carries the incumbent's package name and version so the swap is a |
| 5 | //! `[patch.crates-io]` entry and nothing else. The scope is exactly the API |
| 6 | //! `engine/src/export.rs` calls (`export.rs:67-68,2930-2954`): |
| 7 | //! |
| 8 | //! ```no_run |
| 9 | //! use flacenc::component::BitRepr; |
| 10 | //! use flacenc::error::Verify; |
| 11 | //! |
| 12 | //! let config = flacenc::config::Encoder::default().into_verified().unwrap(); |
| 13 | //! let source = flacenc::source::MemSource::from_samples(&[0i32; 32], 2, 16, 44100); |
| 14 | //! let mut stream = |
| 15 | //! flacenc::encode_with_fixed_block_size(&config, source, config.block_size).unwrap(); |
| 16 | //! stream |
| 17 | //! .stream_info_mut() |
| 18 | //! .set_block_sizes(config.block_size, config.block_size) |
| 19 | //! .unwrap(); |
| 20 | //! let mut sink = flacenc::bitsink::ByteSink::new(); |
| 21 | //! stream.write(&mut sink).unwrap(); |
| 22 | //! let _bytes: &[u8] = sink.as_slice(); |
| 23 | //! ``` |
| 24 | //! |
| 25 | //! Signatures match the incumbent's (types, argument order, error shapes) so |
| 26 | //! call sites compile unchanged; the implementation behind them is ours. |
| 27 | //! Deliberately *not* covered: the `par` feature knobs, `serde` config |
| 28 | //! round-tripping and the component tree (`Frame`/`SubFrame`/`Residual` as |
| 29 | //! addressable values) — the replica constructs none of them. |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | pub use Stream; |
| 41 | pub use EncodeError; |
| 42 | |
| 43 | use Verified; |
| 44 | use Source; |
| 45 | |
| 46 | /// Encode `src` into a stream of fixed-size blocks. |
| 47 | /// |
| 48 | /// Mirrors `flacenc::encode_with_fixed_block_size`: the verified config, a |
| 49 | /// source, and the block size (which the caller reads off the config). |
| 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 | |
| 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 |