All pastes #1878055 Raw Edit

saintdev

public text v1 · immutable
#1878055 ·published 2010-06-06 20:25 UTC
rendered paste body
From 0072401571a08c6f84e9ec8d48d6f9921e22c652 Mon Sep 17 00:00:00 2001From: Nathan Caldwell <saintdev@gmail.com>Date: Sun, 6 Jun 2010 14:19:41 -0600Subject: [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 insertions(+), 4 deletions(-)diff --git a/common/common.h b/common/common.hindex 06b6256..0fc0e67 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.cindex 9d630f8..277dec8 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.cindex abf1659..08e3c78 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;-- 1.6.0.4