Lines Matching full:frames
24 static int CalculateMemorySizeInternal(int channels, int frames,
29 ((frames * sizeof(float) + AudioBus::kChannelAlignment - 1) &
43 int frames, AudioBus* dest,
51 for (int i = start_frame, offset = ch; i < start_frame + frames;
64 int frames, void* dst, Fixed min, Fixed max) {
71 for (int i = start_frame, offset = ch; i < start_frame + frames;
86 static void ValidateConfig(int channels, int frames) {
87 CHECK_GT(frames, 0);
92 static void CheckOverflow(int start_frame, int frames, int total_frames) {
94 CHECK_GE(frames, 0);
96 int sum = start_frame + frames;
101 AudioBus::AudioBus(int channels, int frames)
102 : frames_(frames),
107 int size = CalculateMemorySizeInternal(channels, frames, &aligned_frames);
115 AudioBus::AudioBus(int channels, int frames, float* data)
116 : frames_(frames),
123 CalculateMemorySizeInternal(channels, frames, &aligned_frames);
128 AudioBus::AudioBus(int frames, const std::vector<float*>& channel_data)
130 frames_(frames),
151 scoped_ptr<AudioBus> AudioBus::Create(int channels, int frames) {
152 return scoped_ptr<AudioBus>(new AudioBus(channels, frames));
165 int frames, const std::vector<float*>& channel_data) {
166 return scoped_ptr<AudioBus>(new AudioBus(frames, channel_data));
169 scoped_ptr<AudioBus> AudioBus::WrapMemory(int channels, int frames,
174 channels, frames, static_cast<float*>(data)));
195 void AudioBus::set_frames(int frames) {
197 ValidateConfig(static_cast<int>(channel_data_.size()), frames);
198 frames_ = frames;
201 void AudioBus::ZeroFramesPartial(int start_frame, int frames) {
202 CheckOverflow(start_frame, frames, frames_);
204 if (frames <= 0)
209 frames * sizeof(*channel_data_[i]));
213 void AudioBus::ZeroFrames(int frames) {
214 ZeroFramesPartial(0, frames);
226 int AudioBus::CalculateMemorySize(int channels, int frames) {
227 return CalculateMemorySizeInternal(channels, frames, NULL);
241 int frames, int bytes_per_sample) {
242 CheckOverflow(start_frame, frames, frames_);
246 source, start_frame, frames, this,
251 source, start_frame, frames, this,
256 source, start_frame, frames, this,
261 ZeroFramesPartial(start_frame, frames);
265 // Don't clear remaining frames if this is a partial deinterleave.
267 // Zero any remaining frames.
268 ZeroFramesPartial(frames, frames_ - frames);
272 void AudioBus::FromInterleaved(const void* source, int frames,
274 FromInterleavedPartial(source, 0, frames, bytes_per_sample);
277 void AudioBus::ToInterleaved(int frames, int bytes_per_sample,
279 ToInterleavedPartial(0, frames, bytes_per_sample, dest);
283 void AudioBus::ToInterleavedPartial(int start_frame, int frames,
285 CheckOverflow(start_frame, frames, frames_);
289 this, start_frame, frames, dest, kint8min, kint8max);
293 this, start_frame, frames, dest, kint16min, kint16max);
297 this, start_frame, frames, dest, kint32min, kint32max);
301 memset(dest, 0, frames * bytes_per_sample);
307 CopyPartialFramesTo(0, frames(), 0, dest);
315 CHECK_LE(source_start_frame + frame_count, frames());
316 CHECK_LE(dest_start_frame + frame_count, dest->frames());
330 vector_math::FMUL(channel(i), volume, frames(), channel(i));