[SCM] libav/experimental: arm: Avoid using the 'setend' instruction on ARMv7 and newer

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:03:47 UTC 2014


The following commit has been merged in the experimental branch:
commit 79fce1ec8abd017593c003917fc123f7119a78d6
Author: Martin Storsjö <martin at martin.st>
Date:   Fri Jul 4 18:21:50 2014 +0300

    arm: Avoid using the 'setend' instruction on ARMv7 and newer
    
    This instruction is deprecated on ARMv8, and it is serializing on
    some ARMv7 cores as well [1].
    
    [1] http://article.gmane.org/gmane.linux.ports.arm.kernel/339293
    
    CC: libav-stable at libav.org
    Signed-off-by: Martin Storsjö <martin at martin.st>

diff --git a/libavcodec/arm/h264dsp_init_arm.c b/libavcodec/arm/h264dsp_init_arm.c
index 92658e7..f9712d8 100644
--- a/libavcodec/arm/h264dsp_init_arm.c
+++ b/libavcodec/arm/h264dsp_init_arm.c
@@ -104,8 +104,12 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (have_armv6(cpu_flags))
+    if (have_armv6(cpu_flags) && !(have_vfpv3(cpu_flags) || have_neon(cpu_flags))) {
+        // This function uses the 'setend' instruction which is deprecated
+        // on ARMv8. This instruction is serializing on some ARMv7 cores as
+        // well. Therefore, only use the function on ARMv6.
         c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
+    }
     if (have_neon(cpu_flags))
         h264dsp_init_neon(c, bit_depth, chroma_format_idc);
 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list