[FFmpeg-devel] [PATCH 4/5] wma lossless: pad coeff buffer with 0

Christophe Gisquet christophe.gisquet at gmail.com
Fri May 30 19:51:29 CEST 2014


Resurrecting an old thread...

2014-02-10 21:43 GMT+01:00 Michael Niedermayer <michaelni at gmx.at>:
> this is safe but not the most efficint
> I should have been more specific, what i suggest is for example to
> make the buffer that is written into, 8 elements larger
> then adding 8 element padding should always be safe independant of
> what order or max order is

I'm attaching 2 patches:
1) split back apedsp into a llauddsp (modelled after the ugly llviddsp)
2) use this new dsp in wma lossless

Patch 2 does what you suggest: declare a larger than needed array to
simplify the memsetting.

While the needed padding size is known, this makes the array kind of
ugly. I could have written " + 8" instead (but magic numbers are bad)
or "+ WMALL_COEFF_PAD_SIZE" (but this is incorrect).

Also I used memset instead of AV_ZERO128 because the later expects an
aligned address. This is the case currently. Maybe using 2 AV_ZERO64
then?

-- 
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-apedsp-move-to-llauddsp.patch
Type: text/x-patch
Size: 15499 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140530/e7b31502/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-wma-lossless-reuse-scalarproduct_and_madd_int16.patch
Type: text/x-patch
Size: 6216 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140530/e7b31502/attachment-0001.bin>


More information about the ffmpeg-devel mailing list