algo.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2021 Alibaba Group. All rights reserved.
  3. * License-Identifier: Apache-2.0
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. * not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. #ifndef ALGO_H
  19. #define ALGO_H
  20. #include "ialgo.h"
  21. enum IMAGE_FORMAT{
  22. IMAGE_RAW8 = 1,
  23. IMAGE_RAW10= 2,
  24. };
  25. struct algo_param {
  26. uint64_t image_in[2]; // 输入图片地址
  27. uint64_t image_out[2]; // 输出图片地址
  28. uint64_t report;
  29. int cols; // 图片列数
  30. int rows; // 图片行数
  31. int chan; // 图片通道数
  32. int format; // 图片格式, Raw8(uchar) 和 RAW10(unsigned short)
  33. int stride; //row size
  34. int start_row; // 传入图片的开始行
  35. int stop_row; // 传入图片的结束行
  36. float gamma; // float参数
  37. float coef1;
  38. float coef2;
  39. float coef3;
  40. float coef4;
  41. short beta; // short型参数
  42. short beta1;
  43. short beta2;
  44. short beta3;
  45. short beta4;
  46. int reserve[8]; // 保留
  47. };
  48. // gamma process
  49. //void gamma_raw8(unsigned char *image_in, unsigned char *image_out, int height, int width);
  50. void gamma_raw10(unsigned short *image_in, unsigned short *image_out, int height, int width);
  51. void gamma_raw10_slow(unsigned short *image_ddr_in, unsigned short *image_ddr_out, int height, int width);
  52. int gamma_wrapper(struct algo_param * params);
  53. algo_func dsp_dummy_algo_wrapper(csi_dsp_algo_param_t* param);
  54. int dsp_dummy_algo(csi_dsp_algo_param_t* param);
  55. #endif /* */