[PATCH 07/23] echo-cancel: Fix zeroing of w in AEC_leaky()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Thu, 2013-02-14 at 16:42 +0200, Tanu Kaskinen wrote:
> > On Wed, 2013-02-13 at 17:26 +0100, Peter Meerwald wrote:
> > > From: Peter Meerwald <p.meerwald at bct-electronic.com>
> > > 
> > > bug probably caused by alignment requirement; sizeof(a->w) is a pointer, sizeof(a->w_arr) is an array
> > 
> > The patch is good, I'll apply it. But speaking of w alignment, isn't the
> > alignment code in AEC_init() wrong? Currently it's:
> > 
> > a->w = (REAL *) (((uintptr_t) a->w_arr) + (((uintptr_t) a->w_arr) % 16));
> > 
> > Shouldn't it be
> > 
> > a->w = (REAL *) (((uintptr_t) a->w_arr) - (((uintptr_t) a->w_arr) % 16) + 16 / sizeof(REAL));
> > 
> > ?
> 
> Sorry, dividing by sizeof(REAL) shouldn't be there, since the
> calculation is in byte domain. I got confused by the w_arr declaration.

you are right, the code is super-confusing
I haven't seen uintptr_t before (unsigned int or unsigned long int 
depending on platform, 64 vs. 32 bit)

thank you for having a look!

-- 

Peter Meerwald
+43-664-2444418 (mobile)


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux