[FFmpeg-devel] [PATCH] manually hacked configure options increase h264 decoding speed significantly

Laurent laurent.aml at gmail.com
Wed Feb 8 20:07:13 CET 2012


On Wed, Feb 8, 2012 at 1:46 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Feb 08, 2012 at 01:33:58PM -0500, Laurent wrote:
>> On Fri, Oct 21, 2011 at 7:33 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Sat, Oct 22, 2011 at 12:34:25AM +0200, Hendrik Leppkes wrote:
>> >> Hi,
>> >>
>> >> On Sat, Oct 22, 2011 at 12:15 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> >> > please try attached patch and check if it enables ebp
>>
>> With MinGW GCC 4.6.2, the function gets inlined with -O3 so you are
>> back in square 1.
>>
>> I am no gcc expert, but adding a "noinline" attribute works for me:
>>
>> __attribute__ ((noinline)) int func(void) {
>
> that would break compilation on non gcc

Thanks to stackoverflow: using a function pointer works too.

diff --git a/configure b/configure
index eb65caf..dcff9c0 100755
--- a/configure
+++ b/configure
@@ -866,6 +866,7 @@ static void sighandler(int sig){
 int func(void){
     $code
 }
+int (*func_ptr)(void) = func;
 int main(void){
     signal(SIGILL, sighandler);
     signal(SIGFPE, sighandler);
@@ -873,7 +874,7 @@ int main(void){
 #ifdef SIGBUS
     signal(SIGBUS, sighandler);
 #endif
-    return func();
+    return func_ptr();
 }
 EOF
 }

Thanks,

-- Laurent


More information about the ffmpeg-devel mailing list