diff mbox

[FFmpeg-devel,1/2] swresample/soxr: fix invalid use of linear_interp

Message ID 1480067735-15589-1-git-send-email-mfcc64@gmail.com
State Accepted
Commit da34e4e13238b755bb0e6ebf549015797d9b4467
Headers show

Commit Message

Muhammad Faiz Nov. 25, 2016, 9:55 a.m. UTC
give very bad quality for soxr resampler.
linear_interp is intended for  using linear interpolation
between filter bank so quality will be better.

i guess this is misunderstood as 'do not use filter bank,
but directly interpolate linearly between samples'.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
---
 libswresample/soxr_resample.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Nov. 25, 2016, 12:56 p.m. UTC | #1
On Fri, Nov 25, 2016 at 04:55:34PM +0700, Muhammad Faiz wrote:
> give very bad quality for soxr resampler.
> linear_interp is intended for  using linear interpolation
> between filter bank so quality will be better.
> 
> i guess this is misunderstood as 'do not use filter bank,
> but directly interpolate linearly between samples'.
> 
> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
> ---
>  libswresample/soxr_resample.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

probably ok

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
Muhammad Faiz Nov. 25, 2016, 10:55 p.m. UTC | #2
On 11/25/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Fri, Nov 25, 2016 at 04:55:34PM +0700, Muhammad Faiz wrote:
>> give very bad quality for soxr resampler.
>> linear_interp is intended for  using linear interpolation
>> between filter bank so quality will be better.
>>
>> i guess this is misunderstood as 'do not use filter bank,
>> but directly interpolate linearly between samples'.
>>
>> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
>> ---
>>  libswresample/soxr_resample.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> probably ok

applied

thanks
diff mbox

Patch

diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c
index b9c6735..8181c74 100644
--- a/libswresample/soxr_resample.c
+++ b/libswresample/soxr_resample.c
@@ -46,7 +46,7 @@  static struct ResampleContext *create(struct ResampleContext *c, int out_rate, i
     soxr_io_spec_t io_spec = soxr_io_spec(type, type);
 
     soxr_quality_spec_t q_spec = soxr_quality_spec((int)((precision-2)/4), (SOXR_HI_PREC_CLOCK|SOXR_ROLLOFF_NONE)*!!cheby);
-    q_spec.precision = linear? 0 : precision;
+    q_spec.precision = precision;
 #if !defined SOXR_VERSION /* Deprecated @ March 2013: */
     q_spec.bw_pc = cutoff? FFMAX(FFMIN(cutoff,.995),.8)*100 : q_spec.bw_pc;
 #else