/src/aom/aom_mem/aom_mem.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2016, Alliance for Open Media. All rights reserved. |
3 | | * |
4 | | * This source code is subject to the terms of the BSD 2 Clause License and |
5 | | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
6 | | * was not distributed with this source code in the LICENSE file, you can |
7 | | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
8 | | * Media Patent License 1.0 was not distributed with this source code in the |
9 | | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
10 | | */ |
11 | | |
12 | | #ifndef AOM_AOM_MEM_AOM_MEM_H_ |
13 | | #define AOM_AOM_MEM_AOM_MEM_H_ |
14 | | |
15 | | #include <assert.h> |
16 | | |
17 | | #include "aom/aom_integer.h" |
18 | | #include "config/aom_config.h" |
19 | | |
20 | | #if defined(__uClinux__) |
21 | | #include <lddk.h> |
22 | | #endif |
23 | | |
24 | | #if defined(__cplusplus) |
25 | | extern "C" { |
26 | | #endif |
27 | | |
28 | | #ifndef AOM_MAX_ALLOCABLE_MEMORY |
29 | | #if SIZE_MAX > (1ULL << 32) |
30 | | #define AOM_MAX_ALLOCABLE_MEMORY 8589934592 // 8 GB |
31 | | #else |
32 | | // For 32-bit targets keep this below INT_MAX to avoid valgrind warnings. |
33 | | #define AOM_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16)) |
34 | | #endif |
35 | | #endif |
36 | | |
37 | | void *aom_memalign(size_t align, size_t size); |
38 | | void *aom_malloc(size_t size); |
39 | | void *aom_calloc(size_t num, size_t size); |
40 | | void aom_free(void *memblk); |
41 | | |
42 | 186M | static inline void *aom_memset16(void *dest, int val, size_t length) { |
43 | 186M | size_t i; |
44 | 186M | uint16_t *dest16 = (uint16_t *)dest; |
45 | 23.1G | for (i = 0; i < length; i++) *dest16++ = val; |
46 | 186M | return dest; |
47 | 186M | } Unexecuted instantiation: av1_dx_iface.c:aom_memset16 decodeframe.c:aom_memset16 Line | Count | Source | 42 | 13.6M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 13.6M | size_t i; | 44 | 13.6M | uint16_t *dest16 = (uint16_t *)dest; | 45 | 248M | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 13.6M | return dest; | 47 | 13.6M | } |
Unexecuted instantiation: decodemv.c:aom_memset16 Unexecuted instantiation: decoder.c:aom_memset16 Unexecuted instantiation: decodetxb.c:aom_memset16 Unexecuted instantiation: detokenize.c:aom_memset16 Unexecuted instantiation: grain_synthesis.c:aom_memset16 Unexecuted instantiation: obu.c:aom_memset16 Unexecuted instantiation: aom_image.c:aom_memset16 Unexecuted instantiation: aom_dsp_rtcd.c:aom_memset16 Unexecuted instantiation: av1_rtcd.c:aom_memset16 Unexecuted instantiation: aom_convolve.c:aom_memset16 Unexecuted instantiation: blend_a64_hmask.c:aom_memset16 Unexecuted instantiation: blend_a64_mask.c:aom_memset16 Unexecuted instantiation: blend_a64_vmask.c:aom_memset16 Line | Count | Source | 42 | 35.6M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 35.6M | size_t i; | 44 | 35.6M | uint16_t *dest16 = (uint16_t *)dest; | 45 | 1.41G | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 35.6M | return dest; | 47 | 35.6M | } |
Unexecuted instantiation: aom_convolve_copy_sse2.c:aom_memset16 Unexecuted instantiation: intrapred_sse2.c:aom_memset16 Unexecuted instantiation: loopfilter_sse2.c:aom_memset16 Unexecuted instantiation: highbd_convolve_sse2.c:aom_memset16 Unexecuted instantiation: highbd_loopfilter_sse2.c:aom_memset16 Unexecuted instantiation: aom_subpixel_8t_intrin_ssse3.c:aom_memset16 Unexecuted instantiation: intrapred_ssse3.c:aom_memset16 Unexecuted instantiation: highbd_convolve_ssse3.c:aom_memset16 Unexecuted instantiation: blend_a64_hmask_sse4.c:aom_memset16 Unexecuted instantiation: blend_a64_mask_sse4.c:aom_memset16 Unexecuted instantiation: blend_a64_vmask_sse4.c:aom_memset16 Unexecuted instantiation: intrapred_sse4.c:aom_memset16 Unexecuted instantiation: aom_convolve_copy_avx2.c:aom_memset16 Unexecuted instantiation: aom_subpixel_8t_intrin_avx2.c:aom_memset16 Unexecuted instantiation: intrapred_avx2.c:aom_memset16 Unexecuted instantiation: loopfilter_avx2.c:aom_memset16 Unexecuted instantiation: blend_a64_mask_avx2.c:aom_memset16 Unexecuted instantiation: highbd_convolve_avx2.c:aom_memset16 Unexecuted instantiation: highbd_loopfilter_avx2.c:aom_memset16 Unexecuted instantiation: aom_mem.c:aom_memset16 Unexecuted instantiation: aom_thread.c:aom_memset16 Unexecuted instantiation: yv12config.c:aom_memset16 yv12extend.c:aom_memset16 Line | Count | Source | 42 | 4.52M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 4.52M | size_t i; | 44 | 4.52M | uint16_t *dest16 = (uint16_t *)dest; | 45 | 1.30G | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 4.52M | return dest; | 47 | 4.52M | } |
Unexecuted instantiation: alloccommon.c:aom_memset16 Unexecuted instantiation: av1_inv_txfm2d.c:aom_memset16 Unexecuted instantiation: av1_loopfilter.c:aom_memset16 Unexecuted instantiation: av1_txfm.c:aom_memset16 Unexecuted instantiation: blockd.c:aom_memset16 Unexecuted instantiation: cdef.c:aom_memset16 Unexecuted instantiation: cdef_block.c:aom_memset16 Unexecuted instantiation: cfl.c:aom_memset16 Unexecuted instantiation: convolve.c:aom_memset16 Unexecuted instantiation: entropy.c:aom_memset16 Unexecuted instantiation: entropymode.c:aom_memset16 Unexecuted instantiation: entropymv.c:aom_memset16 Unexecuted instantiation: frame_buffers.c:aom_memset16 Unexecuted instantiation: idct.c:aom_memset16 Unexecuted instantiation: mvref_common.c:aom_memset16 Unexecuted instantiation: pred_common.c:aom_memset16 Unexecuted instantiation: quant_common.c:aom_memset16 Unexecuted instantiation: reconinter.c:aom_memset16 reconintra.c:aom_memset16 Line | Count | Source | 42 | 130M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 130M | size_t i; | 44 | 130M | uint16_t *dest16 = (uint16_t *)dest; | 45 | 20.2G | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 130M | return dest; | 47 | 130M | } |
Line | Count | Source | 42 | 2.29M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 2.29M | size_t i; | 44 | 2.29M | uint16_t *dest16 = (uint16_t *)dest; | 45 | 13.7M | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 2.29M | return dest; | 47 | 2.29M | } |
restoration.c:aom_memset16 Line | Count | Source | 42 | 523k | static inline void *aom_memset16(void *dest, int val, size_t length) { | 43 | 523k | size_t i; | 44 | 523k | uint16_t *dest16 = (uint16_t *)dest; | 45 | 2.61M | for (i = 0; i < length; i++) *dest16++ = val; | 46 | 523k | return dest; | 47 | 523k | } |
Unexecuted instantiation: scale.c:aom_memset16 Unexecuted instantiation: scan.c:aom_memset16 Unexecuted instantiation: seg_common.c:aom_memset16 Unexecuted instantiation: thread_common.c:aom_memset16 Unexecuted instantiation: tile_common.c:aom_memset16 Unexecuted instantiation: txb_common.c:aom_memset16 Unexecuted instantiation: warped_motion.c:aom_memset16 Unexecuted instantiation: cfl_sse2.c:aom_memset16 Unexecuted instantiation: convolve_2d_sse2.c:aom_memset16 Unexecuted instantiation: convolve_sse2.c:aom_memset16 Unexecuted instantiation: jnt_convolve_sse2.c:aom_memset16 Unexecuted instantiation: resize_sse2.c:aom_memset16 Unexecuted instantiation: wiener_convolve_sse2.c:aom_memset16 Unexecuted instantiation: av1_inv_txfm_ssse3.c:aom_memset16 Unexecuted instantiation: cfl_ssse3.c:aom_memset16 Unexecuted instantiation: jnt_convolve_ssse3.c:aom_memset16 Unexecuted instantiation: resize_ssse3.c:aom_memset16 Unexecuted instantiation: highbd_convolve_2d_ssse3.c:aom_memset16 Unexecuted instantiation: highbd_wiener_convolve_ssse3.c:aom_memset16 Unexecuted instantiation: reconinter_ssse3.c:aom_memset16 Unexecuted instantiation: av1_convolve_horiz_rs_sse4.c:aom_memset16 Unexecuted instantiation: av1_convolve_scale_sse4.c:aom_memset16 Unexecuted instantiation: av1_txfm_sse4.c:aom_memset16 Unexecuted instantiation: cdef_block_sse4.c:aom_memset16 Unexecuted instantiation: filterintra_sse4.c:aom_memset16 Unexecuted instantiation: highbd_inv_txfm_sse4.c:aom_memset16 Unexecuted instantiation: intra_edge_sse4.c:aom_memset16 Unexecuted instantiation: reconinter_sse4.c:aom_memset16 Unexecuted instantiation: selfguided_sse4.c:aom_memset16 Unexecuted instantiation: warp_plane_sse4.c:aom_memset16 Unexecuted instantiation: highbd_convolve_2d_sse4.c:aom_memset16 Unexecuted instantiation: highbd_jnt_convolve_sse4.c:aom_memset16 Unexecuted instantiation: highbd_warp_plane_sse4.c:aom_memset16 Unexecuted instantiation: av1_inv_txfm_avx2.c:aom_memset16 Unexecuted instantiation: cdef_block_avx2.c:aom_memset16 Unexecuted instantiation: cfl_avx2.c:aom_memset16 Unexecuted instantiation: convolve_2d_avx2.c:aom_memset16 Unexecuted instantiation: convolve_avx2.c:aom_memset16 Unexecuted instantiation: highbd_inv_txfm_avx2.c:aom_memset16 Unexecuted instantiation: jnt_convolve_avx2.c:aom_memset16 Unexecuted instantiation: reconinter_avx2.c:aom_memset16 Unexecuted instantiation: resize_avx2.c:aom_memset16 Unexecuted instantiation: selfguided_avx2.c:aom_memset16 Unexecuted instantiation: warp_plane_avx2.c:aom_memset16 Unexecuted instantiation: wiener_convolve_avx2.c:aom_memset16 Unexecuted instantiation: highbd_convolve_2d_avx2.c:aom_memset16 Unexecuted instantiation: highbd_jnt_convolve_avx2.c:aom_memset16 Unexecuted instantiation: highbd_wiener_convolve_avx2.c:aom_memset16 Unexecuted instantiation: highbd_warp_affine_avx2.c:aom_memset16 Unexecuted instantiation: highbd_intrapred_sse2.c:aom_memset16 Unexecuted instantiation: av1_inv_txfm1d.c:aom_memset16 |
48 | | |
49 | | /*returns an addr aligned to the byte boundary specified by align*/ |
50 | | #define aom_align_addr(addr, align) \ |
51 | 4.44M | (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1)) |
52 | | |
53 | | #include <string.h> |
54 | | |
55 | | #ifdef AOM_MEM_PLTFRM |
56 | | #include AOM_MEM_PLTFRM |
57 | | #endif |
58 | | |
59 | | #if CONFIG_DEBUG |
60 | | #define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ |
61 | | do { \ |
62 | | assert((error_info)->setjmp); \ |
63 | | lval = (expr); \ |
64 | | if (!lval) \ |
65 | | aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ |
66 | | "Failed to allocate " #lval " at %s:%d", __FILE__, \ |
67 | | __LINE__); \ |
68 | | } while (0) |
69 | | #else |
70 | | #define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ |
71 | 1.69M | do { \ |
72 | 1.69M | assert((error_info)->setjmp); \ |
73 | 1.69M | lval = (expr); \ |
74 | 1.69M | if (!lval) \ |
75 | 1.69M | aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ |
76 | 1 | "Failed to allocate " #lval); \ |
77 | 1.69M | } while (0) |
78 | | #endif |
79 | | |
80 | | #if defined(__cplusplus) |
81 | | } |
82 | | #endif |
83 | | |
84 | | #endif // AOM_AOM_MEM_AOM_MEM_H_ |