Merge "Skip computation of distortion in vp8_pick_inter_mode if active_map is used"
[libvpx.git] / vpx_mem / memory_manager / include / hmm_cnfg.h
blob30b9f5045e36132188245a78b86c2c7f5b2b09df
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
12 /* This code is in the public domain.
13 ** Version: 1.1 Author: Walt Karas
16 /* Configure Heap Memory Manager for processor architecture, compiler,
17 ** and desired performance characteristics. This file is included
18 ** by heapmm.h, so these definitions can be used by code external to
19 ** HMM. You can change the default configuration, and/or create alternate
20 ** configuration(s).
23 /* To allow for multiple configurations of HMM to be used in the same
24 ** compilation unit, undefine all preprocessor symbols that will be
25 ** defined below.
27 #undef HMM_ADDR_ALIGN_UNIT
28 #undef HMM_BLOCK_ALIGN_UNIT
29 #undef HMM_UNIQUE
30 #undef HMM_DESC_PARAM
31 #undef HMM_SYM_TO_STRING
32 #undef HMM_SYM_TO_STRING
33 #undef HMM_AUDIT_FAIL
35 /* Turn X into a string after one macro expansion pass of X. This trick
36 ** works with both GCC and Visual C++. */
37 #define HMM_SYM_TO_STRING(X) HMM_SYM_TO_STRING(X)
38 #define HMM_SYM_TO_STRING(X) #X
40 #ifndef HMM_CNFG_NUM
42 /* Default configuration. */
44 /* Use hmm_ prefix to avoid identifier conflicts. */
45 #define HMM_UNIQUE(BASE) hmm_ ## BASE
47 /* Number of bytes in an Address Alignment Unit (AAU). */
48 //fwg
49 //#define HMM_ADDR_ALIGN_UNIT sizeof(int)
50 #define HMM_ADDR_ALIGN_UNIT 32
52 /* Number of AAUs in a Block Alignment Unit (BAU). */
53 #define HMM_BLOCK_ALIGN_UNIT 1
55 /* Type of unsigned integer big enough to hold the size of a Block in AAUs. */
56 typedef unsigned long HMM_UNIQUE(size_aau);
58 /* Type of unsigned integer big enough to hold the size of a Block/Chunk
59 ** in BAUs. The high bit will be robbed. */
60 typedef unsigned long HMM_UNIQUE(size_bau);
62 void hmm_dflt_abort(const char *, const char *);
64 /* Actions upon a self-audit failure. Must expand to a single complete
65 ** statement. If you remove the definition of this macro, no self-auditing
66 ** will be performed. */
67 #define HMM_AUDIT_FAIL \
68 hmm_dflt_abort(__FILE__, HMM_SYM_TO_STRING(__LINE__));
70 #elif HMM_CNFG_NUM == 0
72 /* Definitions for testing. */
74 #define HMM_UNIQUE(BASE) thmm_ ## BASE
76 #define HMM_ADDR_ALIGN_UNIT sizeof(int)
78 #define HMM_BLOCK_ALIGN_UNIT 3
80 typedef unsigned HMM_UNIQUE(size_aau);
82 typedef unsigned short HMM_UNIQUE(size_bau);
84 /* Under this test setup, a long jump is done if there is a self-audit
85 ** failure.
88 extern jmp_buf HMM_UNIQUE(jmp_buf);
89 extern const char *HMM_UNIQUE(fail_file);
90 extern unsigned HMM_UNIQUE(fail_line);
92 #define HMM_AUDIT_FAIL \
93 { HMM_UNIQUE(fail_file) = __FILE__; HMM_UNIQUE(fail_line) = __LINE__; \
94 longjmp(HMM_UNIQUE(jmp_buf), 1); }
96 #elif HMM_CNFG_NUM == 1
98 /* Put configuration 1 definitions here (if there is a configuration 1). */
100 #elif HMM_CNFG_NUM == 2
102 /* Put configuration 2 definitions here. */
104 #elif HMM_CNFG_NUM == 3
106 /* Put configuration 3 definitions here. */
108 #elif HMM_CNFG_NUM == 4
110 /* Put configuration 4 definitions here. */
112 #elif HMM_CNFG_NUM == 5
114 /* Put configuration 5 definitions here. */
116 #endif