41 for (p = 0; p < a->
planes; p++) {
43 while ((intptr_t)a->
data[p] % cur_align)
45 if (cur_align < min_align)
46 min_align = cur_align;
75 int read_only,
const char *
name)
79 memset(a, 0,
sizeof(*a));
96 for (p = 0; p < (a->
is_planar ? channels : 1); p++) {
110 a->
name = name ? name :
"{no name}";
146 a->
name = name ? name :
"{no name}";
148 if (nb_samples > 0) {
163 int ret, new_buf_size, plane_size, p;
176 if (new_buf_size < 0)
190 for (p = 0; p < a->
planes; p++)
194 memcpy(a->
data, new_data,
sizeof(new_data));
251 for (p = 0; p < src->
planes; p++) {
258 for (p = 0; p < src->
planes; p++) {
268 for (p = 0; p < src->
planes; p++)
278 int src_offset,
int nb_samples)
280 int ret, p, dst_offset2, dst_move_size;
289 if (dst_offset < 0 || dst_offset > dst->
nb_samples ||
290 src_offset < 0 || src_offset > src->
nb_samples) {
292 src_offset, dst_offset);
297 if (nb_samples > src->
nb_samples - src_offset)
315 dst_offset2 = dst_offset + nb_samples;
318 for (p = 0; p < src->
planes; p++) {
319 if (dst_move_size > 0) {
320 memmove(dst->
data[p] + dst_offset2 * dst->
stride,
322 dst_move_size * dst->
stride);
324 memcpy(dst->
data[p] + dst_offset * dst->
stride,
326 nb_samples * src->
stride);
340 int move_offset = a->
stride * nb_samples;
343 for (p = 0; p < a->
planes; p++)
344 memmove(a->
data[p], a->
data[p] + move_offset, move_size);
358 offset_size = offset * a->
stride;
359 for (p = 0; p < a->
planes; p++)
360 offset_data[p] = a->
data[p] + offset_size;