From: Nathan Caldwell Date: Sun, 6 Jun 2010 20:19:41 +0000 (-0600) Subject: Deduplicate the ALIGN macro, move it to common.h X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f5d9bcea757f049c1a14dd902c4af76dee231c1;p=libx264 Deduplicate the ALIGN macro, move it to common.h --- diff --git a/common/common.h b/common/common.h index 06b6256c..0fc0e67b 100644 --- a/common/common.h +++ b/common/common.h @@ -36,6 +36,7 @@ #define XCHG(type,a,b) do{ type t = a; a = b; b = t; } while(0) #define IS_DISPOSABLE(type) ( type == X264_TYPE_B ) #define FIX8(f) ((int)(f*(1<<8)+.5)) +#define ALIGN(x,a) (((x)+((a)-1))&~((a)-1)) #define CHECKED_MALLOC( var, size )\ do {\ diff --git a/common/frame.c b/common/frame.c index 90a8aceb..b589266f 100644 --- a/common/frame.c +++ b/common/frame.c @@ -24,8 +24,6 @@ #include "common.h" -#define ALIGN(x,a) (((x)+((a)-1))&~((a)-1)) - x264_frame_t *x264_frame_new( x264_t *h, int b_fdec ) { x264_frame_t *frame; diff --git a/common/macroblock.c b/common/macroblock.c index 1f4ae433..71cd1cb6 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -257,7 +257,6 @@ int x264_macroblock_cache_allocate( x264_t *h ) if( h->param.analyse.i_weighted_pred ) { int i_padv = PADV << h->param.b_interlaced; -#define ALIGN(x,a) (((x)+((a)-1))&~((a)-1)) int align = h->param.cpu&X264_CPU_CACHELINE_64 ? 64 : h->param.cpu&X264_CPU_CACHELINE_32 ? 32 : 16; int i_stride, luma_plane_size = 0; int numweightbuf; @@ -291,7 +290,6 @@ int x264_macroblock_cache_allocate( x264_t *h ) for( int i = 0; i < numweightbuf; i++ ) CHECKED_MALLOC( h->mb.p_weight_buf[i], luma_plane_size * sizeof(pixel) ); -#undef ALIGN } return 0;