39 "fixed",
"float",
"double"
42 #define OFFSET(x) offsetof(VolumeContext, x)
43 #define A AV_OPT_FLAG_AUDIO_PARAM
44 #define F AV_OPT_FLAG_FILTERING_PARAM
47 {
"volume",
"set volume adjustment",
49 {
"precision",
"select mathematical precision",
62 static const char *shorthand[] = {
"volume",
"precision",
NULL };
65 vol->
class = &volume_class;
139 dst[i] = av_clip_uint8(((((int64_t)src[i] - 128) * volume + 128) >> 8) + 128);
147 dst[i] = av_clip_uint8((((src[i] - 128) * volume + 128) >> 8) + 128);
154 int16_t *smp_dst = (int16_t *)dst;
155 const int16_t *smp_src = (
const int16_t *)src;
157 smp_dst[i] = av_clip_int16(((int64_t)smp_src[i] * volume + 128) >> 8);
164 int16_t *smp_dst = (int16_t *)dst;
165 const int16_t *smp_src = (
const int16_t *)src;
167 smp_dst[i] = av_clip_int16((smp_src[i] * volume + 128) >> 8);
177 smp_dst[i] = av_clipl_int32((((int64_t)smp_src[i] * volume + 128) >> 8));
250 int p, plane_samples;
258 for (p = 0; p < vol->
planes; p++) {
264 for (p = 0; p < vol->
planes; p++) {
267 vol->
volume, plane_samples);
270 for (p = 0; p < vol->
planes; p++) {
273 vol->
volume, plane_samples);
308 .
inputs = avfilter_af_volume_inputs,
309 .
outputs = avfilter_af_volume_outputs,
310 .priv_class = &volume_class,