Re: [FFmpeg-devel] [PATCH 2/2] swresample/x86: add support for exact_rational

2016-06-20 Thread Muhammad Faiz
On Mon, Jun 20, 2016 at 8:16 PM, Michael Niedermayer
 wrote:
> On Thu, Jun 16, 2016 at 12:31:04AM +0700, Muhammad Faiz wrote:
>> phase_shift and phase_mask is removed
>> generally exact_rational=on is faster than exact_rational=off
>>
>> Signed-off-by: Muhammad Faiz 
>> ---
>>  libswresample/resample.c  |  2 -
>>  libswresample/resample.h  |  3 --
>>  libswresample/x86/resample.asm| 87 
>> +--
>>  libswresample/x86/resample_init.c |  4 --
>>  4 files changed, 46 insertions(+), 50 deletions(-)
>
> tested on mingwg32/64 and linux 32/64
>
applied

thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] swresample/x86: add support for exact_rational

2016-06-20 Thread Michael Niedermayer
On Thu, Jun 16, 2016 at 12:31:04AM +0700, Muhammad Faiz wrote:
> phase_shift and phase_mask is removed
> generally exact_rational=on is faster than exact_rational=off 
> 
> Signed-off-by: Muhammad Faiz 
> ---
>  libswresample/resample.c  |  2 -
>  libswresample/resample.h  |  3 --
>  libswresample/x86/resample.asm| 87 
> +--
>  libswresample/x86/resample_init.c |  4 --
>  4 files changed, 46 insertions(+), 50 deletions(-)

tested on mingwg32/64 and linux 32/64

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] swresample/x86: add support for exact_rational

2016-06-20 Thread Muhammad Faiz
On Thu, Jun 16, 2016 at 12:31 AM, Muhammad Faiz  wrote:
> phase_shift and phase_mask is removed
> generally exact_rational=on is faster than exact_rational=off
>
> Signed-off-by: Muhammad Faiz 
> ---
>  libswresample/resample.c  |  2 -
>  libswresample/resample.h  |  3 --
>  libswresample/x86/resample.asm| 87 
> +--
>  libswresample/x86/resample_init.c |  4 --
>  4 files changed, 46 insertions(+), 50 deletions(-)
>
going to apply this if no one object

thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] swresample/x86: add support for exact_rational

2016-06-15 Thread Muhammad Faiz
phase_shift and phase_mask is removed
generally exact_rational=on is faster than exact_rational=off 

Signed-off-by: Muhammad Faiz 
---
 libswresample/resample.c  |  2 -
 libswresample/resample.h  |  3 --
 libswresample/x86/resample.asm| 87 +--
 libswresample/x86/resample_init.c |  4 --
 4 files changed, 46 insertions(+), 50 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 3b01408..0952f2b 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -349,8 +349,6 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 goto error;
 }
 
-c->phase_shift   = phase_shift;
-c->phase_mask= phase_count - 1;
 c->phase_count   = phase_count;
 c->linear= linear;
 c->factor= factor;
diff --git a/libswresample/resample.h b/libswresample/resample.h
index 2c29959..ff0dec1 100644
--- a/libswresample/resample.h
+++ b/libswresample/resample.h
@@ -40,9 +40,6 @@ typedef struct ResampleContext {
 int frac;
 int src_incr;
 int compensation_distance;
-/* TODO remove phase_shift and phase_mask */
-attribute_deprecated int phase_shift;
-attribute_deprecated int phase_mask;
 int phase_count;
 int linear;
 enum SwrFilterType filter_type;
diff --git a/libswresample/x86/resample.asm b/libswresample/x86/resample.asm
index 4989aa6..4163df1 100644
--- a/libswresample/x86/resample.asm
+++ b/libswresample/x86/resample.asm
@@ -41,8 +41,7 @@ struc ResampleContext
 .frac:  resd 1
 .src_incr:  resd 1
 .compensation_distance: resd 1
-.phase_shift:   resd 1
-.phase_mask:resd 1
+.phase_count:   resd 1
 
 ; there's a few more here but we only care about the first few
 endstruc
@@ -55,11 +54,12 @@ pd_0x4000: dd 0x4000
 
 SECTION .text
 
+; FIXME remove unneeded variables (index_incr, phase_mask)
 %macro RESAMPLE_FNS 3-5 ; format [float or int16], bps, log2_bps, float op 
suffix [s or d], 1.0 constant
 ; int resample_common_$format(ResampleContext *ctx, $format *dst,
 ; const $format *src, int size, int update_ctx)
 %if ARCH_X86_64 ; unix64 and win64
-cglobal resample_common_%1, 0, 15, 2, ctx, dst, src, phase_shift, index, frac, 
\
+cglobal resample_common_%1, 0, 15, 2, ctx, dst, src, phase_count, index, frac, 
\
   dst_incr_mod, size, min_filter_count_x4, 
\
   min_filter_len_x4, dst_incr_div, 
src_incr, \
   phase_mask, dst_end, filter_bank
@@ -76,7 +76,6 @@ cglobal resample_common_%1, 0, 15, 2, ctx, dst, src, 
phase_shift, index, frac, \
 ; load as many variables in registers as possible; for the rest, store
 ; on stack so that we have 'ctx' available as one extra register
 movsized, r3d
-mov  phase_maskd, [ctxq+ResampleContext.phase_mask]
 %if UNIX64
 movupdate_context_stackd, r4d
 %endif
@@ -92,17 +91,17 @@ cglobal resample_common_%1, 0, 15, 2, ctx, dst, src, 
phase_shift, index, frac, \
 lea dst_endq, [dstq+sizeq*%2]
 
 %if UNIX64
-mov  ecx, [ctxq+ResampleContext.phase_shift]
+mov  ecx, [ctxq+ResampleContext.phase_count]
 mov  edi, [ctxq+ResampleContext.filter_alloc]
 
-DEFINE_ARGS filter_alloc, dst, src, phase_shift, index, frac, 
dst_incr_mod, \
+DEFINE_ARGS filter_alloc, dst, src, phase_count, index, frac, 
dst_incr_mod, \
 filter, min_filter_count_x4, min_filter_len_x4, dst_incr_div, \
 src_incr, phase_mask, dst_end, filter_bank
 %elif WIN64
 mov  R9d, [ctxq+ResampleContext.filter_alloc]
-mov  ecx, [ctxq+ResampleContext.phase_shift]
+mov  ecx, [ctxq+ResampleContext.phase_count]
 
-DEFINE_ARGS phase_shift, dst, src, filter_alloc, index, frac, 
dst_incr_mod, \
+DEFINE_ARGS phase_count, dst, src, filter_alloc, index, frac, 
dst_incr_mod, \
 filter, min_filter_count_x4, min_filter_len_x4, dst_incr_div, \
 src_incr, phase_mask, dst_end, filter_bank
 %endif
@@ -112,7 +111,7 @@ cglobal resample_common_%1, 0, 15, 2, ctx, dst, src, 
phase_shift, index, frac, \
 sub srcq, min_filter_len_x4q
 mov   src_stackq, srcq
 %else ; x86-32
-cglobal resample_common_%1, 1, 7, 2, ctx, phase_shift, dst, frac, \
+cglobal resample_common_%1, 1, 7, 2, ctx, phase_count, dst, frac, \
  index, min_filter_length_x4, filter_bank
 
 ; push temp variables to stack
@@ -127,7 +126,7 @@ cglobal resample_common_%1, 1, 7, 2, ctx, phase_shift, dst, 
frac, \
 PUSH  dwo