Commit 4f5d9bce authored by saintdev's avatar saintdev Committed by Fiona Glaser
Browse files

Deduplicate the ALIGN macro, move it to common.h

parent e02e3eb5
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define XCHG(type,a,b) do{ type t = a; a = b; b = t; } while(0) #define XCHG(type,a,b) do{ type t = a; a = b; b = t; } while(0)
#define IS_DISPOSABLE(type) ( type == X264_TYPE_B ) #define IS_DISPOSABLE(type) ( type == X264_TYPE_B )
#define FIX8(f) ((int)(f*(1<<8)+.5)) #define FIX8(f) ((int)(f*(1<<8)+.5))
#define ALIGN(x,a) (((x)+((a)-1))&~((a)-1))
#define CHECKED_MALLOC( var, size )\ #define CHECKED_MALLOC( var, size )\
do {\ do {\
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include "common.h" #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 *x264_frame_new( x264_t *h, int b_fdec )
{ {
x264_frame_t *frame; x264_frame_t *frame;
......
...@@ -257,7 +257,6 @@ int x264_macroblock_cache_allocate( x264_t *h ) ...@@ -257,7 +257,6 @@ int x264_macroblock_cache_allocate( x264_t *h )
if( h->param.analyse.i_weighted_pred ) if( h->param.analyse.i_weighted_pred )
{ {
int i_padv = PADV << h->param.b_interlaced; 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 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 i_stride, luma_plane_size = 0;
int numweightbuf; int numweightbuf;
...@@ -291,7 +290,6 @@ int x264_macroblock_cache_allocate( x264_t *h ) ...@@ -291,7 +290,6 @@ int x264_macroblock_cache_allocate( x264_t *h )
for( int i = 0; i < numweightbuf; i++ ) for( int i = 0; i < numweightbuf; i++ )
CHECKED_MALLOC( h->mb.p_weight_buf[i], luma_plane_size * sizeof(pixel) ); CHECKED_MALLOC( h->mb.p_weight_buf[i], luma_plane_size * sizeof(pixel) );
#undef ALIGN
} }
return 0; return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment