[FFmpeg-devel] [PATCH] lavfi: add curves filter.
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] (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 = matrix[n*3 - 1] = 1;
> I am not 100% sure yet, but I suspect it should be
> matrix = 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 490 bytes
Desc: not available
More information about the ffmpeg-devel