[x264-devel] commit: cosmetics (Loren Merritt )

git version control git at videolan.org
Sun Oct 25 23:21:30 CET 2009


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Sun Oct 25 19:34:12 2009 +0000| [ec46ace7eab97cbde6fd50ae18de5c6e063fe1de] | committer: Loren Merritt 

cosmetics

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=ec46ace7eab97cbde6fd50ae18de5c6e063fe1de
---

 common/set.c           |    2 +-
 common/x86/x86inc.asm  |   14 +++++++-------
 common/x86/x86util.asm |    3 +++
 encoder/ratecontrol.c  |    2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/common/set.c b/common/set.c
index 24970be..a7bca7d 100644
--- a/common/set.c
+++ b/common/set.c
@@ -20,7 +20,7 @@
 
 #include "common.h"
 
-#define SHIFT(x,s) ((s)<0 ? (x)<<-(s) : (s)==0 ? (x) : ((x)+(1<<((s)-1)))>>(s))
+#define SHIFT(x,s) ((s)<=0 ? (x)<<-(s) : ((x)+(1<<((s)-1)))>>(s))
 #define DIV(n,d) (((n) + ((d)>>1)) / (d))
 
 static const int dequant4_scale[6][3] =
diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index 93ef3f1..d42f4f3 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -400,7 +400,7 @@ DECLARE_REG 6, ebp, ebp, bp, null, [esp + stack_offset + 28]
     %endif
 %endmacro
 
-%macro PROLOGUE 2-4+ ; #args, #regs, arg_names...
+%macro PROLOGUE 2-4+ ; #args, #regs, #xmm_regs, arg_names...
     ASSERT %2 >= %1
     %assign regs_used %2
     ASSERT regs_used <= 7
@@ -477,9 +477,6 @@ DECLARE_REG 6, ebp, ebp, bp, null, [esp + stack_offset + 28]
 SECTION .note.GNU-stack noalloc noexec nowrite progbits
 %endif
 
-%assign FENC_STRIDE 16
-%assign FDEC_STRIDE 32
-
 ; merge mmx and sse*
 
 %macro CAT_XDEFINE 3
@@ -586,7 +583,10 @@ INIT_MMX
 %endrep
 %endmacro
 
-%macro SAVE_MM_PERMUTATION 1
+; If SAVE_MM_PERMUTATION is placed at the end of a function and given the
+; function name, then any later calls to that function will automatically
+; load the permutation, so values can be returned in mmregs.
+%macro SAVE_MM_PERMUTATION 1 ; name to save as
     %assign %%i 0
     %rep num_mmregs
     CAT_XDEFINE %1_m, %%i, m %+ %%i
@@ -594,7 +594,7 @@ INIT_MMX
     %endrep
 %endmacro
 
-%macro LOAD_MM_PERMUTATION 1
+%macro LOAD_MM_PERMUTATION 1 ; name to load from
     %assign %%i 0
     %rep num_mmregs
     CAT_XDEFINE m, %%i, %1_m %+ %%i
@@ -610,7 +610,7 @@ INIT_MMX
     %endif
 %endmacro
 
-;Substitutions that reduce instruction size but are functionally equivalent
+; Substitutions that reduce instruction size but are functionally equivalent
 %macro add 2
     %ifnum %2
         %if %2==128
diff --git a/common/x86/x86util.asm b/common/x86/x86util.asm
index be010e5..b822688 100644
--- a/common/x86/x86util.asm
+++ b/common/x86/x86util.asm
@@ -21,6 +21,9 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
 ;*****************************************************************************
 
+%assign FENC_STRIDE 16
+%assign FDEC_STRIDE 32
+
 %macro SBUTTERFLY 4
     mova      m%4, m%2
     punpckl%1 m%2, m%3
diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index e361028..817802b 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -730,7 +730,7 @@ parse_error:
         if( i )
         {
             rc[i] = rc[0];
-            memcpy( &h->thread[i]->param, &h->param, sizeof(x264_param_t) );
+            h->thread[i]->param = h->param;
             h->thread[i]->mb.b_variable_qp = h->mb.b_variable_qp;
         }
     }



More information about the x264-devel mailing list