Make ChannelBuffer aware of frequency bands
Now the ChannelBuffer has 2 separate arrays, one for the full-band data and one for the splitted one. The corresponding accessors are added to the ChannelBuffer. This is done to avoid having to refresh the bands pointers in AudioBuffer. It will also allow us to have a general accessor like data()[band][channel][sample]. All the files using the ChannelBuffer needed to be re-factored. Tested with modules_unittests, common_audio_unittests, audioproc, audioproc_f, voe_cmd_test. R=andrew@webrtc.org, kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/36999004 Cr-Commit-Position: refs/heads/master@{#8318} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8318 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -51,7 +51,7 @@ size_t PcmReadToFloat(FILE* file,
|
||||
PcmRead(file, length, num_channels, deinterleaved_buffer->channels());
|
||||
|
||||
for (int i = 0; i < num_channels; ++i) {
|
||||
S16ToFloat(deinterleaved_buffer->channel(i), num_frames, buffer[i]);
|
||||
S16ToFloat(deinterleaved_buffer->channels()[i], num_frames, buffer[i]);
|
||||
}
|
||||
return elements_read;
|
||||
}
|
||||
@ -82,7 +82,7 @@ void PcmWriteFromFloat(FILE* file,
|
||||
new ChannelBuffer<int16_t>(num_frames, num_channels));
|
||||
|
||||
for (int i = 0; i < num_channels; ++i) {
|
||||
FloatToS16(buffer[i], num_frames, deinterleaved_buffer->channel(i));
|
||||
FloatToS16(buffer[i], num_frames, deinterleaved_buffer->channels()[i]);
|
||||
}
|
||||
PcmWrite(file, length, num_channels, deinterleaved_buffer->channels());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user