You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

acl_dvpp.h 5.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**
  2. * Copyright 2020 Huawei Technologies 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. #ifndef ACL_STUB_INC_ACL_DVPP_H
  17. #define ACL_STUB_INC_ACL_DVPP_H
  18. #include <stddef.h>
  19. #include "acl/acl.h"
  20. #include "acl/acl_base.h"
  21. typedef struct acldvppPicDesc acldvppPicDesc;
  22. typedef struct acldvppRoiConfig acldvppRoiConfig;
  23. typedef struct acldvppResizeConfig acldvppResizeConfig;
  24. typedef struct acldvppChannelDesc acldvppChannelDesc;
  25. typedef struct acldvppStreamDesc acldvppStreamDesc;
  26. typedef struct acldvppBatchPicDesc acldvppBatchPicDesc;
  27. enum acldvppPixelFormat {
  28. PIXEL_FORMAT_YUV_400 = 0,
  29. PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1, // YUV
  30. PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2, // YVU
  31. PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3, // YUV
  32. PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4, // YVU
  33. PIXEL_FORMAT_YUV_SEMIPLANAR_444 = 5, // YUV
  34. PIXEL_FORMAT_YVU_SEMIPLANAR_444 = 6, // YVU
  35. };
  36. enum acldvppStreamFormat {
  37. H265_MAIN_LEVEL = 0,
  38. H254_BASELINE_LEVEL = 1,
  39. H254_MAIN_LEVEL,
  40. H254_HIGH_LEVEL,
  41. };
  42. enum acldvppChannelMode { DVPP_CHNMODE_VPC = 1, DVPP_CHNMODE_JPEGD = 2, DVPP_CHNMODE_JPEGE = 4 };
  43. aclError acldvppMalloc(void **devPtr, size_t size);
  44. aclError acldvppFree(void *devPtr);
  45. acldvppChannelDesc *acldvppCreateChannelDesc();
  46. aclError acldvppDestroyChannelDesc(acldvppChannelDesc *channelDesc);
  47. acldvppPicDesc *acldvppCreatePicDesc();
  48. aclError acldvppDestroyPicDesc(acldvppPicDesc *picDesc);
  49. aclError acldvppSetPicDescSize(acldvppPicDesc *picDesc, uint32_t size);
  50. aclError acldvppSetPicDescFormat(acldvppPicDesc *picDesc, acldvppPixelFormat format);
  51. aclError acldvppSetPicDescWidth(acldvppPicDesc *picDesc, uint32_t width);
  52. aclError acldvppSetPicDescHeight(acldvppPicDesc *picDesc, uint32_t height);
  53. aclError acldvppSetPicDescData(acldvppPicDesc *picDesc, void *dataDev);
  54. aclError acldvppSetPicDescWidthStride(acldvppPicDesc *picDesc, uint32_t widthStride);
  55. aclError acldvppSetPicDescHeightStride(acldvppPicDesc *picDesc, uint32_t heightStride);
  56. aclError acldvppSetPicDescRetCode(acldvppPicDesc *picDesc, uint32_t retCode);
  57. uint32_t acldvppGetPicDescSize(acldvppPicDesc *picDesc);
  58. acldvppPixelFormat acldvppGetPicDescFormat(acldvppPicDesc *picDesc);
  59. uint32_t acldvppGetPicDescWidth(acldvppPicDesc *picDesc);
  60. uint32_t acldvppGetPicDescHeight(acldvppPicDesc *picDesc);
  61. void *acldvppGetPicDescData(acldvppPicDesc *picDesc);
  62. uint32_t acldvppGetPicDescWidthStride(acldvppPicDesc *picDesc);
  63. uint32_t acldvppGetPicDescHeightStride(acldvppPicDesc *picDesc);
  64. uint32_t acldvppGetPicDescRetCode(acldvppPicDesc *picDesc);
  65. acldvppRoiConfig *acldvppCreateRoiConfig(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom);
  66. aclError acldvppDestroyRoiConfig(acldvppRoiConfig *roiConfig);
  67. aclError acldvppSetRoiConfigLeft(acldvppRoiConfig *roiConfig, uint32_t left);
  68. aclError acldvppSetRoiConfigRight(acldvppRoiConfig *roiConfig, uint32_t right);
  69. aclError acldvppSetRoiConfigTop(acldvppRoiConfig *roiConfig, uint32_t top);
  70. aclError acldvppSetRoiConfigBottom(acldvppRoiConfig *roiConfig, uint32_t bottom);
  71. aclError acldvppSetRoiConfig(acldvppRoiConfig *roiConfig, uint32_t left, uint32_t right, uint32_t top, uint32_t bottom);
  72. acldvppResizeConfig *acldvppCreateResizeConfig();
  73. aclError acldvppDestroyResizeConfig(acldvppResizeConfig *resizeConfig);
  74. aclError acldvppJpegPredictDecSize(const void *data, uint32_t dataSize, acldvppPixelFormat ouputPixelFormat,
  75. uint32_t *decSize);
  76. aclError acldvppCreateChannel(acldvppChannelDesc *channelDesc);
  77. aclError acldvppDestroyChannel(acldvppChannelDesc *channelDesc);
  78. aclError acldvppVpcResizeAsync(acldvppChannelDesc *channelDesc, acldvppPicDesc *inputDesc, acldvppPicDesc *outputDesc,
  79. acldvppResizeConfig *resizeConfig, aclrtStream stream);
  80. aclError acldvppVpcCropAsync(acldvppChannelDesc *channelDesc, acldvppPicDesc *inputDesc, acldvppPicDesc *outputDesc,
  81. acldvppRoiConfig *cropArea, aclrtStream stream);
  82. aclError acldvppVpcCropAndPasteAsync(acldvppChannelDesc *channelDesc, acldvppPicDesc *inputDesc,
  83. acldvppPicDesc *outputDesc, acldvppRoiConfig *cropArea,
  84. acldvppRoiConfig *pasteArea, aclrtStream stream);
  85. aclError acldvppVpcBatchCropAsync(acldvppChannelDesc *channelDesc, acldvppBatchPicDesc *srcBatchDesc, uint32_t *roiNums,
  86. uint32_t size, acldvppBatchPicDesc *dstBatchDesc, acldvppRoiConfig *cropAreas[],
  87. aclrtStream stream);
  88. aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc, const void *data, uint32_t size,
  89. acldvppPicDesc *outputDesc, aclrtStream stream);
  90. acldvppBatchPicDesc *acldvppCreateBatchPicDesc(uint32_t batchSize);
  91. acldvppPicDesc *acldvppGetPicDesc(acldvppBatchPicDesc *batchPicDesc, uint32_t index);
  92. aclError acldvppDestroyBatchPicDesc(acldvppBatchPicDesc *batchPicDesc);
  93. #endif // ACL_STUB_INC_ACL_DVPP_H