diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-04-09 22:10:14 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-04-10 12:04:14 +0200 |
commit | 75b854adbd4efeab36eba1f3fb3953951c6f2575 (patch) | |
tree | 659d390a864ad8faa49d81b3f85b8137a4db7ab7 /libavfilter | |
parent | 4dc2dd80dc78f4abb19052682bfb68d64a7a96d6 (diff) | |
download | ffmpeg-75b854adbd4efeab36eba1f3fb3953951c6f2575.tar.gz |
avfilter/af_amix: add double sample format support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_amix.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index a4d138927f..9fe505b0dc 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -336,10 +336,19 @@ static int output_frame(AVFilterLink *outlink) plane_size = nb_samples * (s->planar ? 1 : s->nb_channels); plane_size = FFALIGN(plane_size, 16); - for (p = 0; p < planes; p++) { - s->fdsp->vector_fmac_scalar((float *)out_buf->extended_data[p], - (float *) in_buf->extended_data[p], - s->input_scale[i], plane_size); + if (out_buf->format == AV_SAMPLE_FMT_FLT || + out_buf->format == AV_SAMPLE_FMT_FLTP) { + for (p = 0; p < planes; p++) { + s->fdsp->vector_fmac_scalar((float *)out_buf->extended_data[p], + (float *) in_buf->extended_data[p], + s->input_scale[i], plane_size); + } + } else { + for (p = 0; p < planes; p++) { + s->fdsp->vector_dmac_scalar((double *)out_buf->extended_data[p], + (double *) in_buf->extended_data[p], + s->input_scale[i], plane_size); + } } } } @@ -529,6 +538,8 @@ static int query_formats(AVFilterContext *ctx) if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLT )) < 0 || (ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLTP)) < 0 || + (ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL )) < 0 || + (ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBLP)) < 0 || (ret = ff_set_common_formats (ctx, formats)) < 0 || (ret = ff_set_common_channel_layouts(ctx, layouts)) < 0 || (ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0) |