/src/aom/av1/encoder/global_motion_facade.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2020, 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_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ |
13 | | #define AOM_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ |
14 | | |
15 | | #ifdef __cplusplus |
16 | | extern "C" { |
17 | | #endif |
18 | | struct yv12_buffer_config; |
19 | | struct AV1_COMP; |
20 | | |
21 | | // Allocates memory for members of GlobalMotionData. |
22 | 0 | static inline void gm_alloc_data(AV1_COMP *cpi, GlobalMotionData *gm_data) { |
23 | 0 | AV1_COMMON *cm = &cpi->common; |
24 | 0 | GlobalMotionInfo *gm_info = &cpi->gm_info; |
25 | |
|
26 | 0 | CHECK_MEM_ERROR(cm, gm_data->segment_map, |
27 | 0 | aom_malloc(sizeof(*gm_data->segment_map) * |
28 | 0 | gm_info->segment_map_w * gm_info->segment_map_h)); |
29 | |
|
30 | 0 | av1_zero_array(gm_data->motion_models, RANSAC_NUM_MOTIONS); |
31 | 0 | for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) { |
32 | 0 | CHECK_MEM_ERROR(cm, gm_data->motion_models[m].inliers, |
33 | 0 | aom_malloc(sizeof(*gm_data->motion_models[m].inliers) * 2 * |
34 | 0 | MAX_CORNERS)); |
35 | 0 | } |
36 | 0 | } Unexecuted instantiation: av1_cx_iface.c:gm_alloc_data Unexecuted instantiation: encodeframe.c:gm_alloc_data Unexecuted instantiation: encoder.c:gm_alloc_data Unexecuted instantiation: encoder_utils.c:gm_alloc_data Unexecuted instantiation: ethread.c:gm_alloc_data Unexecuted instantiation: global_motion_facade.c:gm_alloc_data Unexecuted instantiation: superres_scale.c:gm_alloc_data Unexecuted instantiation: svc_layercontext.c:gm_alloc_data Unexecuted instantiation: compound_type.c:gm_alloc_data Unexecuted instantiation: encode_strategy.c:gm_alloc_data |
37 | | |
38 | | // Deallocates the memory allocated for members of GlobalMotionData. |
39 | 0 | static inline void gm_dealloc_data(GlobalMotionData *gm_data) { |
40 | 0 | aom_free(gm_data->segment_map); |
41 | 0 | gm_data->segment_map = NULL; |
42 | 0 | for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) { |
43 | 0 | aom_free(gm_data->motion_models[m].inliers); |
44 | 0 | gm_data->motion_models[m].inliers = NULL; |
45 | 0 | } |
46 | 0 | } Unexecuted instantiation: av1_cx_iface.c:gm_dealloc_data Unexecuted instantiation: encodeframe.c:gm_dealloc_data Unexecuted instantiation: encoder.c:gm_dealloc_data Unexecuted instantiation: encoder_utils.c:gm_dealloc_data Unexecuted instantiation: ethread.c:gm_dealloc_data Unexecuted instantiation: global_motion_facade.c:gm_dealloc_data Unexecuted instantiation: superres_scale.c:gm_dealloc_data Unexecuted instantiation: svc_layercontext.c:gm_dealloc_data Unexecuted instantiation: compound_type.c:gm_dealloc_data Unexecuted instantiation: encode_strategy.c:gm_dealloc_data |
47 | | |
48 | | void av1_compute_gm_for_valid_ref_frames( |
49 | | AV1_COMP *cpi, struct aom_internal_error_info *error_info, |
50 | | YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES], int frame, |
51 | | MotionModel *motion_models, uint8_t *segment_map, int segment_map_w, |
52 | | int segment_map_h); |
53 | | void av1_compute_global_motion_facade(struct AV1_COMP *cpi); |
54 | | #ifdef __cplusplus |
55 | | } // extern "C" |
56 | | #endif |
57 | | |
58 | | #endif // AOM_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ |