- for (dst, src) in self.data.chunks_exact_mut(self.stride).zip(src.get_data().chunks_exact(src.get_stride())) {
- dst[self.end..][..to_copy].copy_from_slice(&src[..to_copy]);
- }
+ match (src.get_step() != 1, self.ileaved) {
+ (false, false) => {
+ for (dst, src) in self.data.chunks_exact_mut(self.stride).zip(src.get_data().chunks_exact(src.get_stride())) {
+ dst[self.end..][..to_copy].copy_from_slice(&src[..to_copy]);
+ }
+ },
+ (true, false) => {
+ for (i, chunk) in src.get_data().chunks_exact(src.get_step()).enumerate() {
+ for (ch, &samp) in chunk.iter().enumerate() {
+ self.data[self.stride * ch + self.end + i] = samp;
+ }
+ }
+ }
+ (true, true) => {
+ let sdata = src.get_data();
+ self.data[self.end..][..to_copy].copy_from_slice(&sdata[..to_copy]);
+ },
+ _ => unimplemented!(),
+ };