From 0d0dc6a720f5a41add8989cfa29090cf48d6028f Mon Sep 17 00:00:00 2001 From: Nathan Caldwell Date: Sun, 6 Jun 2010 14:19:41 -0600 Subject: [PATCH] Deduplicate the ALIGN macro, move it to common.h --- common/common.h | 1 + common/frame.c | 2 -- common/macroblock.c | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) 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 44c579e3..d1af24c9 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 abf16596..08e3c781 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; -- 2.47.3