vpc_util.h 1.16 KB
#ifndef ___VPC_UTIL_H__
#define ___VPC_UTIL_H__

#include "acl/acl.h"
#include "acl/ops/acl_dvpp.h"
#include "acl/dvpp/hi_dvpp.h"
#include "../ai_platform/header.h"

#include <string>
#include <vector>

using namespace std;

struct vpc_img_info{
    acldvppPicDesc* pic_desc{nullptr};
    string task_id;              //该物体属于的任务ID号
    int task_frame_count;     //该物体当前出现的帧号
    int object_id;            //该物体的ID号
    int index;                //该物体所属类别的编号
    double confidence;        //该物体的置信度
};

class DeviceMemory;

class VPCUtil {

public:
    int vpc_crop(acldvppPicDesc *input_pic_desc, video_object_info obj);

    int vpc_crop_init(int32_t devId);

    vector<vpc_img_info> vpc_crop_batch(DeviceMemory *devMem, vector<video_object_info> objs);

    void vpc_img_release(vpc_img_info );

    void vpc_imgList_release(vector<vpc_img_info>& );

    void vpc_crop_release();

    vpc_img_info vpc_devMem2vpcImg(DeviceMemory *devMem);

private:
    int32_t deviceId_;
    aclrtContext context_;
    aclrtStream stream_;

    acldvppChannelDesc *dvppChannelDesc_;
};



#endif  //___VPC_UTIL_H__