51 return sample_fmt_info[sample_fmt].
name;
59 if (!strcmp(sample_fmt_info[i].name, name))
68 if (sample_fmt_info[sample_fmt].planar == planar)
70 return sample_fmt_info[sample_fmt].
altform;
77 if (sample_fmt_info[sample_fmt].planar)
78 return sample_fmt_info[sample_fmt].
altform;
86 if (sample_fmt_info[sample_fmt].planar)
88 return sample_fmt_info[sample_fmt].
altform;
95 snprintf(buf, buf_size,
"name " " depth");
107 0 : sample_fmt_info[sample_fmt].
bits >> 3;
110 #if FF_API_GET_BITS_PER_SAMPLE_FMT
114 0 : sample_fmt_info[sample_fmt].
bits;
122 return sample_fmt_info[sample_fmt].
planar;
133 if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
138 if (nb_samples > INT_MAX - 31)
141 nb_samples =
FFALIGN(nb_samples, 32);
145 if (nb_channels > INT_MAX / align ||
146 (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
149 line_size = planar ?
FFALIGN(nb_samples * sample_size, align) :
150 FFALIGN(nb_samples * sample_size * nb_channels, align);
152 *linesize = line_size;
154 return planar ? line_size * nb_channels : line_size;
161 int ch, planar, buf_size, line_size;
169 audio_data[0] = (
uint8_t *)buf;
171 audio_data[ch] = audio_data[ch-1] + line_size;
174 *linesize = line_size;
176 #if FF_API_SAMPLES_UTILS_RETURN_ZERO
197 nb_samples, sample_fmt, align);
205 #if FF_API_SAMPLES_UTILS_RETURN_ZERO
217 *audio_data =
av_calloc(nb_planes,
sizeof(**audio_data));
221 nb_samples, sample_fmt, align);
232 int planes = planar ? nb_channels : 1;
234 int data_size = nb_samples * block_align;
237 dst_offset *= block_align;
238 src_offset *= block_align;
240 if((dst[0] < src[0] ? src[0] - dst[0] : dst[0] - src[0]) >= data_size) {
241 for (i = 0; i < planes; i++)
242 memcpy(dst[i] + dst_offset, src[i] + src_offset, data_size);
244 for (i = 0; i < planes; i++)
245 memmove(dst[i] + dst_offset, src[i] + src_offset, data_size);
255 int planes = planar ? nb_channels : 1;
257 int data_size = nb_samples * block_align;
262 offset *= block_align;
264 for (i = 0; i < planes; i++)
265 memset(audio_data[i] + offset, fill_char, data_size);