changeset 11544:0eb476c1730d libavcodec

h264: Use + instead of | in some places 6 insns less on x86-64/gcc 4.2.
author astrange
date Fri, 26 Mar 2010 05:04:03 +0000
parents 965eca23972e
children c7084c69abcc
files h264_cabac.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/h264_cabac.c	Fri Mar 26 04:12:28 2010 +0000
+++ b/h264_cabac.c	Fri Mar 26 05:04:03 2010 +0000
@@ -827,13 +827,13 @@
     cbp_b = h->top_cbp;
 
     ctx = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04);
-    cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]);
+    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]);
     ctx = !(cbp   & 0x01) + 2 * !(cbp_b & 0x08);
-    cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 1;
+    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 1;
     ctx = !(cbp_a & 0x08) + 2 * !(cbp   & 0x01);
-    cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 2;
+    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 2;
     ctx = !(cbp   & 0x04) + 2 * !(cbp   & 0x02);
-    cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 3;
+    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 3;
     return cbp;
 }
 static int decode_cabac_mb_cbp_chroma( H264Context *h) {
@@ -1244,9 +1244,9 @@
         }else{
             int bits;
             bits = get_cabac_noinline( &h->cabac, &h->cabac_state[27+4] ) << 3;
-            bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2;
-            bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1;
-            bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
+            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2;
+            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1;
+            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
             if( bits < 8 ){
                 mb_type= bits + 3; /* B_Bi_16x16 through B_L1_L0_16x8 */
             }else if( bits == 13 ){
@@ -1257,7 +1257,7 @@
             }else if( bits == 15 ){
                 mb_type= 22; /* B_8x8 */
             }else{
-                bits= ( bits<<1 ) | get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
+                bits= ( bits<<1 ) + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
                 mb_type= bits - 4; /* B_L0_Bi_* through B_Bi_Bi_* */
             }
         }