[FFmpeg-devel] [PATCH] swresample/resample: add force_comp argument

Muhammad Faiz mfcc64 at gmail.com
Wed Nov 23 19:21:50 EET 2016


On 11/23/16, Michael Niedermayer <michael at niedermayer.cc> wrote:
> On Mon, Nov 21, 2016 at 02:21:07AM +0700, Muhammad Faiz wrote:
>> On 11/21/16, Michael Niedermayer <michael at niedermayer.cc> wrote:
>> > On Sun, Nov 20, 2016 at 03:56:28PM +0700, Muhammad Faiz wrote:
>> >> this allow to use phase_count_compensation on init (rather than
>> >> rebuild on swr_set_compensation) when options suggest that
>> >> soft compensation is enabled
>> >>
>> >> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
>> >> ---
>> >>  libswresample/resample.c            | 4 +++-
>> >>  libswresample/soxr_resample.c       | 2 +-
>> >>  libswresample/swresample.c          | 5 ++++-
>> >>  libswresample/swresample_internal.h | 3 ++-
>> >>  4 files changed, 10 insertions(+), 4 deletions(-)
>> >
>> > please document this in the code with a comment or 2
>> > its not immedeatly obvious from reading the code
>>
>> ok, new patch attached
>>
>> thanks
>
>>  resample.c            |    7 ++++++-
>>  soxr_resample.c       |    3 ++-
>>  swresample.c          |    7 ++++++-
>>  swresample_internal.h |    3 ++-
>>  4 files changed, 16 insertions(+), 4 deletions(-)
>> ecc69d7aba15455780250ea23b661ebf136656c2
>> 0001-swresample-resample-add-soft_compensation-argument.patch
>> From 5846ba0a6df69e41783ab4caa88d392abd339ed1 Mon Sep 17 00:00:00 2001
>> From: Muhammad Faiz <mfcc64 at gmail.com>
>> Date: Mon, 21 Nov 2016 02:08:40 +0700
>> Subject: [PATCH] swresample/resample: add soft_compensation argument
>>
>> this allow to use larger phase_count on init (rather than
>> rebuild on swr_set_compensation) when options suggest that
>> soft compensation is enabled
>>
>> this affects only when exact_rational is enabled
>
> what if an application reinitializes the context more often than
> triggering soft compensation ?

In this case (or in worse condition such as no actual soft compensation happens
because timestamps are correct), the drawback is slower init/reinit, slightly
slower resampling and increased memory usage.

>
> maybe keeping statistics on actual soft_compensation use vs reinit
> would be a better deciding factor
> but maybe iam missing something

How I keep the statistics?

The main goal is to avoid rebuilding filter bank at runtime that
hurts real time application that use soft compensation e.g.
AV sync that uses non audio clock.

Actually I'm not sure with this.

Thank's


More information about the ffmpeg-devel mailing list