1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CNN_TRASH_CLASSIFY_H 17 #define CNN_TRASH_CLASSIFY_H 18 19 #include <stdlib.h> 20 #include <string.h> 21 #include <stdio.h> 22 #include <errno.h> 23 #include "hi_comm_video.h" 24 #include "osd_img.h" 25 26 #if __cplusplus 27 extern "C" { 28 #endif 29 30 #define TINY_BUF_SIZE 64 // tiny buf size 31 #define SMALL_BUF_SIZE 128 // small buf size 32 #define NORM_BUF_SIZE 256 // normal buf size 33 #define LARGE_BUF_SIZE 1024 // normal buf size 34 #define HUGE_BUF_SIZE 9120 // huge buf size 35 36 /* ARGB1555 common colors */ 37 #define ARGB1555_RED 0xFC00 // 1 11111 00000 00000 38 #define ARGB1555_GREEN 0x83E0 // 1 00000 11111 00000 39 #define ARGB1555_BLUE 0x801F // 1 00000 00000 11111 40 #define ARGB1555_YELLOW 0xFFE0 // 1 11111 11111 00000 41 #define ARGB1555_YELLOW2 0xFF00 // 1 11111 11111 00000 42 #define ARGB1555_WHITE 0xFFFF // 1 11111 11111 11111 43 #define ARGB1555_BLACK 0x8000 // 1 00000 00000 00000 44 45 /* cnn trash classify load model */ 46 HI_S32 CnnTrashClassifyLoadModel(uintptr_t* model, OsdSet* osds); 47 48 /* cnn trash classify unload model */ 49 HI_S32 CnnTrashClassifyUnloadModel(uintptr_t model); 50 51 /* cnn trash classify calculation */ 52 HI_S32 CnnTrashClassifyCal(uintptr_t model, VIDEO_FRAME_INFO_S *srcFrm, VIDEO_FRAME_INFO_S *resFrm); 53 54 #ifdef __cplusplus 55 } 56 #endif 57 #endif 58