]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cabac.h
Support the new lossless mode.
[ffmpeg] / libavcodec / cabac.h
index b4ce2fd6c3dee4d633cd4a4e8e868c515b85a60a..e012727054e694f3a5541136adc407ed189de8e3 100644 (file)
@@ -31,9 +31,7 @@
 
 //#undef NDEBUG
 #include <assert.h>
-#ifdef ARCH_X86
 #include "libavutil/x86_cpu.h"
-#endif
 
 #define CABAC_BITS 16
 #define CABAC_MASK ((1<<CABAC_BITS)-1)
@@ -306,7 +304,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
     int temp;
 #if 0
     //P3:683    athlon:475
-    asm(
+    __asm__(
         "lea -0x100(%0), %2         \n\t"
         "shr $31, %2                \n\t"  //FIXME 31->63 for x86-64
         "shl %%cl, %0               \n\t"
@@ -315,7 +313,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
     );
 #elif 0
     //P3:680    athlon:474
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "setb %%cl                  \n\t"  //FIXME 31->63 for x86-64
         "shl %%cl, %0               \n\t"
@@ -325,7 +323,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
 #elif 1
     int temp2;
     //P3:665    athlon:517
-    asm(
+    __asm__(
         "lea -0x100(%0), %%eax      \n\t"
         "cltd                       \n\t"
         "mov %0, %%eax              \n\t"
@@ -338,7 +336,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
 #elif 0
     int temp2;
     //P3:673    athlon:509
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "sbb %%edx, %%edx           \n\t"
         "mov %0, %%eax              \n\t"
@@ -351,7 +349,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
 #else
     int temp2;
     //P3:677    athlon:511
-    asm(
+    __asm__(
         "cmp $0x100, %0             \n\t"
         "lea (%0, %0), %%eax        \n\t"
         "lea (%1, %1), %%edx        \n\t"
@@ -387,7 +385,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st
     int bit;
 
 #ifndef BRANCHLESS_CABAC_DECODER
-    asm volatile(
+    __asm__ volatile(
         "movzbl (%1), %0                        \n\t"
         "movl "RANGE    "(%2), %%ebx            \n\t"
         "movl "RANGE    "(%2), %%edx            \n\t"
@@ -526,7 +524,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st
         "add    "tmp"       , "low"                                     \n\t"\
         "1:                                                             \n\t"
 
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%2), %%esi            \n\t"
         "movl "LOW      "(%2), %%ebx            \n\t"
         BRANCHLESS_GET_CABAC("%0", "%2", "(%1)", "%%ebx", "%%bx", "%%esi", "%%edx", "%%dl")
@@ -593,7 +591,7 @@ static int av_unused get_cabac(CABACContext *c, uint8_t * const state){
 static int av_unused get_cabac_bypass(CABACContext *c){
 #if 0 //not faster
     int bit;
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%1), %%ebx            \n\t"
         "movl "LOW      "(%1), %%eax            \n\t"
         "shl $17, %%ebx                         \n\t"
@@ -640,7 +638,7 @@ static int av_unused get_cabac_bypass(CABACContext *c){
 
 static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
 #if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
-    asm volatile(
+    __asm__ volatile(
         "movl "RANGE    "(%1), %%ebx            \n\t"
         "movl "LOW      "(%1), %%eax            \n\t"
         "shl $17, %%ebx                         \n\t"