forge
Explore
Log in

Don't you dare go Hollow

U7: rustfmt the files touched by the dead-code removal (formatting only)

Browse files at this commit

02aa508f5e8d3b4fce119b59602b34b2b91e3952Ahmet Kaan GümüşParent: 7036583
crates/ec-h265/src/dec/mod.rsmodified+3 -1
@@ -125,7 +125,9 @@ fn picture_limit(threads: usize) -> usize {
125 125
126 /// The worker-thread budget: the machine's available parallelism, capped at [`MAX_THREADS`].126 /// The worker-thread budget: the machine's available parallelism, capped at [`MAX_THREADS`].
127 pub fn configured_threads() -> usize {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 /// Streaming HEVC decoder with the same surface as the H.264 one: feed NAL133 /// 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 /// Start the decoding of the picture of `job`. `threaded` gives it a worker thread.134 /// Start the decoding of the picture of `job`. `threaded` gives it a worker thread.
135 pub fn start(job: PicJob, threaded: bool) -> Runner {135 pub fn start(job: PicJob, threaded: bool) -> Runner {
136 if !threaded {136 if !threaded {
137- return Runner::Inline {137+ return Runner::Inline { job: Box::new(job) };
138- job: Box::new(job),
139- };
140 }138 }
141 let (tx, rx) = mpsc::channel();139 let (tx, rx) = mpsc::channel();
142 let handle = std::thread::spawn(move || run_worker(rx, job));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 (self.width.div_ceil(1 << sx), self.height.div_ceil(1 << sy))52 (self.width.div_ceil(1 << sx), self.height.div_ceil(1 << sy))
53 }53 }
54 54
55-
56 /// A picture of mid-grey samples, each plane at its own bit depth.55 /// A picture of mid-grey samples, each plane at its own bit depth.
57 pub fn grey_planes(56 pub fn grey_planes(
58 width: usize,57 width: usize,
crates/ec-h265/src/encoder.rsmodified+6 -1
@@ -1033,7 +1033,12 @@ impl Encoder {
1033 (&bcb, w / 2 * bps, w / 2 * bps, h / 2),1033 (&bcb, w / 2 * bps, w / 2 * bps, h / 2),
1034 (&bcr, w / 2 * bps, w / 2 * bps, h / 2),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 au1043 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 /// The bit depth of component `c` (0 luma, 1 and 2 chroma).195 /// The bit depth of component `c` (0 luma, 1 and 2 chroma).
196 pub fn bit_depth_of(pic: &DecodedPicture, c: usize) -> u32 {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 /// Bytes per sample of component `c`: 1 for 8-bit, 2 (little endian) above 8 bits.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 cfg.keyint = 4;183 cfg.keyint = 4;
184 cfg.keep_recon = true;184 cfg.keep_recon = true;
185 cfg.threads = 1;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 let mut dec = Decoder::new();188 let mut dec = Decoder::new();
188 for f in &frames {189 for f in &frames {
189 let pic = seq.encode(f, false).expect("encode");190 let pic = seq.encode(f, false).expect("encode");
@@ -193,6 +194,9 @@ fn end_picture_outputs_each_access_unit_cropped() {
193 assert_eq!((out.width, out.height), (200, 120));194 assert_eq!((out.width, out.height), (200, 120));
194 let recon = pic.recon.expect("recon");195 let recon = pic.recon.expect("recon");
195 let y: Vec<u8> = out.y.iter().map(|&v| v as u8).collect();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 }