Minor Clean ups for graph
[keystone-rtos/fvid2.git] / src / fvid2_graph.c
index 581dc0c8947a761689705f07b91732b19d32c4f9..66a6cd3aeae8b9883532a4b8e7a13c80f9894b84 100755 (executable)
 /*                         Structure Declarations                             */
 /* ========================================================================== */
 
 /*                         Structure Declarations                             */
 /* ========================================================================== */
 
-typedef struct Fvid2_GraphStack_t
+/**
+ *  \brief Structure describing graph stack.
+ */
+typedef struct
 {
     Fvid2_GraphNodeInfo *node[FVID2_GRAPH_MAX_NODES];
     /**< Array of node pointers */
 {
     Fvid2_GraphNodeInfo *node[FVID2_GRAPH_MAX_NODES];
     /**< Array of node pointers */
@@ -71,12 +74,17 @@ typedef struct Fvid2_GraphStack_t
 /*                         Internal Function Declarations                     */
 /* ========================================================================== */
 
 /*                         Internal Function Declarations                     */
 /* ========================================================================== */
 
-static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeInfoList *inNodeList,
-                                  const Fvid2_GraphEdgeInfoList *inEdgeList);
+static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeList *inNodeList,
+                                  const Fvid2_GraphEdgeList *inEdgeList);
+
 static void Fvid2_graphStackReset(void);
 static void Fvid2_graphStackReset(void);
+
 static void Fvid2_graphStackPush(Fvid2_GraphNodeInfo *node);
 static void Fvid2_graphStackPush(Fvid2_GraphNodeInfo *node);
+
 static void Fvid2_graphStackPop(void);
 static void Fvid2_graphStackPop(void);
+
 static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node);
 static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node);
+
 int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
                                    uint32_t isForward);
 
 int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
                                    uint32_t isForward);
 
@@ -91,16 +99,16 @@ static Fvid2_GraphStack gFvid2GraphNodeStack;
 /* ========================================================================== */
 
 /* Helper function */
 /* ========================================================================== */
 
 /* Helper function */
-static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeInfoList *inNodeList,
-                                  const Fvid2_GraphEdgeInfoList *inEdgeList)
+static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeList *inNodeList,
+                                  const Fvid2_GraphEdgeList *inEdgeList)
 {
     Fvid2_GraphNodeInfo *nodes = inNodeList->list;
     Fvid2_GraphEdgeInfo *edges = inEdgeList->list;
     uint32_t cnt, startNode, endNode, index1, index2;
     for (cnt = 0; cnt < inNodeList->numNodes; cnt++)
     {
 {
     Fvid2_GraphNodeInfo *nodes = inNodeList->list;
     Fvid2_GraphEdgeInfo *edges = inEdgeList->list;
     uint32_t cnt, startNode, endNode, index1, index2;
     for (cnt = 0; cnt < inNodeList->numNodes; cnt++)
     {
-        Fvid2Utils_memset(&nodes[cnt].input, 0, sizeof (Fvid2_GraphNodeSet));
-        Fvid2Utils_memset(&nodes[cnt].output, 0, sizeof (Fvid2_GraphNodeSet));
+        Fvid2Utils_memset(&nodes[cnt].inputNodeSet, 0, sizeof (Fvid2_GraphNodeSet));
+        Fvid2Utils_memset(&nodes[cnt].outputNodeSet, 0, sizeof (Fvid2_GraphNodeSet));
     }
 
     for (cnt = 0U; cnt < inEdgeList->numEdges; cnt++)
     }
 
     for (cnt = 0U; cnt < inEdgeList->numEdges; cnt++)
@@ -109,24 +117,24 @@ static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeInfoList *inNodeList,
         endNode   = edges[cnt].endNode;
         /* End Node is output node for the start Node so update
          * information in start node*/
         endNode   = edges[cnt].endNode;
         /* End Node is output node for the start Node so update
          * information in start node*/
-        index1 = nodes[startNode].output.numNodes;
-        nodes[startNode].output.node[index1] = &nodes[endNode];
-        nodes[startNode].output.numNodes++;
+        index1 = nodes[startNode].outputNodeSet.numNodes;
+        nodes[startNode].outputNodeSet.node[index1] = &nodes[endNode];
+        nodes[startNode].outputNodeSet.numNodes++;
         GT_assert(Fvid2Trace, (index1 < FVID2_GRAPH_MAX_NUM_PATHS));
 
         /* Start Node is input node for the end Node so update
          * information in end node*/
         GT_assert(Fvid2Trace, (index1 < FVID2_GRAPH_MAX_NUM_PATHS));
 
         /* Start Node is input node for the end Node so update
          * information in end node*/
-        index2 = nodes[endNode].input.numNodes;
-        nodes[endNode].input.node[index2] = &nodes[startNode];
-        nodes[endNode].input.numNodes++;
+        index2 = nodes[endNode].inputNodeSet.numNodes;
+        nodes[endNode].inputNodeSet.node[index2] = &nodes[startNode];
+        nodes[endNode].inputNodeSet.numNodes++;
         GT_assert(Fvid2Trace, (index2 < FVID2_GRAPH_MAX_NUM_PATHS));
 
         /* Dummy node's input is always enabled */
         if ((TRUE == nodes[endNode].isDummy) &&
             (TRUE == nodes[startNode].isDummy))
         {
         GT_assert(Fvid2Trace, (index2 < FVID2_GRAPH_MAX_NUM_PATHS));
 
         /* Dummy node's input is always enabled */
         if ((TRUE == nodes[endNode].isDummy) &&
             (TRUE == nodes[startNode].isDummy))
         {
-            nodes[startNode].output.isEnabled[index1] = TRUE;
-            nodes[endNode].input.isEnabled[index2]    = TRUE;
+            nodes[startNode].outputNodeSet.isEnabled[index1] = TRUE;
+            nodes[endNode].inputNodeSet.isEnabled[index2]    = TRUE;
         }
     }
 
         }
     }
 
