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;
67 int read_only,
const char *
name)
71 memset(a, 0,
sizeof(*a));
88 for (p = 0; p < (a->
is_planar ? channels : 1); p++) {
102 a->
name = name ? name :
"{no name}";
138 a->
name = name ? name :
"{no name}";
140 if (nb_samples > 0) {
155 int ret, new_buf_size, plane_size, p;
168 if (new_buf_size < 0)
182 for (p = 0; p < a->
planes; p++)
186 memcpy(a->
data, new_data,
sizeof(new_data));
236 for (p = 0; p < src->
planes; p++)
246 int ret, p, dst_offset2, dst_move_size;
255 if (dst_offset < 0 || dst_offset > dst->
nb_samples ||
256 src_offset < 0 || src_offset > src->
nb_samples) {
258 src_offset, dst_offset);
263 if (nb_samples > src->
nb_samples - src_offset)
284 for (p = 0; p < src->
planes; p++) {
285 if (dst_move_size > 0) {
286 memmove(dst->
data[p] + dst_offset2 * dst->
stride,
288 dst_move_size * dst->
stride);
290 memcpy(dst->
data[p] + dst_offset * dst->
stride,
292 nb_samples * src->
stride);
309 for (p = 0; p < a->
planes; p++)
310 memmove(a->
data[p], a->
data[p] + move_offset, move_size);
324 offset_size = offset * a->
stride;
325 for (p = 0; p < a->
planes; p++)
326 offset_data[p] = a->
data[p] + offset_size;