1 /******************************************************************************
2  *
3  * Copyright (C) 2015 The Android Open Source Project
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  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 
21 #ifndef _IH264D_INTER_PRED_H_
22 #define _IH264D_INTER_PRED_H_
23 
24 /*!
25  **************************************************************************
26  * \file ih264d_inter_pred.h
27  *
28  * \brief
29  *    Decalaration for routines defined in MorionCompensate.c
30  *
31  * Detailed_description
32  *
33  * \date
34  *    creation_date
35  *
36  * \author  Arvind Raman
37  **************************************************************************
38  */
39 
40 #include "ih264d_structs.h"
41 
42 #define BUFFER_WIDTH        16
43 /*!
44  **************************************************************************
45  *   \brief   PRED_BUFFER_WIDTH / HEIGHT
46  *
47  *   Width and height of the 16 bit (also reused a 2 8 bits buffers). The
48  *   required dimensions for these buffers are 21x21, however to align the
49  *   start of every row to a WORD aligned boundary the width has been increased
50  *   to 24.
51  **************************************************************************
52  */
53 //#define PRED_BUFFER_WIDTH   24
54 //#define PRED_BUFFER_HEIGHT  21
55 #define PRED_BUFFER_WIDTH   24*2
56 #define PRED_BUFFER_HEIGHT  24*2
57 
58 void ih264d_fill_pred_info(WORD16 *pi2_mv,WORD32 part_width,WORD32 part_height, WORD32 sub_mb_num,
59                            WORD32 pred_dir,pred_info_pkd_t *ps_pred_pkd,WORD8 i1_buf_id,
60                            WORD8 i1_ref_idx,UWORD32 *pu4_wt_offset,UWORD8 u1_pic_type);
61 
62 WORD32 ih264d_form_mb_part_info_bp(pred_info_pkd_t *ps_pred_pkd,
63                                  dec_struct_t * ps_dec,
64                                  UWORD16 u2_mb_x,
65                                  UWORD16 u2_mb_y,
66                                  WORD32 mb_index,
67                                  dec_mb_info_t *ps_cur_mb_info);
68 
69 WORD32 ih264d_form_mb_part_info_mp(pred_info_pkd_t *ps_pred_pkd,
70                                  dec_struct_t * ps_dec,
71                                  UWORD16 u2_mb_x,
72                                  UWORD16 u2_mb_y,
73                                  WORD32 mb_index,
74                                  dec_mb_info_t *ps_cur_mb_info);
75 
76 
77 void ih264d_motion_compensate_bp(dec_struct_t * ps_dec, dec_mb_info_t *ps_cur_mb_info);
78 void ih264d_motion_compensate_mp(dec_struct_t * ps_dec, dec_mb_info_t *ps_cur_mb_info);
79 
80 
81 void TransferRefBuffs(dec_struct_t *ps_dec);
82 
83 void ih264d_multiplex_ref_data(dec_struct_t * ps_dec,
84                                pred_info_t *ps_pred,
85                                UWORD8* pu1_dest_y,
86                                UWORD8* pu1_dest_u,
87                                dec_mb_info_t *ps_cur_mb_info,
88                                UWORD16 u2_dest_wd_y,
89                                UWORD16 u2_dest_wd_uv,
90                                UWORD8 u1_dir);
91 #endif /* _IH264D_INTER_PRED_H_ */
92 
93