[FFmpeg-devel] [PATCH] avfilter/af_firequalizer: add av_restrict on convolution func
Muhammad Faiz
mfcc64 at gmail.com
Sat Mar 11 22:34:36 EET 2017
On Sat, Mar 11, 2017 at 8:05 PM, wm4 <nfxjfg at googlemail.com> wrote:
> On Sat, 11 Mar 2017 07:56:52 +0700
> Muhammad Faiz <mfcc64 at gmail.com> wrote:
>
>> slightly improved speed
>>
>> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
>> ---
>> libavfilter/af_firequalizer.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavfilter/af_firequalizer.c b/libavfilter/af_firequalizer.c
>> index 5c6fd54..4243d66 100644
>> --- a/libavfilter/af_firequalizer.c
>> +++ b/libavfilter/af_firequalizer.c
>> @@ -197,8 +197,8 @@ static int query_formats(AVFilterContext *ctx)
>> return ff_set_common_samplerates(ctx, formats);
>> }
>>
>> -static void fast_convolute(FIREqualizerContext *s, const float *kernel_buf, float *conv_buf,
>> - OverlapIndex *idx, float *data, int nsamples)
>> +static void fast_convolute(FIREqualizerContext *av_restrict s, const float *av_restrict kernel_buf, float *av_restrict conv_buf,
>> + OverlapIndex *av_restrict idx, float *av_restrict data, int nsamples)
>> {
>> if (nsamples <= s->nsamples_max) {
>> float *buf = conv_buf + idx->buf_idx * s->rdft_len;
>> @@ -235,8 +235,8 @@ static void fast_convolute(FIREqualizerContext *s, const float *kernel_buf, floa
>> }
>> }
>>
>> -static void fast_convolute2(FIREqualizerContext *s, const float *kernel_buf, FFTComplex *conv_buf,
>> - OverlapIndex *idx, float *data0, float *data1, int nsamples)
>> +static void fast_convolute2(FIREqualizerContext *av_restrict s, const float *av_restrict kernel_buf, FFTComplex *av_restrict conv_buf,
>> + OverlapIndex *av_restrict idx, float *av_restrict data0, float *av_restrict data1, int nsamples)
>> {
>> if (nsamples <= s->nsamples_max) {
>> FFTComplex *buf = conv_buf + idx->buf_idx * s->rdft_len;
>
> Seems ok. How much improved?
fast_convolute():
old: 791277 decicycles in fast_convolute(), 65536 runs, 0 skips
new: 775519 decicycles in fast_convolute(), 65536 runs, 0 skips
fast_convolute2():
old: 532707 decicycles in fast_convolute2(), 65535 runs, 1 skips
new: 518874 decicycles in fast_convolute2(), 65536 runs, 0 skips
Applied.
Thank's
More information about the ffmpeg-devel
mailing list