/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 "aom/aom_integer.h" |
16 | | #include "config/aom_config.h" |
17 | | |
18 | | #if defined(__uClinux__) |
19 | | #include <lddk.h> |
20 | | #endif |
21 | | |
22 | | #if defined(__cplusplus) |
23 | | extern "C" { |
24 | | #endif |
25 | | |
26 | | #ifndef AOM_MAX_ALLOCABLE_MEMORY |
27 | | #if SIZE_MAX > (1ULL << 32) |
28 | | #define AOM_MAX_ALLOCABLE_MEMORY 8589934592 // 8 GB |
29 | | #else |
30 | | // For 32-bit targets keep this below INT_MAX to avoid valgrind warnings. |
31 | | #define AOM_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16)) |
32 | | #endif |
33 | | #endif |
34 | | |
35 | | void *aom_memalign(size_t align, size_t size); |
36 | | void *aom_malloc(size_t size); |
37 | | void *aom_calloc(size_t num, size_t size); |
38 | | void aom_free(void *memblk); |
39 | | |
40 | 265M | static inline void *aom_memset16(void *dest, int val, size_t length) { |
41 | 265M | size_t i; |
42 | 265M | uint16_t *dest16 = (uint16_t *)dest; |
43 | 34.6G | for (i = 0; i < length; i++) *dest16++ = val; |
44 | 265M | return dest; |
45 | 265M | } Unexecuted instantiation: av1_dx_iface.c:aom_memset16 decodeframe.c:aom_memset16 Line | Count | Source | 40 | 11.8M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 11.8M | size_t i; | 42 | 11.8M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 204M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 11.8M | return dest; | 45 | 11.8M | } |
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 | 40 | 43.6M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 43.6M | size_t i; | 42 | 43.6M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 1.74G | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 43.6M | return dest; | 45 | 43.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 | 40 | 5.94M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 5.94M | size_t i; | 42 | 5.94M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 1.66G | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 5.94M | return dest; | 45 | 5.94M | } |
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 | 40 | 199M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 199M | size_t i; | 42 | 199M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 31.0G | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 199M | return dest; | 45 | 199M | } |
Line | Count | Source | 40 | 3.01M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 3.01M | size_t i; | 42 | 3.01M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 18.0M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 3.01M | return dest; | 45 | 3.01M | } |
restoration.c:aom_memset16 Line | Count | Source | 40 | 848k | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 848k | size_t i; | 42 | 848k | uint16_t *dest16 = (uint16_t *)dest; | 43 | 4.24M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 848k | return dest; | 45 | 848k | } |
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 |
46 | | |
47 | | /*returns an addr aligned to the byte boundary specified by align*/ |
48 | | #define aom_align_addr(addr, align) \ |
49 | 5.72M | (void *)(((uintptr_t)(addr) + ((align)-1)) & ~(uintptr_t)((align)-1)) |
50 | | |
51 | | #include <string.h> |
52 | | |
53 | | #ifdef AOM_MEM_PLTFRM |
54 | | #include AOM_MEM_PLTFRM |
55 | | #endif |
56 | | |
57 | | #if CONFIG_DEBUG |
58 | | #define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ |
59 | | do { \ |
60 | | lval = (expr); \ |
61 | | if (!lval) \ |
62 | | aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ |
63 | | "Failed to allocate " #lval " at %s:%d", __FILE__, \ |
64 | | __LINE__); \ |
65 | | } while (0) |
66 | | #else |
67 | | #define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ |
68 | 2.12M | do { \ |
69 | 2.12M | lval = (expr); \ |
70 | 2.12M | if (!lval) \ |
71 | 2.12M | aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ |
72 | 5 | "Failed to allocate " #lval); \ |
73 | 2.12M | } while (0) |
74 | | #endif |
75 | | |
76 | | #if defined(__cplusplus) |
77 | | } |
78 | | #endif |
79 | | |
80 | | #endif // AOM_AOM_MEM_AOM_MEM_H_ |