Re: [FFmpeg-devel] [PATCH 1/6] avcodec/vorbisenc: Add pre-echo detection

2017-08-23 Thread Tyler Jones
On Wed, Aug 23, 2017 at 10:11:50AM +0200, Tomas Härdin wrote: > On 2017-08-22 03:23, Tyler Jones wrote: > > + > > +/** > > + * Calculate the variance of a block of samples > > + * > > + * @param in Array of input samples > > + * @param length

Re: [FFmpeg-devel] [PATCH 2/6] avcodec/vorbisenc: Apply dynamic frame lengths

2017-08-23 Thread Tyler Jones
On Wed, Aug 23, 2017 at 10:31:58AM +0200, Tomas Härdin wrote: > On 2017-08-22 03:23, Tyler Jones wrote: > > +static int create_residues(vorbis_enc_context *venc) > > +{ > > +int res, ret; > > +vorbis_enc_residue *rc; > > + > > +venc->nresidues

[FFmpeg-devel] [PATCH] avcodec/vorbisenc: Improve documentation

2017-08-22 Thread Tyler Jones
Signed-off-by: Tyler Jones --- This patch applies cleanly onto "[PATCH 6/6] avcodec/vorbisenc: Add support for mono streams". libavcodec/vorbis_enc_data.h | 20 ++-- libavcodec/vorbisenc.c | 43 +-- libavcodec/vorbisenc.h

[FFmpeg-devel] [PATCH 4/6] avcodec/vorbisenc: Move encoder structures and macros to separate file

2017-08-21 Thread Tyler Jones
Encoder structures are moved to a separate header file to improve readability. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 118 +--- libavcodec/vorbisenc.h | 145 + 2 files changed, 146 insertions

[FFmpeg-devel] [PATCH 2/6] avcodec/vorbisenc: Apply dynamic frame lengths

2017-08-21 Thread Tyler Jones
lengths so that values are partitioned correctly for transient frames. Signed-off-by: Tyler Jones --- V4: No changes V3: Switch 'bits[p] == 0' to '!bits[p]' in vlc gen V2: Fix double arithmetic in window scale libavcodec/vorbis.c | 10 +- libavcodec/vor

[FFmpeg-devel] [PATCH 1/6] avcodec/vorbisenc: Add pre-echo detection

2017-08-21 Thread Tyler Jones
likely to be noticeable when relatively quiet audio is followed by a loud transient signal. Signed-off-by: Tyler Jones --- V4: Use AVFloatDSPContext for variance calculation Correctly change quality factors to const Remove unnecessary malloc and free for VorbisPsyContext V3: Use normal float

[FFmpeg-devel] [PATCH 6/6] avcodec/vorbisenc: Add support for mono streams

2017-08-21 Thread Tyler Jones
Signed-off-by: Tyler Jones --- libavcodec/vorbis_enc_data.h | 245 ++- libavcodec/vorbisenc.c | 46 2 files changed, 267 insertions(+), 24 deletions(-) diff --git a/libavcodec/vorbis_enc_data.h b/libavcodec/vorbis_enc_data.h index

[FFmpeg-devel] [PATCH 5/6] avcodec/vorbisenc: Separate floor and residue configurations

2017-08-21 Thread Tyler Jones
The settings used for initializing the floor and residue codebooks are separated so that they aren't coupled for later changes for arbitrary channel configurations. Signed-off-by: Tyler Jones --- libavcodec/vorbis_enc_data.h | 112 ++--- libavcodec/vorbis

[FFmpeg-devel] [PATCH 3/6] avcodec/vorbisenc: Add clipping avoidance

2017-08-21 Thread Tyler Jones
Clipping is avoided by taking the maximum value of each frame before window application, and scaling down the entire frame by a scalar factor. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 8 libavcodec/vorbispsy.c | 17 + libavcodec/vorbispsy.h | 10

[FFmpeg-devel] [PATCH 0/6] avcodec: Vorbis encoder improvements

2017-08-21 Thread Tyler Jones
advance. Tyler Jones (5): avcodec/vorbisenc: Add pre-echo detection V4: Use AVFloatDSPContext for variance calculation Correctly change quality factors to const Remove unnecessary malloc and free for VorbisPsyContext V3: Use normal float notation Don't check before fr

[FFmpeg-devel] [PATCH V4 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-28 Thread Tyler Jones
lengths so that values are partitioned correctly for transient frames. Signed-off-by: Tyler Jones --- V4: No changes V3: Switch 'bits[p] == 0' to '!bits[p]' in vlc gen V2: Fix double arithmetic in window scale libavcodec/vorbis.c | 10 +- libavcodec/vor

[FFmpeg-devel] [PATCH V4 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-28 Thread Tyler Jones
likely to be noticeable when relatively quiet audio is followed by a loud transient signal. Signed-off-by: Tyler Jones --- V4: Use AVFloatDSPContext for variance calculation Correctly change quality factors to const Remove unnecessary malloc and free for VorbisPsyContext V3: Use normal float

Re: [FFmpeg-devel] [PATCH V3 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-28 Thread Tyler Jones
> > +av_cold int ff_psy_vorbis_init(VorbisPsyContext *vpctx, int sample_rate, > > + int channels, int blocks) > > +{ > > +int crit_freq; > > +float Q[2] = {.54, 1.31}; // Quality values for maximally flat > > cascaded filters > > const float Q[2] Fixed. Thank you for catching these mistakes and providing suggestions. A new version of this patch will be sent soon. Thanks again, Tyler Jones signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

[FFmpeg-devel] [PATCH V3 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-27 Thread Tyler Jones
lengths so that values are partitioned correctly for transient frames. Signed-off-by: Tyler Jones --- V3: Switch 'bits[p] == 0' to '!bits[p]' in vlc gen V2: Fix double arithmetic in window scale libavcodec/vorbis.c | 10 +- libavcodec/vor

[FFmpeg-devel] [PATCH V3 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-27 Thread Tyler Jones
likely to be noticeable when relatively quiet audio is followed by a loud transient signal. Signed-off-by: Tyler Jones --- V3: Use normal float notation Don't check before freeing NULL pointers Remove unnecessary includes V2: Provide proper prefix for non-static function libav

Re: [FFmpeg-devel] [PATCH V2 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-26 Thread Tyler Jones
On Wed, Jul 26, 2017 at 12:51:31AM +0100, Rostislav Pehlivanov wrote: > On 17 July 2017 at 16:17, Tyler Jones wrote: > > > +float last_var; > > +const float eps = 1e-4; > > > > Use normal notation for floats and add an f at the end to inform the >

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-25 Thread Tyler Jones
On Wed, Jul 26, 2017 at 01:01:00AM +0100, Rostislav Pehlivanov wrote: > On 12 July 2017 at 23:18, Tyler Jones wrote: > > > > > diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c > > index 399020e..8befab8 100644 > > --- a/libavcodec/vorbis.c > > +++ b/li

Re: [FFmpeg-devel] [PATCH] avcodec/vorbisdec: Check for legal version, window and transform types

2017-07-23 Thread Tyler Jones
On Mon, Jul 24, 2017 at 02:54:01AM +0200, Carl Eugen Hoyos wrote: > 2017-07-24 2:46 GMT+02:00 Tyler Jones : > > On Mon, Jul 24, 2017 at 01:52:20AM +0200, Carl Eugen Hoyos wrote: > >> 2017-07-24 0:33 GMT+02:00 Tyler Jones : > >> > Vorbis I specification requires that

Re: [FFmpeg-devel] [PATCH] avcodec/vorbisdec: Check for legal version, window and transform types

2017-07-23 Thread Tyler Jones
On Mon, Jul 24, 2017 at 01:52:20AM +0200, Carl Eugen Hoyos wrote: > 2017-07-24 0:33 GMT+02:00 Tyler Jones : > > Vorbis I specification requires that the version number as well as the > > window and transform types in the setup header be equal to 0. > > > >

[FFmpeg-devel] [PATCH] avcodec/vorbisdec: Check for legal version, window and transform types

2017-07-23 Thread Tyler Jones
Vorbis I specification requires that the version number as well as the window and transform types in the setup header be equal to 0. Signed-off-by: Tyler Jones --- libavcodec/vorbisdec.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libavcodec

Re: [FFmpeg-devel] [PATCH V2 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-21 Thread Tyler Jones
On Mon, Jul 17, 2017 at 09:17:09AM -0600, Tyler Jones wrote: > The encoder will attempt to determine the existence of transient > signals by applying a 4th order highpass filter to remove dominant > low frequency waveforms. Frames are then split up into blocks > where the variance i

[FFmpeg-devel] [PATCH V2 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-17 Thread Tyler Jones
likely to be noticeable when relatively quiet audio is followed by a loud transient signal. Signed-off-by: Tyler Jones --- V2 - Properly prefix non-static functions with "ff_" libavcodec/Makefile| 2 +- libavcodec/vorbisenc.c | 28 +++-- libavcodec/vorbisp

[FFmpeg-devel] [PATCH V2 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-17 Thread Tyler Jones
lengths so that values are partitioned correctly for transient frames. Signed-off-by: Tyler Jones --- V2 -- Remove double arithmetic in window scale constant libavcodec/vorbis.c | 10 +- libavcodec/vorbis_enc_data.h | 289 +++-- libavcodec/vorbisenc.c

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-14 Thread Tyler Jones
On Fri, Jul 14, 2017 at 12:43:26AM +0200, Michael Niedermayer wrote: > On Wed, Jul 12, 2017 at 04:18:06PM -0600, Tyler Jones wrote: > [...] > > > > +av_cold int psy_vorbis_init(VorbisPsyContext *vpctx, int sample_rate, > > +int channels, int

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-13 Thread Tyler Jones
On Thu, Jul 13, 2017 at 03:50:13PM +0200, Moritz Barsnick wrote: > On Wed, Jul 12, 2017 at 16:18:20 -0600, Tyler Jones wrote: > > -int window_len = 1 << (venc->log2_blocksize[1] - 1); > > -float n = (float)(1 << venc->log2_blocksize[1]) / 4.0; > > +

[FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Apply dynamic frame lengths

2017-07-12 Thread Tyler Jones
lengths so that values are partitioned correctly for transient frames. Signed-off-by: Tyler Jones --- libavcodec/vorbis.c | 10 +- libavcodec/vorbis_enc_data.h | 289 +++-- libavcodec/vorbisenc.c | 422 ++- tests/fate

[FFmpeg-devel] [PATCH 1/2] avcodec/vorbisenc: Add pre-echo detection

2017-07-12 Thread Tyler Jones
likely to be noticeable when relatively quiet audio is followed by a loud transient signal. Signed-off-by: Tyler Jones --- libavcodec/Makefile| 2 +- libavcodec/vorbisenc.c | 28 +++-- libavcodec/vorbispsy.c | 153 + libavcodec/vorbispsy.h

[FFmpeg-devel] [PATCH 3/3] avcodec/vorbisenc: Stop tracking number of samples per frame

2017-06-14 Thread Tyler Jones
Each frame is now padded with 0 values if not enough samples are present, and all frames are guaranteed to have exactly 1 << (venc->log2_blocksize[1] - 1) samples. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 33 - 1 file changed, 16 insertio

[FFmpeg-devel] [PATCH 2/3] avcodec/vorbisenc: Apply and output correct length window and mdct

2017-06-14 Thread Tyler Jones
Usage of blocksize, window, mode, and mdct indexes are switched from default 0 to a default of 1 to better align with specs. A flag of 0 should correspond with short windows, a flag of 1 with long. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 25 ++--- 1 file

[FFmpeg-devel] [PATCH 1/3] avcodec/vorbisenc: Separate copying audio samples from windowing

2017-06-14 Thread Tyler Jones
. This improves readability when applying windows of varying lengths. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 76 +- 1 file changed, 32 insertions(+), 44 deletions(-) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index

[FFmpeg-devel] [PATCH] avcodec/vorbisenc: Fix memory leak on errors

2017-06-06 Thread Tyler Jones
Switches temporary samples for processing to be stored in the encoder's context, avoids memory leaks if any errors occur while encoding a frame. Fixes CID1412026 Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 49 - 1 file change

[FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Use a bufqueue in encoding with smaller lengths

2017-05-30 Thread Tyler Jones
Switching the vorbis encoder to use a buffer queue for input frames allows saving lookahead samples more easily and safely for psychoacoustic systems, requiring less pointer arithmetic in the case of transient windows. --- libavcodec/vorbisenc.c | 120 +++---

[FFmpeg-devel] [PATCH 1/2] avcodec/vorbisenc: Include bufqueue and afqueue

2017-05-30 Thread Tyler Jones
--- libavcodec/vorbisenc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index 2974ca2..fdce864 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -33,6 +33,9 @@ #include "vorbis.h" #include "vorbis_enc_data.h"

[FFmpeg-devel] [PATCH 1/2] avcodec/vorbisenc: Include fdsp

2017-05-30 Thread Tyler Jones
Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index 2974ca2..7c3cd51 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c

[FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Use fdsp for applying windows

2017-05-30 Thread Tyler Jones
Using fdsp improves readability and allows using architecture-specific optimizations. Signed-off-by: Tyler Jones --- libavcodec/vorbisenc.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index 7c3cd51..1777a49

[FFmpeg-devel] [PATCH 1/2] avcodec/vorbis_enc_data: Include scalewidth band factors

2017-03-26 Thread Tyler Jones
. Window size is currently only assumed to be 1024 with the vorbis encoder. This is part of a GSoC qualification task. Signed-off-by: Tyler Jones --- libavcodec/vorbis_enc_data.h | 108 +++ 1 file changed, 108 insertions(+) diff --git a/libavcodec

[FFmpeg-devel] [PATCH 2/2] avcodec/vorbisenc: Implement transient detection in Vorbis encoder

2017-03-26 Thread Tyler Jones
occur with this codec. Signed-off-by: Tyler Jones --- libavcodec/psymodel.c | 1 + libavcodec/vorbisenc.c | 60 ++ 2 files changed, 61 insertions(+) diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c index 2b5f111..38831ce 100644 --- a