[FFmpeg-devel] [PATCH] lavfi: add curves filter.

Clément Bœsch ubitux at gmail.com
Tue Mar 5 22:18:52 CET 2013


On Tue, Mar 05, 2013 at 08:01:42PM +0100, Nicolas George wrote:
> Le quintidi 15 ventôse, an CCXXI, Clement Boesch a écrit :
> > +    double *matrix = av_calloc(3 * n, sizeof(*matrix));
> > +    double *h = av_malloc((n - 1) * sizeof(*h));
> > +    double *r = av_calloc(n, sizeof(*r));
> 
> You could maybe make the code a little more readable by declaring the matrix
> as a bidimensional array: matrix[n][3] (since only the first dimension is
> variable, it can work).
> 

I didn't wanted to resurrect some VLA, nor replace 1 heap alloc with 3.

> > +    /* left side of the polynomials into a tridiagonal matrix */
> > +    matrix[0] = matrix[n*3 - 1] = 1;
> 
> I am not 100% sure yet, but I suspect it should be
> matrix[1] = matrix[n * 3 - 2] = 1.
> 

So they would be in the main diagonal? Indeed that would make more sense.
I didn't though about changing it when moving from a real matrix to the
tridiagonal form...

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130305/26314389/attachment.asc>


More information about the ffmpeg-devel mailing list