edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! The two codec configurations whose channel count and output rate a sample |
| 2 | //! entry does not carry honestly: an AAC `AudioSpecificConfig` (ISO/IEC |
| 3 | //! 14496-3 §1.6.2.1) and an AC-3 `dac3` box (ETSI TS 102 366 annex F). |
| 4 | //! |
| 5 | //! The entry's own `channelcount` is fixed at 2 by the spec whatever the stream |
| 6 | //! carries, and its rate is the core's for HE-AAC. Edith reads both from these |
| 7 | //! bytes, and so does ffprobe, so the demuxer does too. |
| 8 | |
| 9 | /// `samplingFrequencyIndex` to Hz, ISO/IEC 14496-3 table 1.18. |
| 10 | const FREQUENCIES: = |
| 11 | |
| 12 | |
| 13 | ; |
| 14 | |
| 15 | /// A most-significant-bit-first reader. `None` once it runs out, which is a |
| 16 | /// truncated configuration and not a panic. |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | /// The output sample rate and channel count an AAC `AudioSpecificConfig` states. |
| 35 | /// |
| 36 | /// For HE-AAC (SBR, object type 5) and HE-AAC v2 (PS, 29) the explicit extension |
| 37 | /// rate is the output rate, the core's being half of it; a PS stream is stereo |
| 38 | /// whatever its mono core says. `None` where the config names no layout |
| 39 | /// (`channelConfiguration` 0 or 8..=15, a program config element or a reserved |
| 40 | /// value) or is truncated: the caller keeps the sample entry's answer then. |
| 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 | /// The channel count an AC-3 `dac3` box states: the audio coding mode's full |
| 74 | /// channels, plus the LFE channel when `lfeon` is set (ETSI TS 102 366 table |
| 75 | /// 4.5). `None` for a box too short to hold its three bytes. |
| 76 | pub |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | /// The sampling frequency and channel count a `ddts` box states (ETSI TS 102 114 |
| 94 | /// annex E): the 32-bit frequency first, and the speaker-activity mask of the |
| 95 | /// `ChannelLayout` field, each set bit standing for one speaker or a pair. |
| 96 | /// `None` for a box too short to hold the mask or one that names no speaker. |
| 97 | pub |
| 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 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 |