xref: /rockchip-linux_mpp/mpp/hal/common/h264/hal_h264e_stream_amend.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2  * Copyright 2022 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __HAL_H264E_STREAM_AMEND_H__
18 #define __HAL_H264E_STREAM_AMEND_H__
19 
20 #include "h264e_slice.h"
21 
22 typedef struct HalH264eVepuStreamAmend_t {
23     RK_S32           enable;
24     H264eSlice       *slice;
25     H264ePrefixNal   *prefix;
26 
27     /* async encode TSVC info */
28     H264eReorderInfo *reorder;
29     H264eMarkingInfo *marking;
30 
31     RK_S32           slice_enabled;
32 
33     RK_U8            *src_buf;
34     RK_U8            *dst_buf;
35     RK_S32           buf_size;
36 
37     MppPacket        packet;
38     /* sw length */
39     RK_S32           buf_base;
40     /* hw length */
41     RK_S32           old_length;
42     RK_S32           new_length;
43 } HalH264eVepuStreamAmend;
44 
45 MPP_RET h264e_vepu_stream_amend_init(HalH264eVepuStreamAmend *ctx);
46 MPP_RET h264e_vepu_stream_amend_deinit(HalH264eVepuStreamAmend *ctx);
47 MPP_RET h264e_vepu_stream_amend_config(HalH264eVepuStreamAmend *ctx,
48                                        MppPacket packet, MppEncCfgSet *cfg,
49                                        H264eSlice *slice, H264ePrefixNal *prefix);
50 MPP_RET h264e_vepu_stream_amend_proc(HalH264eVepuStreamAmend *ctx, MppEncH264HwCfg *hw_cfg);
51 MPP_RET h264e_vepu_stream_amend_sync_ref_idc(HalH264eVepuStreamAmend *ctx);
52 
53 #endif /* __HAL_H264E_STREAM_AMEND_H__ */
54