OSDN Git Service

avcenc: Fix the gcc inline assembly constraints
authorMartin Storsjo <martin@martin.st>
Fri, 13 Apr 2012 11:17:30 +0000 (14:17 +0300)
committerMartin Storsjo <martin@martin.st>
Mon, 20 Aug 2012 22:50:59 +0000 (23:50 +0100)
commit3fdb405597f0e062a9bb8af20199c5e67f0f764c
tree927a7c240a6322926289762279192c4776e7b740
parentccde1257952d2c073e51ecba6180060570ffa41f
avcenc: Fix the gcc inline assembly constraints

Use +r for registers whose value is used as input to the block.

Also switch input registers to output registers with +r, for
registers that are modified by the assembly block (SUB_SAD in
sad_inline.h).

Without this, the inline assembly fails on modern gcc versions
(tested on gcc 4.6), where the intended input value never is
loaded into the registers, causing segfaults at runtime.

Currently this assembly isn't used, but this change makes it
work properly if enabled.

Change-Id: I37c247cd5c8aff213445e31ab3bd33d8f0f37e05
media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h
media/libstagefright/codecs/avc/enc/src/sad_inline.h
media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h