/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 | 93.7M | static inline void *aom_memset16(void *dest, int val, size_t length) { |
41 | 93.7M | size_t i; |
42 | 93.7M | uint16_t *dest16 = (uint16_t *)dest; |
43 | 7.54G | for (i = 0; i < length; i++) *dest16++ = val; |
44 | 93.7M | return dest; |
45 | 93.7M | } Unexecuted instantiation: aom_image.c:aom_memset16 Unexecuted instantiation: aom_mem.c:aom_memset16 Unexecuted instantiation: av1_dx_iface.c:aom_memset16 decodeframe.c:aom_memset16 Line | Count | Source | 40 | 1.21M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 1.21M | size_t i; | 42 | 1.21M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 9.04M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 1.21M | return dest; | 45 | 1.21M | } |
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: av1_cx_iface.c:aom_memset16 Unexecuted instantiation: allintra_vis.c:aom_memset16 Unexecuted instantiation: av1_quantize.c:aom_memset16 Unexecuted instantiation: bitstream.c:aom_memset16 Unexecuted instantiation: context_tree.c:aom_memset16 Unexecuted instantiation: encodeframe.c:aom_memset16 Unexecuted instantiation: encodeframe_utils.c:aom_memset16 Unexecuted instantiation: encodemb.c:aom_memset16 Unexecuted instantiation: encodemv.c:aom_memset16 Unexecuted instantiation: encoder.c:aom_memset16 Unexecuted instantiation: encoder_utils.c:aom_memset16 Unexecuted instantiation: encodetxb.c:aom_memset16 Unexecuted instantiation: ethread.c:aom_memset16 Unexecuted instantiation: external_partition.c:aom_memset16 Unexecuted instantiation: firstpass.c:aom_memset16 Unexecuted instantiation: global_motion_facade.c:aom_memset16 Unexecuted instantiation: hash.c:aom_memset16 Unexecuted instantiation: hash_motion.c:aom_memset16 Unexecuted instantiation: hybrid_fwd_txfm.c:aom_memset16 Unexecuted instantiation: level.c:aom_memset16 Unexecuted instantiation: lookahead.c:aom_memset16 Unexecuted instantiation: mcomp.c:aom_memset16 Unexecuted instantiation: mv_prec.c:aom_memset16 Unexecuted instantiation: palette.c:aom_memset16 Unexecuted instantiation: partition_search.c:aom_memset16 Unexecuted instantiation: partition_strategy.c:aom_memset16 Unexecuted instantiation: pass2_strategy.c:aom_memset16 Unexecuted instantiation: pickcdef.c:aom_memset16 Unexecuted instantiation: picklpf.c:aom_memset16 Unexecuted instantiation: pickrst.c:aom_memset16 Unexecuted instantiation: ratectrl.c:aom_memset16 Unexecuted instantiation: rd.c:aom_memset16 Unexecuted instantiation: rdopt.c:aom_memset16 Unexecuted instantiation: nonrd_pickmode.c:aom_memset16 Unexecuted instantiation: nonrd_opt.c:aom_memset16 Unexecuted instantiation: reconinter_enc.c:aom_memset16 Unexecuted instantiation: segmentation.c:aom_memset16 Unexecuted instantiation: speed_features.c:aom_memset16 Unexecuted instantiation: superres_scale.c:aom_memset16 Unexecuted instantiation: svc_layercontext.c:aom_memset16 Unexecuted instantiation: temporal_filter.c:aom_memset16 Unexecuted instantiation: tokenize.c:aom_memset16 Unexecuted instantiation: tpl_model.c:aom_memset16 Unexecuted instantiation: tx_search.c:aom_memset16 Unexecuted instantiation: txb_rdopt.c:aom_memset16 Unexecuted instantiation: intra_mode_search.c:aom_memset16 Unexecuted instantiation: var_based_part.c:aom_memset16 Unexecuted instantiation: av1_noise_estimate.c:aom_memset16 Unexecuted instantiation: dwt.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_mask.c:aom_memset16 Unexecuted instantiation: avg.c:aom_memset16 Unexecuted instantiation: blk_sse_sum.c:aom_memset16 Unexecuted instantiation: fwd_txfm.c:aom_memset16 Unexecuted instantiation: psnr.c:aom_memset16 Unexecuted instantiation: quantize.c:aom_memset16 Unexecuted instantiation: sad.c:aom_memset16 Unexecuted instantiation: sad_av1.c:aom_memset16 Unexecuted instantiation: subtract.c:aom_memset16 Unexecuted instantiation: sse.c:aom_memset16 Unexecuted instantiation: sum_squares.c:aom_memset16 Unexecuted instantiation: variance.c:aom_memset16 Unexecuted instantiation: pyramid.c:aom_memset16 Unexecuted instantiation: corner_detect.c:aom_memset16 Unexecuted instantiation: grain_table.c:aom_memset16 Unexecuted instantiation: noise_model.c:aom_memset16 Unexecuted instantiation: noise_util.c:aom_memset16 Unexecuted instantiation: aom_thread.c:aom_memset16 Unexecuted instantiation: yv12config.c:aom_memset16 yv12extend.c:aom_memset16 Line | Count | Source | 40 | 15.8M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 15.8M | size_t i; | 42 | 15.8M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 3.79G | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 15.8M | return dest; | 45 | 15.8M | } |
Unexecuted instantiation: alloccommon.c:aom_memset16 Unexecuted instantiation: av1_loopfilter.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: debugmodes.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 | 19.8M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 19.8M | size_t i; | 42 | 19.8M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 2.79G | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 19.8M | return dest; | 45 | 19.8M | } |
Line | Count | Source | 40 | 8.33M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 8.33M | size_t i; | 42 | 8.33M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 50.0M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 8.33M | return dest; | 45 | 8.33M | } |
restoration.c:aom_memset16 Line | Count | Source | 40 | 515k | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 515k | size_t i; | 42 | 515k | uint16_t *dest16 = (uint16_t *)dest; | 43 | 2.57M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 515k | return dest; | 45 | 515k | } |
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: aq_complexity.c:aom_memset16 Unexecuted instantiation: aq_cyclicrefresh.c:aom_memset16 Unexecuted instantiation: aq_variance.c:aom_memset16 Unexecuted instantiation: av1_fwd_txfm2d.c:aom_memset16 Unexecuted instantiation: cnn.c:aom_memset16 Unexecuted instantiation: compound_type.c:aom_memset16 Unexecuted instantiation: cost.c:aom_memset16 Unexecuted instantiation: encode_strategy.c:aom_memset16 Unexecuted instantiation: extend.c:aom_memset16 Unexecuted instantiation: global_motion.c:aom_memset16 Unexecuted instantiation: gop_structure.c:aom_memset16 Unexecuted instantiation: interp_search.c:aom_memset16 Unexecuted instantiation: ml.c:aom_memset16 Unexecuted instantiation: motion_search_facade.c:aom_memset16 Unexecuted instantiation: wedge_utils.c:aom_memset16 Unexecuted instantiation: blend_a64_hmask.c:aom_memset16 Unexecuted instantiation: blend_a64_vmask.c:aom_memset16 Line | Count | Source | 40 | 47.9M | static inline void *aom_memset16(void *dest, int val, size_t length) { | 41 | 47.9M | size_t i; | 42 | 47.9M | uint16_t *dest16 = (uint16_t *)dest; | 43 | 892M | for (i = 0; i < length; i++) *dest16++ = val; | 44 | 47.9M | return dest; | 45 | 47.9M | } |
Unexecuted instantiation: loopfilter.c:aom_memset16 Unexecuted instantiation: fft.c:aom_memset16 Unexecuted instantiation: corner_match.c:aom_memset16 Unexecuted instantiation: disflow.c:aom_memset16 Unexecuted instantiation: ransac.c:aom_memset16 Unexecuted instantiation: av1_inv_txfm2d.c:aom_memset16 Unexecuted instantiation: av1_txfm.c:aom_memset16 Unexecuted instantiation: convolve.c:aom_memset16 Unexecuted instantiation: av1_fwd_txfm1d.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 | 7.19M | (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 | 5.39M | do { \ |
69 | 5.39M | lval = (expr); \ |
70 | 5.39M | if (!lval) \ |
71 | 5.39M | aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ |
72 | 5 | "Failed to allocate " #lval); \ |
73 | 5.39M | } while (0) |
74 | | #endif |
75 | | |
76 | | #if defined(__cplusplus) |
77 | | } |
78 | | #endif |
79 | | |
80 | | #endif // AOM_AOM_MEM_AOM_MEM_H_ |