U7: rustfmt the files touched by the dead-code removal (formatting only)
Browse files at this commit02aa508f5e8d3b4fce119b59602b34b2b91e3952Parent: 70365836 changed files +21 -9
- crates/ec-h265/src/dec/mod.rs +3 -1
- crates/ec-h265/src/dec/runner.rs +1 -3
- crates/ec-h265/src/decode.rs +0 -1
- crates/ec-h265/src/encoder.rs +6 -1
- crates/ec-h265/tests/it/common.rs +5 -1
- crates/ec-h265/tests/it/encode_threads.rs +6 -2
crates/ec-h265/src/dec/mod.rsmodified+3 -1
| @@ -125,7 +125,9 @@ fn picture_limit(threads: usize) -> usize { | ||
| 125 | 125 | |
| 126 | 126 | /// The worker-thread budget: the machine's available parallelism, capped at [`MAX_THREADS`]. |
| 127 | 127 | pub fn configured_threads() -> usize { |
| 128 | - std::thread::available_parallelism().map_or(1, |n| n.get()).min(MAX_THREADS) | |
| 128 | + std::thread::available_parallelism() | |
| 129 | + .map_or(1, |n| n.get()) | |
| 130 | + .min(MAX_THREADS) | |
| 129 | 131 | } |
| 130 | 132 | |
| 131 | 133 | /// Streaming HEVC decoder with the same surface as the H.264 one: feed NAL |
crates/ec-h265/src/dec/runner.rsmodified+1 -3
| @@ -134,9 +134,7 @@ impl Runner { | ||
| 134 | 134 | /// Start the decoding of the picture of `job`. `threaded` gives it a worker thread. |
| 135 | 135 | pub fn start(job: PicJob, threaded: bool) -> Runner { |
| 136 | 136 | if !threaded { |
| 137 | - return Runner::Inline { | |
| 138 | - job: Box::new(job), | |
| 139 | - }; | |
| 137 | + return Runner::Inline { job: Box::new(job) }; | |
| 140 | 138 | } |
| 141 | 139 | let (tx, rx) = mpsc::channel(); |
| 142 | 140 | let handle = std::thread::spawn(move || run_worker(rx, job)); |
crates/ec-h265/src/decode.rsmodified+0 -1
| @@ -52,7 +52,6 @@ impl DecodedPicture { | ||
| 52 | 52 | (self.width.div_ceil(1 << sx), self.height.div_ceil(1 << sy)) |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - | |
| 56 | 55 | /// A picture of mid-grey samples, each plane at its own bit depth. |
| 57 | 56 | pub fn grey_planes( |
| 58 | 57 | width: usize, |
crates/ec-h265/src/encoder.rsmodified+6 -1
| @@ -1033,7 +1033,12 @@ impl Encoder { | ||
| 1033 | 1033 | (&bcb, w / 2 * bps, w / 2 * bps, h / 2), |
| 1034 | 1034 | (&bcr, w / 2 * bps, w / 2 * bps, h / 2), |
| 1035 | 1035 | ]); |
| 1036 | - write_annex_b(&mut au, NalHeader::new(NalUnitType::SuffixSei), &rbsp, false); | |
| 1036 | + write_annex_b( | |
| 1037 | + &mut au, | |
| 1038 | + NalHeader::new(NalUnitType::SuffixSei), | |
| 1039 | + &rbsp, | |
| 1040 | + false, | |
| 1041 | + ); | |
| 1037 | 1042 | } |
| 1038 | 1043 | au |
| 1039 | 1044 | } |
crates/ec-h265/tests/it/common.rsmodified+5 -1
| @@ -194,7 +194,11 @@ pub const PLANE_NAMES: [&str; 3] = ["Y", "Cb", "Cr"]; | ||
| 194 | 194 | |
| 195 | 195 | /// The bit depth of component `c` (0 luma, 1 and 2 chroma). |
| 196 | 196 | pub fn bit_depth_of(pic: &DecodedPicture, c: usize) -> u32 { |
| 197 | - if c == 0 { pic.bit_depth } else { pic.bit_depth_c } | |
| 197 | + if c == 0 { | |
| 198 | + pic.bit_depth | |
| 199 | + } else { | |
| 200 | + pic.bit_depth_c | |
| 201 | + } | |
| 198 | 202 | } |
| 199 | 203 | |
| 200 | 204 | /// Bytes per sample of component `c`: 1 for 8-bit, 2 (little endian) above 8 bits. |
crates/ec-h265/tests/it/encode_threads.rsmodified+6 -2
| @@ -183,7 +183,8 @@ fn end_picture_outputs_each_access_unit_cropped() { | ||
| 183 | 183 | cfg.keyint = 4; |
| 184 | 184 | cfg.keep_recon = true; |
| 185 | 185 | cfg.threads = 1; |
| 186 | - let mut seq = ec_h265::SequenceEncoder::new(Encoder::new(cfg).expect("encoder")).expect("sequence"); | |
| 186 | + let mut seq = | |
| 187 | + ec_h265::SequenceEncoder::new(Encoder::new(cfg).expect("encoder")).expect("sequence"); | |
| 187 | 188 | let mut dec = Decoder::new(); |
| 188 | 189 | for f in &frames { |
| 189 | 190 | let pic = seq.encode(f, false).expect("encode"); |
| @@ -193,6 +194,9 @@ fn end_picture_outputs_each_access_unit_cropped() { | ||
| 193 | 194 | assert_eq!((out.width, out.height), (200, 120)); |
| 194 | 195 | let recon = pic.recon.expect("recon"); |
| 195 | 196 | let y: Vec<u8> = out.y.iter().map(|&v| v as u8).collect(); |
| 196 | - assert!(*y == *recon.planes[0].data, "cropped luma differs from the reconstruction"); | |
| 197 | + assert!( | |
| 198 | + *y == *recon.planes[0].data, | |
| 199 | + "cropped luma differs from the reconstruction" | |
| 200 | + ); | |
| 197 | 201 | } |
| 198 | 202 | } |