对单张图片进行处理
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <semaphore.h>
#include <pthread.h>
#include <math.h>
#include "sample_comm_ive.h"
typedef struct hiSAMPLE_IVE_TEST_S
{
IVE_SRC_IMAGE_S stSrc;
IVE_DST_IMAGE_S stDst;
FILE* pFpSrc;
FILE* pFpDst;
}SAMPLE_IVE_TEST_S;
static SAMPLE_IVE_TEST_S s_stTest;
static HI_VOID SAMPLE_IVE_Test_Uninit(SAMPLE_IVE_TEST_S *pstTest)
{
IVE_MMZ_FREE(pstTest->stSrc.au64PhyAddr[0], pstTest->stSrc.au64VirAddr[0]);
IVE_MMZ_FREE(pstTest->stDst.au64PhyAddr[0], pstTest->stDst.au64VirAddr[0]);
IVE_CLOSE_FILE(pstTest->pFpSrc);
IVE_CLOSE_FILE(pstTest->pFpDst);
}
static HI_S32 SAMPLE_IVE_Test_Init(SAMPLE_IVE_TEST_S *pstTest, HI_U32 u32Width, HI_U32 u32Height, HI_CHAR *pchSrcFileName, HI_CHAR *pchDstFileName)
{
HI_S32 s32Ret;
memset(pstTest, 0, sizeof(SAMPLE_IVE_TEST_S));
s32Ret = HI_FAILURE;
pstTest->pFpSrc = fopen(pchSrcFileName, "rb");
SAMPLE_CHECK_EXPR_GOTO(NULL == pstTest->pFpSrc, TEST_INIT_FAIL, "Error,Open file %s failed!\n", pchSrcFileName);
pstTest->pFpDst = fopen(pchDstFileName, "wb");
SAMPLE_CHECK_EXPR_GOTO(NULL == pstTest->pFpDst, TEST_INIT_FAIL, "Error,Open file %s failed!\n", pchDstFileName);
s32Ret = HI_SUCCESS;
s32Ret = SAMPLE_COMM_IVE_CreateImage(&(pstTest->stSrc), IVE_IMAGE_TYPE_U8C1, u32Width, u32Height);
SAMPLE_CHECK_EXPR_GOTO(HI_SUCCESS != s32Ret, TEST_INIT_FAIL, "Error(%#x),Create Src image failed!\n", s32Ret);
s32Ret = SAMPLE_COMM_IVE_CreateIma