From: Loren Merritt Date: Sun, 25 Oct 2009 19:34:12 +0000 (+0000) Subject: cosmetics X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d947f151e09a8c412c23b2d0800a0570d6fe6287;p=libx264 cosmetics --- diff --git a/common/set.c b/common/set.c index 24970be1..a7bca7db 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 93ef3f10..d42f4f38 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 be010e5c..b822688b 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 8953084e..1577af1c 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; } }