1 /******************************************************************************
2 *
3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18 /**
19 *******************************************************************************
20 * @file
21 *  ihevce_mv_merge.h
22 *
23 * @brief
24 *    This file contains function prototypes of MV Merge candidates list
25 *    derivation functions and corresponding structure and macrso definations
26 *
27 * @author
28 *  Harish
29 *
30 * @par List of Functions:
31 *
32 * @remarks
33 *  None
34 *
35 *******************************************************************************
36 */
37 
38 #ifndef _IHEVCD_MV_MERGE_H_
39 #define _IHEVCD_MV_MERGE_H_
40 
41 /*****************************************************************************/
42 /* Constant Macros                                                           */
43 /*****************************************************************************/
44 
45 #define MAX_NUM_MV_NBR     5
46 
47 /*****************************************************************************/
48 /* Function Macros                                                           */
49 /*****************************************************************************/
50 
51 /*****************************************************************************/
52 /* Typedefs                                                                  */
53 /*****************************************************************************/
54 
55 /*****************************************************************************/
56 /* Enums                                                                     */
57 /*****************************************************************************/
58 typedef enum
59 {
60     NBR_A0 = 0,
61     NBR_A1 = 1,
62     NBR_B0 = 2,
63     NBR_B1 = 3,
64     NBR_B2 = 4,
65 
66     /* should be last */
67     MAX_NUM_NBRS
68 }MV_MERGE_NBRS_T;
69 
70 /*****************************************************************************/
71 /* Structure                                                                 */
72 /*****************************************************************************/
73 
74 /*****************************************************************************/
75 /* Extern Variable Declarations                                              */
76 /*****************************************************************************/
77 
78 /*****************************************************************************/
79 /* Extern Function Declarations                                              */
80 /*****************************************************************************/
81 void ihevcd_mv_merge(mv_ctxt_t *ps_mv_ctxt,
82                      UWORD32 *pu4_top_pu_idx,
83                      UWORD32 *pu4_left_pu_idx,
84                      WORD32 left_nbr_4x4_strd,
85                      pu_t *ps_pu,
86                      WORD32 part_mode,
87                      WORD32 part_idx,
88                      WORD32 part_wd,
89                      WORD32 part_ht,
90                      WORD32 part_pos_x,
91                      WORD32 part_pos_y,
92                      WORD32 single_mcl_flag,
93                      WORD32 lb_avail,
94                      WORD32 l_avail,
95                      WORD32 tr_avail,
96                      WORD32 t_avail,
97                      WORD32 tl_avail);
98 void ihevcd_collocated_mvp(mv_ctxt_t *ps_mv_ctxt,
99                            pu_t *ps_pu,
100                            mv_t *ps_mv_col,
101                            WORD32 *pu4_avail_col_flag,
102                            WORD32 use_pu_ref_idx,
103                            WORD32 x_col,
104                            WORD32 y_col);
105 
106 void ihevcd_scale_collocated_mv(mv_t *ps_mv,
107                                 WORD32 cur_ref_poc,
108                                 WORD32 col_ref_poc,
109                                 WORD32 col_poc,
110                                 WORD32 cur_poc);
111 #endif  /* _IHEVCD_MV_MERGE_H_ */
112