Blame view

src/common/dvpp/dvpp_jpegd.h 2.76 KB
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
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
  /**
  * Copyright 2020 Huawei Technologies 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.
  
  * File dvpp_process.h
  * Description: handle dvpp process
  */
  #pragma once
  #include <cstdint>
  #include <string.h>
  #include "acl/acl.h"
  #include "acl/ops/acl_dvpp.h"
  #include "utils.h"
  
  
  /**
95ee08f6   Hu Chunming   修正注释
28
   * DvppJpegD
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
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
   */
  class DvppJpegD {
  public:
      /**
      * @brief Constructor
      * @param [in] stream: stream
      */
      DvppJpegD(aclrtStream &stream,  acldvppChannelDesc *dvppChannelDesc);
  
      /**
      * @brief Destructor
      */
      ~DvppJpegD();
  
      /**
      * @brief dvpp global init
      * @return result
      */
      int InitResource();
  
      /**
      * @brief init dvpp output para
      * @param [in] modelInputWidth: model input width
      * @param [in] modelInputHeight: model input height
      * @return result
      */
      int InitOutputPara(int modelInputWidth, int modelInputHeight);
  
      /**
      * @brief set jpegd input
      * @param [in] inDevBuffer: device buffer of input pic
      * @param [in] inDevBufferSize: device buffer size of input pic
      * @param [in] inputWidth:width of pic
      * @param [in] inputHeight:height of pic
      */
      void SetInput4JpegD(uint8_t* inDevBuffer, int inDevBufferSize, int inputWidth, int inputHeight);
      int InitDecodeOutputDesc(ImageData& inputImage);
      /**
      * @brief gett dvpp output
      * @param [in] outputBuffer: pointer which points to dvpp output buffer
      * @param [out] outputSize: output size
      */
      void GetOutput(void **outputBuffer, int &outputSize);
      int Process(ImageData& dest, ImageData& src);
     /**
      * @brief release encode resource
      */
      void DestroyEncodeResource();
  
  private:
      void DestroyDecodeResource();
      void DestroyResource();
      void DestroyOutputPara();
  
      aclrtStream stream_;
      acldvppChannelDesc *dvppChannelDesc_;
  
      void* decodeOutBufferDev_; // decode output buffer
      acldvppPicDesc *decodeOutputDesc_; //decode output desc
  
      uint8_t *inDevBuffer_;  // input pic dev buffer
      uint32_t inDevBufferSizeD_; // input pic size for decode
  
      void *vpcOutBufferDev_; // vpc output buffer
      uint32_t vpcOutBufferSize_;  // vpc output size
      //230316added
      uint32_t decodeOutWidth_;
      uint32_t decodeOutHeight_;
      uint32_t decodeOutWidthStride_;
      uint32_t decodeOutHeightStride_;
      uint32_t decodeOutBufferSize_;
  };