hc
2023-03-13 2ec15ae1cb4be1b4fcb56c6d621123d7ebdaad6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 * Copyright 2015 Rockchip Electronics Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
#ifndef __HAL_H264D_VDPU_COM_H__
#define __HAL_H264D_VDPU_COM_H__
 
#include "rk_type.h"
 
#include "hal_h264d_global.h"
 
#define VDPU_CABAC_TAB_SIZE        (3680)        /* bytes */
#define VDPU_POC_BUF_SIZE          (34*4)        /* bytes */
#define VDPU_SCALING_LIST_SIZE     (6*16+2*64)   /* bytes */
 
#define DEBUG_REF_LIST 0
 
extern const RK_U32 vdpu_cabac_table[VDPU_CABAC_TAB_SIZE / 4];
extern const RK_U32 vdpu_value_list[34];
 
typedef struct h264d_vdpu_dpb_info_t {
    RK_U8     valid;
 
    RK_S32    slot_index;
    RK_U32    is_long_term;
    RK_S32    top_poc;
    RK_S32    bot_poc;
    RK_U16    frame_num;
    RK_U32    long_term_frame_idx;
    RK_U32    long_term_pic_num;
    RK_U32    top_used;
    RK_U32    bot_used;
    RK_U32    view_id;
    RK_U32    colmv_is_used;
    RK_U32    field_flag;
    RK_U32    is_ilt_flag;
    RK_U32    voidx;
 
    RK_U8     have_same;
    RK_U32    new_dpb_idx;
} H264dVdpuDpbInfo_t;
 
typedef struct h264d_vdpu_ref_pic_info_t {
    RK_U32    valid;
 
    RK_S32    dpb_idx;
    RK_S32    bottom_flag;
} H264dVdpuRefPicInfo_t;
 
typedef struct h264d_vdpu_priv_t {
    RK_U32                 layed_id;
 
    H264dVdpuDpbInfo_t     old_dpb[2][16];
    H264dVdpuDpbInfo_t     new_dpb[16];
    H264dVdpuDpbInfo_t     *ilt_dpb;
    H264dVdpuRefPicInfo_t  refinfo[3][32]; //!< listP listB0 list1
} H264dVdpuPriv_t;
 
typedef struct h264d_vdpu_buf_t {
    RK_U32 valid;
 
    MppBuffer buf;
    void *cabac_ptr;
    void *poc_ptr;
    void *sclst_ptr;
    void *regs;
} H264dVdpuBuf_t;
 
typedef struct h264d_refs_list_t {
    RK_S32 idx;
    RK_S32 cur_poc;
 
    RK_S32 lt_flag;
    RK_S32 ref_poc;
    RK_S32 ref_picnum;
    RK_S32 ref_flag;
} H264dRefsList_t;
 
typedef struct h264d_vdpu_reg_ctx_t {
    H264dVdpuBuf_t reg_buf[3];
 
    MppBuffer buf;
    void *cabac_ptr;
    void *poc_ptr;
    void *sclst_ptr;
    void *regs;
} H264dVdpuRegCtx_t;
 
#ifdef __cplusplus
extern "C" {
#endif
 
RK_U32 vdpu_ver_align(RK_U32 val);
RK_U32 vdpu_hor_align(RK_U32 val);
 
MPP_RET adjust_input(H264dVdpuPriv_t *priv,
                     DXVA_Slice_H264_Long *p_long,
                     DXVA_PicParams_H264_MVC  *pp);
 
RK_S32 compare_p(const void *a, const void *b);
RK_S32 compare_b0(const void *a, const void *b);
RK_S32 compare_b1(const void *a, const void *b);
 
#ifdef __cplusplus
}
#endif
 
#endif