xref: /rockchip-linux_mpp/utils/mpp_enc_roi_utils.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1*437bfbebSnyanmisaka /*
2*437bfbebSnyanmisaka  * Copyright 2021 Rockchip Electronics Co. LTD
3*437bfbebSnyanmisaka  *
4*437bfbebSnyanmisaka  * Licensed under the Apache License, Version 2.0 (the "License");
5*437bfbebSnyanmisaka  * you may not use this file except in compliance with the License.
6*437bfbebSnyanmisaka  * You may obtain a copy of the License at
7*437bfbebSnyanmisaka  *
8*437bfbebSnyanmisaka  *      http://www.apache.org/licenses/LICENSE-2.0
9*437bfbebSnyanmisaka  *
10*437bfbebSnyanmisaka  * Unless required by applicable law or agreed to in writing, software
11*437bfbebSnyanmisaka  * distributed under the License is distributed on an "AS IS" BASIS,
12*437bfbebSnyanmisaka  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*437bfbebSnyanmisaka  * See the License for the specific language governing permissions and
14*437bfbebSnyanmisaka  * limitations under the License.
15*437bfbebSnyanmisaka  */
16*437bfbebSnyanmisaka 
17*437bfbebSnyanmisaka #include "rk_venc_cmd.h"
18*437bfbebSnyanmisaka 
19*437bfbebSnyanmisaka typedef void* MppEncRoiCtx;
20*437bfbebSnyanmisaka 
21*437bfbebSnyanmisaka /*
22*437bfbebSnyanmisaka  * NOTE: this structure is changeful. Do NOT expect binary compatible on it.
23*437bfbebSnyanmisaka  */
24*437bfbebSnyanmisaka typedef struct RRegion_t {
25*437bfbebSnyanmisaka     RK_U16              x;              /**< horizontal position of top left corner */
26*437bfbebSnyanmisaka     RK_U16              y;              /**< vertical position of top left corner */
27*437bfbebSnyanmisaka     RK_U16              w;              /**< width of ROI rectangle */
28*437bfbebSnyanmisaka     RK_U16              h;              /**< height of ROI rectangle */
29*437bfbebSnyanmisaka 
30*437bfbebSnyanmisaka     RK_S32              force_intra;    /**< flag of forced intra macroblock */
31*437bfbebSnyanmisaka     RK_S32              qp_mode;        /**< 0 - relative qp 1 - absolute qp */
32*437bfbebSnyanmisaka     RK_S32              qp_val;         /**< absolute / relative qp of macroblock */
33*437bfbebSnyanmisaka } RoiRegionCfg;
34*437bfbebSnyanmisaka 
35*437bfbebSnyanmisaka #ifdef __cplusplus
36*437bfbebSnyanmisaka extern "C" {
37*437bfbebSnyanmisaka #endif
38*437bfbebSnyanmisaka 
39*437bfbebSnyanmisaka MPP_RET mpp_enc_roi_init(MppEncRoiCtx *ctx, RK_U32 w, RK_U32 h, MppCodingType type, RK_S32 count);
40*437bfbebSnyanmisaka MPP_RET mpp_enc_roi_deinit(MppEncRoiCtx ctx);
41*437bfbebSnyanmisaka 
42*437bfbebSnyanmisaka MPP_RET mpp_enc_roi_add_region(MppEncRoiCtx ctx, RoiRegionCfg *region);
43*437bfbebSnyanmisaka MPP_RET mpp_enc_roi_setup_meta(MppEncRoiCtx ctx, MppMeta meta);
44*437bfbebSnyanmisaka 
45*437bfbebSnyanmisaka #ifdef __cplusplus
46*437bfbebSnyanmisaka }
47*437bfbebSnyanmisaka #endif
48