Message ID | 20171115074518.25623-1-lq@chinaffmpeg.org |
---|---|
State | New |
Headers | show |
On 11/15/17, Steven Liu <lq@chinaffmpeg.org> wrote: > Signed-off-by: Steven Liu <lq@chinaffmpeg.org> > --- > libavformat/wavdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > NACK FFABS is slower than fabs.
> FFABS is slower than fabs.
Not generally. That is highly dependent on compiler/flags/architecture.
In some cases, FFABS may actually be faster, in others maybe not.
The expected result would be on-par performance.
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index b016185a1b..9f3e01e5b8 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -531,7 +531,7 @@ break_loop: && st->codecpar->sample_rate > 0 && sample_count > 0 && st->codecpar->channels > 1 && sample_count % st->codecpar->channels == 0) { - if (fabs(8.0 * data_size * st->codecpar->channels * st->codecpar->sample_rate / + if (FFABS(8.0 * data_size * st->codecpar->channels * st->codecpar->sample_rate / sample_count /st->codecpar->bit_rate - 1.0) < 0.3) sample_count /= st->codecpar->channels; }
Signed-off-by: Steven Liu <lq@chinaffmpeg.org> --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)