[FFmpeg-devel] [PATCH] Fix non-rounding up to next 16-bit aligned bug in IFF decoder

Ronald S. Bultje rsbultje
Thu Apr 29 21:01:39 CEST 2010


Hi,

On Thu, Apr 29, 2010 at 2:45 PM, Sebastian Vater
<cdgs.basty at googlemail.com> wrote:
> Did another version:
[..]
> ? ?START_TIMER;
> ? ?const uint32_t *lut = plane8_lut[plane];
> ? ?for(; --buf_size != 0; dst += 8) {
> ? ? ? ?uint32_t v;
> ? ? ? ?const unsigned x = *buf++;
> ? ? ? ?v = AV_RN32A(dst) | lut[x >> 4];
> ? ? ? ?AV_WN32A(dst, v);
> ? ? ? ?v = AV_RN32A(dst + 4) | lut[x & 0x0F];
> ? ? ? ?AV_WN32A(dst + 4, v);
> ? ?}
> ? ?STOP_TIMER("decodeplane8");
[..]
> ? ? ?58: ? ? ? 0f b6 16 ? ? ? ? ? ? ? ?movzbl (%esi),%edx
> ? ? ?5b: ? ? ? 83 c6 01 ? ? ? ? ? ? ? ?add ? ?$0x1,%esi
> ? ? ?5e: ? ? ? 89 d0 ? ? ? ? ? ? ? ? ? mov ? ?%edx,%eax
> ? ? ?60: ? ? ? 83 e2 0f ? ? ? ? ? ? ? ?and ? ?$0xf,%edx
> ? ? ?63: ? ? ? c1 e8 04 ? ? ? ? ? ? ? ?shr ? ?$0x4,%eax
> ? ? ?66: ? ? ? 8b 04 87 ? ? ? ? ? ? ? ?mov ? ?(%edi,%eax,4),%eax
> ? ? ?69: ? ? ? 09 01 ? ? ? ? ? ? ? ? ? or ? ? %eax,(%ecx)
> ? ? ?6b: ? ? ? 8b 04 97 ? ? ? ? ? ? ? ?mov ? ?(%edi,%edx,4),%eax
> ? ? ?6e: ? ? ? 09 41 04 ? ? ? ? ? ? ? ?or ? ? %eax,0x4(%ecx)
> ? ? ?71: ? ? ? 83 c1 08 ? ? ? ? ? ? ? ?add ? ?$0x8,%ecx
> ? ? ?74: ? ? ? 83 eb 01 ? ? ? ? ? ? ? ?sub ? ?$0x1,%ebx
> ? ? ?77: ? ? ? 75 df ? ? ? ? ? ? ? ? ? jne ? ?58 <decodeplane8+0x58>
[..]
> 9067 dezicycles in decodeplane8, 32 runs, 0 skips
> 8562 dezicycles in decodeplane8, 64 runs, 0 skips
> 8318 dezicycles in decodeplane8, 128 runs, 0 skips
> 8195 dezicycles in decodeplane8, 256 runs, 0 skips
> 8132 dezicycles in decodeplane8, 512 runs, 0 skips
> 8096 dezicycles in decodeplane8, 1023 runs, 1 skips
> 8077 dezicycles in decodeplane8, 2046 runs, 2 skips
> 8070 dezicycles in decodeplane8, 4094 runs, 2 skips

That looks good to me.

Ronald



More information about the ffmpeg-devel mailing list