@@ -139,8 +147,8 @@ static int32_t Fvid2_graphConnect(const Fvid2_GraphNodeInfoList *inNodeList,
  *  this static table.
  *  Called at the init time only
  */
  *  this static table.
  *  Called at the init time only
  */
-Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeInfoList *inNodeList,
-                                 const Fvid2_GraphEdgeInfoList *inEdgeList,
+Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeList *inNodeList,
+                                 const Fvid2_GraphEdgeList *inEdgeList,
                                  Fvid2_GraphInfo *graphHandle)
 {
     GT_assert(Fvid2Trace, (graphHandle != NULL));
                                  Fvid2_GraphInfo *graphHandle)
 {
     GT_assert(Fvid2Trace, (graphHandle != NULL));
@@ -152,8 +160,8 @@ Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeInfoList *inNodeList,
 
     graphHandle->nodeList->numNodes = inNodeList->numNodes;
     graphHandle->edgeList->numEdges = inEdgeList->numEdges;
 
     graphHandle->nodeList->numNodes = inNodeList->numNodes;
     graphHandle->edgeList->numEdges = inEdgeList->numEdges;
-    graphHandle->nodeList->list     = inNodeList->list;
-    graphHandle->edgeList->list     = inEdgeList->list;
+    graphHandle->nodeList->list = inNodeList->list;
+    graphHandle->edgeList->list = inEdgeList->list;
 
     Fvid2_graphConnect(inNodeList, inEdgeList);
     return graphHandle;
 
     Fvid2_graphConnect(inNodeList, inEdgeList);
     return graphHandle;
@@ -167,7 +175,7 @@ int32_t Fvid2_graphDeInit(Fvid2_GraphInfo *graphHandle)
 /** \brief Function to get the pointer to node for the given index
  */
 Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
 /** \brief Function to get the pointer to node for the given index
  */
 Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
-                            const Fvid2_GraphNodeInfoList *nodeList,
+                            const Fvid2_GraphNodeList *nodeList,
                             uint32_t cnt)
 {
     Fvid2_GraphNodeInfo *node = NULL;
                             uint32_t cnt)
 {
     Fvid2_GraphNodeInfo *node = NULL;
@@ -192,21 +200,21 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
  */
 
 uint32_t Fvid2_graphIsNodeInputAvailable(
  */
 
 uint32_t Fvid2_graphIsNodeInputAvailable(
-                            const Fvid2_GraphNodeInfoList *nodeList,
-                            uint32_t nodeNum)
+                            const Fvid2_GraphNodeList *nodeList,
+                            uint32_t nodeId)
 {
     uint32_t j;
     uint32_t retVal  = TRUE;
 {
     uint32_t j;
     uint32_t retVal  = TRUE;
-    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeNum);
+    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeId);
     if (NULL == curNode)
     {
         retVal = FALSE;
     }
     else
     {
     if (NULL == curNode)
     {
         retVal = FALSE;
     }
     else
     {
-        for (j = 0; j < curNode->input.numNodes; j++)
+        for (j = 0; j < curNode->inputNodeSet.numNodes; j++)
         {
         {
-            if (FVID2_GRAPH_NM_ENABLE == curNode->input.isEnabled[j])
+            if (FVID2_GRAPH_NODE_MODE_ENABLE == curNode->inputNodeSet.isEnabled[j])
             {
                 retVal = FALSE;
                 break;
             {
                 retVal = FALSE;
                 break;
@@ -217,21 +225,21 @@ uint32_t Fvid2_graphIsNodeInputAvailable(
 }
 
 uint32_t Fvid2_graphIsNodeOutputAvailable(
 }
 
 uint32_t Fvid2_graphIsNodeOutputAvailable(
-                            const Fvid2_GraphNodeInfoList *nodeList,
-                            uint32_t nodeNum)
+                            const Fvid2_GraphNodeList *nodeList,
+                            uint32_t nodeId)
 {
     uint32_t j;
     uint32_t retVal  = TRUE;
 {
     uint32_t j;
     uint32_t retVal  = TRUE;
-    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeNum);
+    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeId);
     if (NULL == curNode)
     {
         retVal = FALSE;
     }
     else
     {
     if (NULL == curNode)
     {
         retVal = FALSE;
     }
     else
     {
-        for (j = 0; j < curNode->output.numNodes; j++)
+        for (j = 0; j < curNode->outputNodeSet.numNodes; j++)
         {
         {
-            if (FVID2_GRAPH_NM_ENABLE == curNode->output.isEnabled[j])
+            if (FVID2_GRAPH_NODE_MODE_ENABLE == curNode->outputNodeSet.isEnabled[j])
             {
                 retVal = FALSE;
                 break;
             {
                 retVal = FALSE;
                 break;
@@ -241,9 +249,9 @@ uint32_t Fvid2_graphIsNodeOutputAvailable(
     return retVal;
 }
 
     return retVal;
 }
 
-int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
-                              const Fvid2_GraphEdgeInfoList *edgeList,
-                              Fvid2_GraphNodeMode mode)
+int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
+                              const Fvid2_GraphEdgeList *edgeList,
+                              uint32_t mode)
 {
     uint32_t i, j;
     int32_t retVal = FVID2_SOK;
 {
     uint32_t i, j;
     int32_t retVal = FVID2_SOK;
@@ -256,8 +264,8 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
         Fvid2_GraphNodeInfo *endNode = Fvid2_graphGetNodeInfo(
             nodeList, inputEdgeList[i].endNode);
         GT_assert(Fvid2Trace, (endNode != NULL));
         Fvid2_GraphNodeInfo *endNode = Fvid2_graphGetNodeInfo(
             nodeList, inputEdgeList[i].endNode);
         GT_assert(Fvid2Trace, (endNode != NULL));
-        if ((startNode->nodeNum == FVID2_GRAPH_INVALID_NODE_ID) &&
-            (endNode->nodeNum == FVID2_GRAPH_INVALID_NODE_ID))
+        if ((startNode->nodeId == FVID2_GRAPH_INVALID_NODE_ID) &&
+            (endNode->nodeId == FVID2_GRAPH_INVALID_NODE_ID))
         {
             break;
         }
         {
             break;
         }
@@ -268,44 +276,44 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
         /* Example: One handle connects one source for blender, Second handle */
         /*         connects second source for blender - Is such a case required?
         **/
         /* Example: One handle connects one source for blender, Second handle */
         /*         connects second source for blender - Is such a case required?
         **/
-        if (FVID2_GRAPH_NT_OUT_SINGLE == startNode->outType)
+        if (FVID2_GRAPH_NODE_OUT_SINGLE == startNode->nodeOutNum)
         {
             uint32_t inUse = FALSE;
         {
             uint32_t inUse = FALSE;
-            for (j = 0; j < startNode->output.numNodes; j++)
+            for (j = 0; j < startNode->outputNodeSet.numNodes; j++)
             {
             {
-                if (FVID2_GRAPH_NM_ENABLE == startNode->output.isEnabled[j])
+                if (FVID2_GRAPH_NODE_MODE_ENABLE == startNode->outputNodeSet.isEnabled[j])
                 {
                     inUse = TRUE;
                     break;
                 }
             }
                 {
                     inUse = TRUE;
                     break;
                 }
             }
-            if ((FALSE == inUse) || (FVID2_GRAPH_NM_DISABLE == mode))
+            if ((FALSE == inUse) || (FVID2_GRAPH_NODE_MODE_DISABLE == mode))
             {
             {
-                for (j = 0; j < startNode->output.numNodes; j++)
+                for (j = 0; j < startNode->outputNodeSet.numNodes; j++)
                 {
                 {
-                    if (startNode->output.node[j] == endNode)
+                    if (startNode->outputNodeSet.node[j] == endNode)
                     {
                     {
-                        startNode->output.isEnabled[j] = mode;
+                        startNode->outputNodeSet.isEnabled[j] = mode;
                         break;
                     }
                 }
                         break;
                     }
                 }
-                if (j == startNode->output.numNodes)
+                if (j == startNode->outputNodeSet.numNodes)
                 {
                     retVal = FVID2_EFAIL;
                 }
             }
         }
                 {
                     retVal = FVID2_EFAIL;
                 }
             }
         }
-        else if (FVID2_GRAPH_NT_OUT_MULTI == startNode->outType)
+        else if (FVID2_GRAPH_NODE_OUT_MULTI == startNode->nodeOutNum)
         {
         {
-            for (j = 0; j < startNode->output.numNodes; j++)
+            for (j = 0; j < startNode->outputNodeSet.numNodes; j++)
             {
             {
-                if (startNode->output.node[j] == endNode)
+                if (startNode->outputNodeSet.node[j] == endNode)
                 {
                 {
-                    startNode->output.isEnabled[j] = mode;
+                    startNode->outputNodeSet.isEnabled[j] = mode;
                     break;
                 }
             }
                     break;
                 }
             }
-            if (j == startNode->output.numNodes)
+            if (j == startNode->outputNodeSet.numNodes)
             {
                 retVal = FVID2_EFAIL;
             }
             {
                 retVal = FVID2_EFAIL;
             }
@@ -315,44 +323,44 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
             /*Do nothing */
         }
 
             /*Do nothing */
         }
 
-        if (FVID2_GRAPH_NT_IN_SINGLE == endNode->inType)
+        if (FVID2_GRAPH_NODE_IN_SINGLE == endNode->nodeInNum)
         {
             uint32_t inUse = FALSE;
         {
             uint32_t inUse = FALSE;
-            for (j = 0; j < endNode->input.numNodes; j++)
+            for (j = 0; j < endNode->inputNodeSet.numNodes; j++)
             {
             {
-                if (FVID2_GRAPH_NM_ENABLE == endNode->input.isEnabled[j])
+                if (FVID2_GRAPH_NODE_MODE_ENABLE == endNode->inputNodeSet.isEnabled[j])
                 {
                     inUse = TRUE;
                     break;
                 }
             }
                 {
                     inUse = TRUE;
                     break;
                 }
             }
-            if ((FALSE == inUse) || (FVID2_GRAPH_NM_DISABLE == mode))
+            if ((FALSE == inUse) || (FVID2_GRAPH_NODE_MODE_DISABLE == mode))
             {
             {
-                for (j = 0; j < endNode->input.numNodes; j++)
+                for (j = 0; j < endNode->inputNodeSet.numNodes; j++)
                 {
                 {
-                    if (endNode->input.node[j] == startNode)
+                    if (endNode->inputNodeSet.node[j] == startNode)
                     {
                     {
-                        endNode->input.isEnabled[j] = mode;
+                        endNode->inputNodeSet.isEnabled[j] = mode;
                         break;
                     }
                 }
                         break;
                     }
                 }
-                if (j == endNode->input.numNodes)
+                if (j == endNode->inputNodeSet.numNodes)
                 {
                     retVal = FVID2_EFAIL;
                 }
             }
         }
                 {
                     retVal = FVID2_EFAIL;
                 }
             }
         }
-        else if (FVID2_GRAPH_NT_IN_MULTI == endNode->inType)
+        else if (FVID2_GRAPH_NODE_IN_MULTI == endNode->nodeInNum)
         {
         {
-            for (j = 0; j < endNode->input.numNodes; j++)
+            for (j = 0; j < endNode->inputNodeSet.numNodes; j++)
             {
             {
-                if (endNode->input.node[j] == startNode)
+                if (endNode->inputNodeSet.node[j] == startNode)
                 {
                 {
-                    endNode->input.isEnabled[j] = mode;
+                    endNode->inputNodeSet.isEnabled[j] = mode;
                     break;
                 }
             }
                     break;
                 }
             }
-            if (j == endNode->input.numNodes)
+            if (j == endNode->inputNodeSet.numNodes)
             {
                 retVal = FVID2_EFAIL;
             }
             {
                 retVal = FVID2_EFAIL;
             }
@@ -399,10 +407,10 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
  *  main graph (as is done currently) since this will fail for multiple handle
  *  scenarios.
  */
  *  main graph (as is done currently) since this will fail for multiple handle
  *  scenarios.
  */
-int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeInfoList *inNodeList,
-                           const Fvid2_GraphEdgeInfoList *inEdgeList,
-                           Fvid2_GraphNodeInfoList *outNodeList,
-                           Fvid2_GraphEdgeInfoList *outEdgeList,
+int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
+                           const Fvid2_GraphEdgeList *inEdgeList,
+                           Fvid2_GraphNodeList *outNodeList,
+                           Fvid2_GraphEdgeList *outEdgeList,
                            uint32_t maxOutNodeCnt,
                            uint32_t maxOutEdgeCnt)
 {
                            uint32_t maxOutNodeCnt,
                            uint32_t maxOutEdgeCnt)
 {
@@ -455,9 +463,9 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeInfoList *inNodeList,
                             sizeof (Fvid2_GraphNodeInfo));
 
             /* Reset connection info from the original graph */
                             sizeof (Fvid2_GraphNodeInfo));
 
             /* Reset connection info from the original graph */
-            Fvid2Utils_memset((void *) (outNodeList->list[j].input.node), 0,
+            Fvid2Utils_memset((void *) (outNodeList->list[j].inputNodeSet.node), 0,
                               sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
                               sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
-            Fvid2Utils_memset((void *) (outNodeList->list[j].output.node), 0,
+            Fvid2Utils_memset((void *) (outNodeList->list[j].outputNodeSet.node), 0,
                               sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
             j++;
         }
                               sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
             j++;
         }
@@ -466,18 +474,18 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeInfoList *inNodeList,
     return FVID2_SOK;
 }
 
     return FVID2_SOK;
 }
 
-int32_t Fvid2_graphFreePath(Fvid2_GraphNodeInfoList *nodeList,
-                      Fvid2_GraphEdgeInfoList *edgeList)
+int32_t Fvid2_graphFreePath(Fvid2_GraphNodeList *nodeList,
+                      Fvid2_GraphEdgeList *edgeList)
 {
     if (NULL != nodeList->list)
     {
         nodeList->numNodes = 0;
 {
     if (NULL != nodeList->list)
     {
         nodeList->numNodes = 0;
-        nodeList->list     = NULL;
+        nodeList->list = NULL;
     }
     if (NULL != edgeList->list)
     {
         edgeList->numEdges = 0;
     }
     if (NULL != edgeList->list)
     {
         edgeList->numEdges = 0;
-        edgeList->list     = NULL;
+        edgeList->list = NULL;
     }
     return FVID2_SOK;
 }
     }
     return FVID2_SOK;
 }
@@ -521,7 +529,7 @@ static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node)
 {
     uint32_t visited = TRUE;
 
 {
     uint32_t visited = TRUE;
 
-    if (0 == gFvid2GraphNodeStack.isVisited[node->nodeNum])
+    if (0 == gFvid2GraphNodeStack.isVisited[node->nodeId])
     {
         visited = FALSE;
     }
     {
         visited = FALSE;
     }
@@ -534,8 +542,8 @@ int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
 {
     int32_t ret = (int32_t) TRUE;
 
 {
     int32_t ret = (int32_t) TRUE;
 
-    if (((TRUE == isForward) && (0 != currNode->output.numNodes)) ||
-        ((FALSE == isForward) && (0 != currNode->input.numNodes)))
+    if (((TRUE == isForward) && (0 != currNode->outputNodeSet.numNodes)) ||
+        ((FALSE == isForward) && (0 != currNode->inputNodeSet.numNodes)))
     {
         ret = (int32_t) FALSE;
     }
     {
         ret = (int32_t) FALSE;
     }
@@ -550,21 +558,21 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
 {
     Fvid2_GraphNodeInfo *node = NULL;
     uint32_t isEnabled = TRUE;
 {
     Fvid2_GraphNodeInfo *node = NULL;
     uint32_t isEnabled = TRUE;
-    uint32_t nodeNum, nextNodeNum;
+    uint32_t nodeId, nextNodeNum;
     uint32_t loopEnd = 1U;
 
     uint32_t loopEnd = 1U;
 
-    nodeNum = gFvid2GraphNodeStack.top;
-    nextNodeNum = (uint32_t) gFvid2GraphNodeStack.stNum[nodeNum];
+    nodeId = gFvid2GraphNodeStack.top;
+    nextNodeNum = (uint32_t) gFvid2GraphNodeStack.stNum[nodeId];
     do
     {
         /* Traversing from input Node to Venc Nodes */
         if (TRUE == isForward)
         {
             /* Get the next node from the output nodes */
     do
     {
         /* Traversing from input Node to Venc Nodes */
         if (TRUE == isForward)
         {
             /* Get the next node from the output nodes */
-            if (nextNodeNum < currNode->output.numNodes)
+            if (nextNodeNum < currNode->outputNodeSet.numNodes)
             {
             {
-                node = currNode->output.node[nextNodeNum];
-                isEnabled = currNode->output.isEnabled[nextNodeNum];
+                node = currNode->outputNodeSet.node[nextNodeNum];
+                isEnabled = currNode->outputNodeSet.isEnabled[nextNodeNum];
             }
             else
             {
             }
             else
             {
@@ -574,10 +582,10 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
         else  /* Traversing from Venc Nodes to input node */
         {
             /* Get the next node from the input nodes */
         else  /* Traversing from Venc Nodes to input node */
         {
             /* Get the next node from the input nodes */
-            if (nextNodeNum < currNode->input.numNodes)
+            if (nextNodeNum < currNode->inputNodeSet.numNodes)
             {
             {
-                node = currNode->input.node[(nextNodeNum)];
-                isEnabled = currNode->input.isEnabled[nextNodeNum];
+                node = currNode->inputNodeSet.node[(nextNodeNum)];
+                isEnabled = currNode->inputNodeSet.isEnabled[nextNodeNum];
             }
             else
             {
             }
             else
             {
@@ -597,7 +605,7 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
     }
     else
     {
     }
     else
     {
-        gFvid2GraphNodeStack.stNum[nodeNum] = (int32_t) nextNodeNum;
+        gFvid2GraphNodeStack.stNum[nodeId] = (int32_t) nextNodeNum;
     }
     return (node);
 }
     }
     return (node);
 }
@@ -611,13 +619,13 @@ Fvid2_GraphNodeInfo *Fvid2_graphStackPeak(uint32_t *stNum)
 
 Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward)
 {
 
 Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward)
 {
-    uint32_t nodeNum;
+    uint32_t nodeId;
     Fvid2_GraphNodeInfo *currNode = NULL, *nextNode = NULL;
 
     while (gFvid2GraphNodeStack.top > (-(int32_t)1))
     {
         /* Get the stack top node */
     Fvid2_GraphNodeInfo *currNode = NULL, *nextNode = NULL;
 
     while (gFvid2GraphNodeStack.top > (-(int32_t)1))
     {
         /* Get the stack top node */
-        currNode = Fvid2_graphStackPeak(&nodeNum);
+        currNode = Fvid2_graphStackPeak(&nodeId);
 
         if (FALSE == Fvid2_graphStackIsVisited(currNode))
         {
 
         if (FALSE == Fvid2_graphStackIsVisited(currNode))
         {
@@ -650,8 +658,8 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward)
 
     if (NULL != currNode)
     {
 
     if (NULL != currNode)
     {
-        nodeNum = currNode->nodeNum;
-        gFvid2GraphNodeStack.isVisited[nodeNum] = (uint8_t) 1;
+        nodeId = currNode->nodeId;
+        gFvid2GraphNodeStack.isVisited[nodeId] = (uint8_t) 1;
     }
 
     return (currNode);
     }
 
     return (currNode);