~siretart/x264/trunk

« back to all changes in this revision

Viewing changes to common/common.h

  • Committer: Henrik Gramner
  • Author(s): Anton Mitrofanov
  • Date: 2016-12-01 17:00:07 UTC
  • Revision ID: git-v1:b2b39dae0bd891c8d150b4f4c3a2a24d8d6c1431
Cosmetics

Also make x264_weighted_reference_duplicate() static.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#define X264_MAX3(a,b,c) X264_MAX((a),X264_MAX((b),(c)))
37
37
#define X264_MIN4(a,b,c,d) X264_MIN((a),X264_MIN3((b),(c),(d)))
38
38
#define X264_MAX4(a,b,c,d) X264_MAX((a),X264_MAX3((b),(c),(d)))
39
 
#define XCHG(type,a,b) do{ type t = a; a = b; b = t; } while(0)
 
39
#define XCHG(type,a,b) do { type t = a; a = b; b = t; } while( 0 )
40
40
#define IS_DISPOSABLE(type) ( type == X264_TYPE_B )
41
41
#define FIX8(f) ((int)(f*(1<<8)+.5))
42
42
#define ALIGN(x,a) (((x)+((a)-1))&~((a)-1))
70
70
    var = (void*)prealloc_size;\
71
71
    preallocs[prealloc_idx++] = (uint8_t**)&var;\
72
72
    prealloc_size += ALIGN(size, NATIVE_ALIGN);\
73
 
} while(0)
 
73
} while( 0 )
74
74
 
75
75
#define PREALLOC_END( ptr )\
76
76
do {\
77
77
    CHECKED_MALLOC( ptr, prealloc_size );\
78
78
    while( prealloc_idx-- )\
79
79
        *preallocs[prealloc_idx] += (intptr_t)ptr;\
80
 
} while(0)
 
80
} while( 0 )
81
81
 
82
82
#define ARRAY_SIZE(array)  (sizeof(array)/sizeof(array[0]))
83
83