/src/aom/av1/common/entropymv.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_AV1_COMMON_ENTROPYMV_H_ |
13 | | #define AOM_AV1_COMMON_ENTROPYMV_H_ |
14 | | |
15 | | #include "config/aom_config.h" |
16 | | |
17 | | #include "aom_dsp/prob.h" |
18 | | |
19 | | #include "av1/common/mv.h" |
20 | | |
21 | | #ifdef __cplusplus |
22 | | extern "C" { |
23 | | #endif |
24 | | |
25 | | struct AV1Common; |
26 | | |
27 | | void av1_init_mv_probs(struct AV1Common *cm); |
28 | | |
29 | | #define MV_UPDATE_PROB 252 |
30 | | |
31 | | /* Symbols for coding which components are zero jointly */ |
32 | | #define MV_JOINTS 4 |
33 | | enum { |
34 | | MV_JOINT_ZERO = 0, /* Zero vector */ |
35 | | MV_JOINT_HNZVZ = 1, /* Vert zero, hor nonzero */ |
36 | | MV_JOINT_HZVNZ = 2, /* Hor zero, vert nonzero */ |
37 | | MV_JOINT_HNZVNZ = 3, /* Both components nonzero */ |
38 | | } UENUM1BYTE(MV_JOINT_TYPE); |
39 | | |
40 | 2.25M | static inline int mv_joint_vertical(MV_JOINT_TYPE type) { |
41 | 2.25M | return type == MV_JOINT_HZVNZ || type == MV_JOINT_HNZVNZ; |
42 | 2.25M | } Unexecuted instantiation: av1_dx_iface.c:mv_joint_vertical Unexecuted instantiation: decodeframe.c:mv_joint_vertical decodemv.c:mv_joint_vertical Line | Count | Source | 40 | 2.25M | static inline int mv_joint_vertical(MV_JOINT_TYPE type) { | 41 | 2.25M | return type == MV_JOINT_HZVNZ || type == MV_JOINT_HNZVNZ; | 42 | 2.25M | } |
Unexecuted instantiation: decoder.c:mv_joint_vertical Unexecuted instantiation: decodetxb.c:mv_joint_vertical Unexecuted instantiation: detokenize.c:mv_joint_vertical Unexecuted instantiation: obu.c:mv_joint_vertical Unexecuted instantiation: aom_dsp_rtcd.c:mv_joint_vertical Unexecuted instantiation: av1_rtcd.c:mv_joint_vertical Unexecuted instantiation: aom_convolve.c:mv_joint_vertical Unexecuted instantiation: blend_a64_hmask.c:mv_joint_vertical Unexecuted instantiation: blend_a64_mask.c:mv_joint_vertical Unexecuted instantiation: blend_a64_vmask.c:mv_joint_vertical Unexecuted instantiation: intrapred.c:mv_joint_vertical Unexecuted instantiation: aom_convolve_copy_sse2.c:mv_joint_vertical Unexecuted instantiation: intrapred_sse2.c:mv_joint_vertical Unexecuted instantiation: loopfilter_sse2.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_sse2.c:mv_joint_vertical Unexecuted instantiation: highbd_loopfilter_sse2.c:mv_joint_vertical Unexecuted instantiation: aom_subpixel_8t_intrin_ssse3.c:mv_joint_vertical Unexecuted instantiation: intrapred_ssse3.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_ssse3.c:mv_joint_vertical Unexecuted instantiation: blend_a64_hmask_sse4.c:mv_joint_vertical Unexecuted instantiation: blend_a64_mask_sse4.c:mv_joint_vertical Unexecuted instantiation: blend_a64_vmask_sse4.c:mv_joint_vertical Unexecuted instantiation: intrapred_sse4.c:mv_joint_vertical Unexecuted instantiation: aom_convolve_copy_avx2.c:mv_joint_vertical Unexecuted instantiation: aom_subpixel_8t_intrin_avx2.c:mv_joint_vertical Unexecuted instantiation: intrapred_avx2.c:mv_joint_vertical Unexecuted instantiation: loopfilter_avx2.c:mv_joint_vertical Unexecuted instantiation: blend_a64_mask_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_loopfilter_avx2.c:mv_joint_vertical Unexecuted instantiation: alloccommon.c:mv_joint_vertical Unexecuted instantiation: av1_inv_txfm2d.c:mv_joint_vertical Unexecuted instantiation: av1_loopfilter.c:mv_joint_vertical Unexecuted instantiation: av1_txfm.c:mv_joint_vertical Unexecuted instantiation: blockd.c:mv_joint_vertical Unexecuted instantiation: cdef.c:mv_joint_vertical Unexecuted instantiation: cdef_block.c:mv_joint_vertical Unexecuted instantiation: cfl.c:mv_joint_vertical Unexecuted instantiation: convolve.c:mv_joint_vertical Unexecuted instantiation: entropy.c:mv_joint_vertical Unexecuted instantiation: entropymode.c:mv_joint_vertical Unexecuted instantiation: entropymv.c:mv_joint_vertical Unexecuted instantiation: idct.c:mv_joint_vertical Unexecuted instantiation: mvref_common.c:mv_joint_vertical Unexecuted instantiation: pred_common.c:mv_joint_vertical Unexecuted instantiation: quant_common.c:mv_joint_vertical Unexecuted instantiation: reconinter.c:mv_joint_vertical Unexecuted instantiation: reconintra.c:mv_joint_vertical Unexecuted instantiation: resize.c:mv_joint_vertical Unexecuted instantiation: restoration.c:mv_joint_vertical Unexecuted instantiation: scale.c:mv_joint_vertical Unexecuted instantiation: scan.c:mv_joint_vertical Unexecuted instantiation: seg_common.c:mv_joint_vertical Unexecuted instantiation: thread_common.c:mv_joint_vertical Unexecuted instantiation: tile_common.c:mv_joint_vertical Unexecuted instantiation: txb_common.c:mv_joint_vertical Unexecuted instantiation: warped_motion.c:mv_joint_vertical Unexecuted instantiation: cfl_sse2.c:mv_joint_vertical Unexecuted instantiation: convolve_2d_sse2.c:mv_joint_vertical Unexecuted instantiation: convolve_sse2.c:mv_joint_vertical Unexecuted instantiation: jnt_convolve_sse2.c:mv_joint_vertical Unexecuted instantiation: resize_sse2.c:mv_joint_vertical Unexecuted instantiation: wiener_convolve_sse2.c:mv_joint_vertical Unexecuted instantiation: av1_inv_txfm_ssse3.c:mv_joint_vertical Unexecuted instantiation: cfl_ssse3.c:mv_joint_vertical Unexecuted instantiation: jnt_convolve_ssse3.c:mv_joint_vertical Unexecuted instantiation: resize_ssse3.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_2d_ssse3.c:mv_joint_vertical Unexecuted instantiation: highbd_wiener_convolve_ssse3.c:mv_joint_vertical Unexecuted instantiation: reconinter_ssse3.c:mv_joint_vertical Unexecuted instantiation: av1_convolve_horiz_rs_sse4.c:mv_joint_vertical Unexecuted instantiation: av1_convolve_scale_sse4.c:mv_joint_vertical Unexecuted instantiation: av1_txfm_sse4.c:mv_joint_vertical Unexecuted instantiation: cdef_block_sse4.c:mv_joint_vertical Unexecuted instantiation: filterintra_sse4.c:mv_joint_vertical Unexecuted instantiation: highbd_inv_txfm_sse4.c:mv_joint_vertical Unexecuted instantiation: intra_edge_sse4.c:mv_joint_vertical Unexecuted instantiation: reconinter_sse4.c:mv_joint_vertical Unexecuted instantiation: selfguided_sse4.c:mv_joint_vertical Unexecuted instantiation: warp_plane_sse4.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_2d_sse4.c:mv_joint_vertical Unexecuted instantiation: highbd_jnt_convolve_sse4.c:mv_joint_vertical Unexecuted instantiation: highbd_warp_plane_sse4.c:mv_joint_vertical Unexecuted instantiation: av1_inv_txfm_avx2.c:mv_joint_vertical Unexecuted instantiation: cdef_block_avx2.c:mv_joint_vertical Unexecuted instantiation: cfl_avx2.c:mv_joint_vertical Unexecuted instantiation: convolve_2d_avx2.c:mv_joint_vertical Unexecuted instantiation: convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_inv_txfm_avx2.c:mv_joint_vertical Unexecuted instantiation: jnt_convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: reconinter_avx2.c:mv_joint_vertical Unexecuted instantiation: resize_avx2.c:mv_joint_vertical Unexecuted instantiation: selfguided_avx2.c:mv_joint_vertical Unexecuted instantiation: warp_plane_avx2.c:mv_joint_vertical Unexecuted instantiation: wiener_convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_convolve_2d_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_jnt_convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_wiener_convolve_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_warp_affine_avx2.c:mv_joint_vertical Unexecuted instantiation: highbd_intrapred_sse2.c:mv_joint_vertical Unexecuted instantiation: av1_inv_txfm1d.c:mv_joint_vertical |
43 | | |
44 | 2.25M | static inline int mv_joint_horizontal(MV_JOINT_TYPE type) { |
45 | 2.25M | return type == MV_JOINT_HNZVZ || type == MV_JOINT_HNZVNZ; |
46 | 2.25M | } Unexecuted instantiation: av1_dx_iface.c:mv_joint_horizontal Unexecuted instantiation: decodeframe.c:mv_joint_horizontal decodemv.c:mv_joint_horizontal Line | Count | Source | 44 | 2.25M | static inline int mv_joint_horizontal(MV_JOINT_TYPE type) { | 45 | 2.25M | return type == MV_JOINT_HNZVZ || type == MV_JOINT_HNZVNZ; | 46 | 2.25M | } |
Unexecuted instantiation: decoder.c:mv_joint_horizontal Unexecuted instantiation: decodetxb.c:mv_joint_horizontal Unexecuted instantiation: detokenize.c:mv_joint_horizontal Unexecuted instantiation: obu.c:mv_joint_horizontal Unexecuted instantiation: aom_dsp_rtcd.c:mv_joint_horizontal Unexecuted instantiation: av1_rtcd.c:mv_joint_horizontal Unexecuted instantiation: aom_convolve.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_hmask.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_mask.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_vmask.c:mv_joint_horizontal Unexecuted instantiation: intrapred.c:mv_joint_horizontal Unexecuted instantiation: aom_convolve_copy_sse2.c:mv_joint_horizontal Unexecuted instantiation: intrapred_sse2.c:mv_joint_horizontal Unexecuted instantiation: loopfilter_sse2.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_sse2.c:mv_joint_horizontal Unexecuted instantiation: highbd_loopfilter_sse2.c:mv_joint_horizontal Unexecuted instantiation: aom_subpixel_8t_intrin_ssse3.c:mv_joint_horizontal Unexecuted instantiation: intrapred_ssse3.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_ssse3.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_hmask_sse4.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_mask_sse4.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_vmask_sse4.c:mv_joint_horizontal Unexecuted instantiation: intrapred_sse4.c:mv_joint_horizontal Unexecuted instantiation: aom_convolve_copy_avx2.c:mv_joint_horizontal Unexecuted instantiation: aom_subpixel_8t_intrin_avx2.c:mv_joint_horizontal Unexecuted instantiation: intrapred_avx2.c:mv_joint_horizontal Unexecuted instantiation: loopfilter_avx2.c:mv_joint_horizontal Unexecuted instantiation: blend_a64_mask_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_loopfilter_avx2.c:mv_joint_horizontal Unexecuted instantiation: alloccommon.c:mv_joint_horizontal Unexecuted instantiation: av1_inv_txfm2d.c:mv_joint_horizontal Unexecuted instantiation: av1_loopfilter.c:mv_joint_horizontal Unexecuted instantiation: av1_txfm.c:mv_joint_horizontal Unexecuted instantiation: blockd.c:mv_joint_horizontal Unexecuted instantiation: cdef.c:mv_joint_horizontal Unexecuted instantiation: cdef_block.c:mv_joint_horizontal Unexecuted instantiation: cfl.c:mv_joint_horizontal Unexecuted instantiation: convolve.c:mv_joint_horizontal Unexecuted instantiation: entropy.c:mv_joint_horizontal Unexecuted instantiation: entropymode.c:mv_joint_horizontal Unexecuted instantiation: entropymv.c:mv_joint_horizontal Unexecuted instantiation: idct.c:mv_joint_horizontal Unexecuted instantiation: mvref_common.c:mv_joint_horizontal Unexecuted instantiation: pred_common.c:mv_joint_horizontal Unexecuted instantiation: quant_common.c:mv_joint_horizontal Unexecuted instantiation: reconinter.c:mv_joint_horizontal Unexecuted instantiation: reconintra.c:mv_joint_horizontal Unexecuted instantiation: resize.c:mv_joint_horizontal Unexecuted instantiation: restoration.c:mv_joint_horizontal Unexecuted instantiation: scale.c:mv_joint_horizontal Unexecuted instantiation: scan.c:mv_joint_horizontal Unexecuted instantiation: seg_common.c:mv_joint_horizontal Unexecuted instantiation: thread_common.c:mv_joint_horizontal Unexecuted instantiation: tile_common.c:mv_joint_horizontal Unexecuted instantiation: txb_common.c:mv_joint_horizontal Unexecuted instantiation: warped_motion.c:mv_joint_horizontal Unexecuted instantiation: cfl_sse2.c:mv_joint_horizontal Unexecuted instantiation: convolve_2d_sse2.c:mv_joint_horizontal Unexecuted instantiation: convolve_sse2.c:mv_joint_horizontal Unexecuted instantiation: jnt_convolve_sse2.c:mv_joint_horizontal Unexecuted instantiation: resize_sse2.c:mv_joint_horizontal Unexecuted instantiation: wiener_convolve_sse2.c:mv_joint_horizontal Unexecuted instantiation: av1_inv_txfm_ssse3.c:mv_joint_horizontal Unexecuted instantiation: cfl_ssse3.c:mv_joint_horizontal Unexecuted instantiation: jnt_convolve_ssse3.c:mv_joint_horizontal Unexecuted instantiation: resize_ssse3.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_2d_ssse3.c:mv_joint_horizontal Unexecuted instantiation: highbd_wiener_convolve_ssse3.c:mv_joint_horizontal Unexecuted instantiation: reconinter_ssse3.c:mv_joint_horizontal Unexecuted instantiation: av1_convolve_horiz_rs_sse4.c:mv_joint_horizontal Unexecuted instantiation: av1_convolve_scale_sse4.c:mv_joint_horizontal Unexecuted instantiation: av1_txfm_sse4.c:mv_joint_horizontal Unexecuted instantiation: cdef_block_sse4.c:mv_joint_horizontal Unexecuted instantiation: filterintra_sse4.c:mv_joint_horizontal Unexecuted instantiation: highbd_inv_txfm_sse4.c:mv_joint_horizontal Unexecuted instantiation: intra_edge_sse4.c:mv_joint_horizontal Unexecuted instantiation: reconinter_sse4.c:mv_joint_horizontal Unexecuted instantiation: selfguided_sse4.c:mv_joint_horizontal Unexecuted instantiation: warp_plane_sse4.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_2d_sse4.c:mv_joint_horizontal Unexecuted instantiation: highbd_jnt_convolve_sse4.c:mv_joint_horizontal Unexecuted instantiation: highbd_warp_plane_sse4.c:mv_joint_horizontal Unexecuted instantiation: av1_inv_txfm_avx2.c:mv_joint_horizontal Unexecuted instantiation: cdef_block_avx2.c:mv_joint_horizontal Unexecuted instantiation: cfl_avx2.c:mv_joint_horizontal Unexecuted instantiation: convolve_2d_avx2.c:mv_joint_horizontal Unexecuted instantiation: convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_inv_txfm_avx2.c:mv_joint_horizontal Unexecuted instantiation: jnt_convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: reconinter_avx2.c:mv_joint_horizontal Unexecuted instantiation: resize_avx2.c:mv_joint_horizontal Unexecuted instantiation: selfguided_avx2.c:mv_joint_horizontal Unexecuted instantiation: warp_plane_avx2.c:mv_joint_horizontal Unexecuted instantiation: wiener_convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_convolve_2d_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_jnt_convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_wiener_convolve_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_warp_affine_avx2.c:mv_joint_horizontal Unexecuted instantiation: highbd_intrapred_sse2.c:mv_joint_horizontal Unexecuted instantiation: av1_inv_txfm1d.c:mv_joint_horizontal |
47 | | |
48 | | /* Symbols for coding magnitude class of nonzero components */ |
49 | | #define MV_CLASSES 11 |
50 | | enum { |
51 | | MV_CLASS_0 = 0, /* (0, 2] integer pel */ |
52 | | MV_CLASS_1 = 1, /* (2, 4] integer pel */ |
53 | | MV_CLASS_2 = 2, /* (4, 8] integer pel */ |
54 | | MV_CLASS_3 = 3, /* (8, 16] integer pel */ |
55 | | MV_CLASS_4 = 4, /* (16, 32] integer pel */ |
56 | | MV_CLASS_5 = 5, /* (32, 64] integer pel */ |
57 | | MV_CLASS_6 = 6, /* (64, 128] integer pel */ |
58 | | MV_CLASS_7 = 7, /* (128, 256] integer pel */ |
59 | | MV_CLASS_8 = 8, /* (256, 512] integer pel */ |
60 | | MV_CLASS_9 = 9, /* (512, 1024] integer pel */ |
61 | | MV_CLASS_10 = 10, /* (1024,2048] integer pel */ |
62 | | } UENUM1BYTE(MV_CLASS_TYPE); |
63 | | |
64 | 874k | #define CLASS0_BITS 1 /* bits at integer precision for class 0 */ |
65 | 437k | #define CLASS0_SIZE (1 << CLASS0_BITS) |
66 | | #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2) |
67 | | #define MV_BITS_CONTEXTS 6 |
68 | | #define MV_FP_SIZE 4 |
69 | | |
70 | | #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2) |
71 | | #define MV_MAX ((1 << MV_MAX_BITS) - 1) |
72 | | #define MV_VALS ((MV_MAX << 1) + 1) |
73 | | |
74 | 57.6M | #define MV_IN_USE_BITS 14 |
75 | 34.0M | #define MV_UPP (1 << MV_IN_USE_BITS) |
76 | 39.2M | #define MV_LOW (-(1 << MV_IN_USE_BITS)) |
77 | | |
78 | | typedef struct { |
79 | | aom_cdf_prob classes_cdf[CDF_SIZE(MV_CLASSES)]; |
80 | | aom_cdf_prob class0_fp_cdf[CLASS0_SIZE][CDF_SIZE(MV_FP_SIZE)]; |
81 | | aom_cdf_prob fp_cdf[CDF_SIZE(MV_FP_SIZE)]; |
82 | | aom_cdf_prob sign_cdf[CDF_SIZE(2)]; |
83 | | aom_cdf_prob class0_hp_cdf[CDF_SIZE(2)]; |
84 | | aom_cdf_prob hp_cdf[CDF_SIZE(2)]; |
85 | | aom_cdf_prob class0_cdf[CDF_SIZE(CLASS0_SIZE)]; |
86 | | aom_cdf_prob bits_cdf[MV_OFFSET_BITS][CDF_SIZE(2)]; |
87 | | } nmv_component; |
88 | | |
89 | | typedef struct { |
90 | | aom_cdf_prob joints_cdf[CDF_SIZE(MV_JOINTS)]; |
91 | | nmv_component comps[2]; |
92 | | } nmv_context; |
93 | | |
94 | | enum { |
95 | | MV_SUBPEL_NONE = -1, |
96 | | MV_SUBPEL_LOW_PRECISION = 0, |
97 | | MV_SUBPEL_HIGH_PRECISION, |
98 | | } SENUM1BYTE(MvSubpelPrecision); |
99 | | |
100 | | #ifdef __cplusplus |
101 | | } // extern "C" |
102 | | #endif |
103 | | |
104 | | #endif // AOM_AV1_COMMON_ENTROPYMV_H_ |