[FFmpeg-devel] [PATCH] Fix non-rounding up to next 16-bit aligned bug in IFF decoder
Sebastian Vater
cdgs.basty
Thu Apr 29 16:58:11 CEST 2010
M?ns Rullg?rd a ?crit :
> Michael Niedermayer <michaelni at gmx.at> writes:
>
>
>> On Thu, Apr 29, 2010 at 03:36:07PM +0200, Sebastian Vater wrote:
>> [...]
>>
>>> static void decodeplane8(uint8_t *dst,
>>> const uint8_t *buf,
>>> const unsigned buf_size,
>>> const unsigned bps,
>>> const unsigned plane)
>>> {
>>> START_TIMER;
>>> const uint8_t *end = dst + (buf_size * 8);
>>> const uint64_t *lut = plane8_lut[plane];
>>> for(; dst < end; dst += 8) {
>>> const uint64_t v = AV_RN64A(dst) | lut[*buf++];
>>> AV_WN64A(dst, v);
>>> }
>>> STOP_TIMER("decodeplane8");
>>> }
>>>
>> this looks very nice
>>
>
> Is the length always a multiple of 8 now? Earlier you said 4...
> What's the deal?
>
Seems you're mixing this with sth. up...
length is now word aligned, i.e. 16 bits (thus a multiple of buf_size * 16).
dst is AVPacket->data aligned. Don't know exactly what ffmpeg uses to
align this.
buf is always 16 bits aligned.
Each line in dst is frame.linesize[0] aligned...here I also don't know
the alignment.
But I assume that AVPacket->data and AVFrame->linesize[0] are aligned to
16 bytes for allowing e.g. MMX processing the image data. ;-)
--
Best regards,
:-) Basty/CDGS (-:
More information about the ffmpeg-devel
mailing list