[FFmpeg-devel] [RFC] support encrypted asf

Reimar Döffinger Reimar.Doeffinger
Mon Oct 8 09:52:33 CEST 2007


Hello,
On Mon, Oct 08, 2007 at 08:30:35AM +0100, M?ns Rullg?rd wrote:
[...]
> On the strict portability side, it should be noted that your code only
> works on hardware using two's complement for negative numbers.  In
> other words, it won't work on some Cray machines.

That is of course true, though I think no consideration for FFmpeg, I'm
sure I saw that (... & -value) trick quite a few times in FFmpeg ;-)
Of course as I don't consider speed important here using a good old if()
is not problem if wanted, but on x86 that is a lot slower than doing the
multiplications ;-)

Greetings,
Reimar D?ffinger

P.S.: I found it very curious that gcc figured out that the loop would
have exactly 32 iterations but not how to use the Z flags. I think gcc
has major problems because it does not optimize the resulting asm,
which is also why a simple
uint16_t multest(uint16_t val, uint8_t m) { return val * m; }

results in this code (first argument is destination):
clr r23
movw r18,r24
mul r22,r18
movw r24,r0
mul r22,r19
add r25,r0
mul r23,r18
add r25,r0
clr r1
ret

In which we have: a useless setting r23 to 0, multiplying that 0 by
r18 and adding the result of that onto r25, IOW 30% of the
code is nops.




More information about the ffmpeg-devel mailing list