[FFmpeg-cvslog] h264: use struct offsets in get_cabac_bypass_sign_x86().

Ronald S. Bultje git at videolan.org
Sat Apr 21 23:00:11 CEST 2012


ffmpeg | branch: release/0.10 | Ronald S. Bultje <rsbultje at gmail.com> | Fri Mar 16 22:41:17 2012 -0700| [265a628f162168f188f9756a06727a4ec41a183d] | committer: Carl Eugen Hoyos

h264: use struct offsets in get_cabac_bypass_sign_x86().
(cherry picked from commit db025929f202bc32459a1278ee06920a06564762)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=265a628f162168f188f9756a06727a4ec41a183d
---

 libavcodec/x86/cabac.h |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index 2bb0be6..edcd34a 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -107,8 +107,8 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
 {
     x86_reg tmp;
     __asm__ volatile(
-        "movl %4, %k1                           \n\t"
-        "movl %2, %%eax                         \n\t"
+        "movl %a5(%2), %k1                      \n\t"
+        "movl %a3(%2), %%eax                    \n\t"
         "shl $17, %k1                           \n\t"
         "add %%eax, %%eax                       \n\t"
         "sub %k1, %%eax                         \n\t"
@@ -119,20 +119,23 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
         "sub %%edx, %%ecx                       \n\t"
         "test %%ax, %%ax                        \n\t"
         " jnz 1f                                \n\t"
-        "mov  %3, %1                            \n\t"
+        "mov  %a4(%2), %1                       \n\t"
         "subl $0xFFFF, %%eax                    \n\t"
         "movzwl (%1), %%edx                     \n\t"
         "bswap %%edx                            \n\t"
         "shrl $15, %%edx                        \n\t"
         "add  $2, %1                            \n\t"
         "addl %%edx, %%eax                      \n\t"
-        "mov  %1, %3                            \n\t"
+        "mov  %1, %a4(%2)                       \n\t"
         "1:                                     \n\t"
-        "movl %%eax, %2                         \n\t"
+        "movl %%eax, %a3(%2)                    \n\t"
 
-        :"+c"(val), "=&r"(tmp), "+m"(c->low), "+m"(c->bytestream)
-        :"m"(c->range)
-        : "%eax", "%edx"
+        : "+c"(val), "=&r"(tmp)
+        : "r"(c),
+          "i"(offsetof(CABACContext, low)),
+          "i"(offsetof(CABACContext, bytestream)),
+          "i"(offsetof(CABACContext, range))
+        : "%eax", "%edx", "memory"
     );
     return val;
 }



More information about the ffmpeg-cvslog mailing list