Browse Source

wave420l: fix building issue for gcc 12.2.0

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Andy Hu 1 year ago
parent
commit
998da6bd88

+ 5 - 5
wave420l/code/sample/helper/main_helper.c

@@ -1229,7 +1229,7 @@ Int32 writeVuiRbsp(int coreIdx, TestEncConfig *encConfig, EncOpenParam *encOP, v
         }
         encOP->vuiRbspDataAddr = vbVuiRbsp->phys_addr;
 
-        if (encConfig->vui_rbsp_file_name) {
+        if (encConfig) {
             Uint8   *pVuiRbspBuf;
             Int32   rbspSizeInByte = (encOP->vuiRbspDataSize+7)>>3;
             ChangePathStyle(encConfig->vui_rbsp_file_name);
@@ -1263,7 +1263,7 @@ Int32 writeHrdRbsp(int coreIdx, TestEncConfig *encConfig, EncOpenParam *encOP, v
 
         encOP->hrdRbspDataAddr = vbHrdRbsp->phys_addr;
 
-        if (encConfig->hrd_rbsp_file_name) {
+        if (encConfig) {
             Uint8   *pHrdRbspBuf;
             Int32   rbspSizeInByte = (encOP->hrdRbspDataSize+7)>>3;
             ChangePathStyle(encConfig->hrd_rbsp_file_name);
@@ -1505,7 +1505,7 @@ int setRoiMap(int coreIdx, TestEncConfig *encConfig, EncOpenParam encOP, Physica
         // sample code to convert ROI coordinate to ROI map.
         osal_memset(&encConfig->region[0], 0, sizeof(VpuRect)*MAX_ROI_NUMBER);
         osal_memset(&encConfig->roiLevel[0], 0, sizeof(int)*MAX_ROI_NUMBER);
-        if (encConfig->roi_file_name) {
+        if (encConfig) {
             char lineStr[256] = {0, };
             int  val;
             fgets(lineStr, 256, encConfig->roi_file);
@@ -1580,7 +1580,7 @@ int checkParamRestriction(Uint32 productId, TestEncConfig *encConfig)
 int openRoiMapFile(TestEncConfig *encConfig) 
 {
     if (encConfig->roi_enable) {
-        if (encConfig->roi_file_name) {
+        if (encConfig) {
             ChangePathStyle(encConfig->roi_file_name);
             if ((encConfig->roi_file = osal_fopen(encConfig->roi_file_name, "r")) == NULL) {
                 VLOG(ERR, "fail to open ROI file, %s\n", encConfig->roi_file_name);
@@ -1617,7 +1617,7 @@ int setCtuQpMap(int coreIdx, TestEncConfig *encConfig, EncOpenParam encOP, Physi
         // sample code to convert CTU coordinate to CTU MODE map.
         osal_memset(&encConfig->region[0], 0, sizeof(VpuRect)*MAX_ROI_NUMBER);
         osal_memset(&encConfig->ctuQp[0], 0, sizeof(int)*MAX_ROI_NUMBER);
-        if (encConfig->ctuqp_file_name) {
+        if (encConfig) {
             char lineStr[256] = {0, };
             int  val;
             fgets(lineStr, 256, encConfig->ctuqp_file);

+ 2 - 1
wave420l/code/sample/helper/main_helper.h

@@ -55,6 +55,7 @@ struct OptionExt
 };
 
 #define MAX_FILE_PATH               256
+#define MAX_SRC_FILE_PATH           128
 #define MAX_PIC_SKIP_NUM            5
 #ifdef SUPPORT_SRC_BUF_CONTROL
 #define ENC_SRC_BUF_NUM             2000
@@ -231,7 +232,7 @@ typedef struct {
 } HEVC_ENC_CFG;
 
 typedef struct {
-    char SrcFileName[MAX_FILE_PATH];
+    char SrcFileName[MAX_SRC_FILE_PATH];
     char BitStreamFileName[MAX_FILE_PATH];
     BOOL srcCbCrInterleave;
     int NumFrame;

+ 1 - 1
wave420l/code/sample/helper/vpuhelper.c

@@ -1657,7 +1657,7 @@ Int32 GetEncOpenParam(EncOpenParam *pEncOP, TestEncConfig *pEncConfig, ENC_CFG *
     int bitFormat;
     ENC_CFG encCfgInst;
     ENC_CFG *pCfg;
-    char yuvDir[256] = "yuv/";
+    char yuvDir[128] = "yuv/";
 
     // Source YUV Image File to load
     if (pEncCfg) {

+ 2 - 2
wave420l/code/sample/main_w4_enc_test.c

@@ -509,7 +509,7 @@ int TestEncoder(TestEncConfig *param)
         }
         
         if ( (encConfig.seiDataEnc.prefixSeiNalEnable || encConfig.seiDataEnc.suffixSeiNalEnable) && encParam.srcEndFlag != 1) {
-            if (encConfig.prefix_sei_nal_file_name) {
+            {
                 Uint8   *pUserBuf;
                 pUserBuf = (Uint8*)osal_malloc(SEI_NAL_DATA_BUF_SIZE);
                 osal_memset(pUserBuf, 0, SEI_NAL_DATA_BUF_SIZE);
@@ -518,7 +518,7 @@ int TestEncoder(TestEncConfig *param)
                 osal_free(pUserBuf);
             }
             
-            if (encConfig.suffix_sei_nal_file_name) {
+            {
                 Uint8   *pUserBuf;
                 pUserBuf = (Uint8*)osal_malloc(SEI_NAL_DATA_BUF_SIZE);
                 osal_memset(pUserBuf, 0, SEI_NAL_DATA_BUF_SIZE);