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 {
125125
126126 /// The worker-thread budget: the machine's available parallelism, capped at [`MAX_THREADS`].
127127 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)
129131 }
130132
131133 /// 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 {
134134 /// Start the decoding of the picture of `job`. `threaded` gives it a worker thread.
135135 pub fn start(job: PicJob, threaded: bool) -> Runner {
136136 if !threaded {
137- return Runner::Inline {
138- job: Box::new(job),
139- };
137+ return Runner::Inline { job: Box::new(job) };
140138 }
141139 let (tx, rx) = mpsc::channel();
142140 let handle = std::thread::spawn(move || run_worker(rx, job));
crates/ec-h265/src/decode.rsmodified+0 -1
@@ -52,7 +52,6 @@ impl DecodedPicture {
5252 (self.width.div_ceil(1 << sx), self.height.div_ceil(1 << sy))
5353 }
5454
55-
5655 /// A picture of mid-grey samples, each plane at its own bit depth.
5756 pub fn grey_planes(
5857 width: usize,
crates/ec-h265/src/encoder.rsmodified+6 -1
@@ -1033,7 +1033,12 @@ impl Encoder {
10331033 (&bcb, w / 2 * bps, w / 2 * bps, h / 2),
10341034 (&bcr, w / 2 * bps, w / 2 * bps, h / 2),
10351035 ]);
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+ );
10371042 }
10381043 au
10391044 }
crates/ec-h265/tests/it/common.rsmodified+5 -1
@@ -194,7 +194,11 @@ pub const PLANE_NAMES: [&str; 3] = ["Y", "Cb", "Cr"];
194194
195195 /// The bit depth of component `c` (0 luma, 1 and 2 chroma).
196196 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+ }
198202 }
199203
200204 /// 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() {
183183 cfg.keyint = 4;
184184 cfg.keep_recon = true;
185185 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");
187188 let mut dec = Decoder::new();
188189 for f in &frames {
189190 let pic = seq.encode(f, false).expect("encode");
@@ -193,6 +194,9 @@ fn end_picture_outputs_each_access_unit_cropped() {
193194 assert_eq!((out.width, out.height), (200, 120));
194195 let recon = pic.recon.expect("recon");
195196 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+ );
197201 }
198202 }