Minor Clean ups for graph
authorRishabh Garg <rishabh@ti.com>
Tue, 24 Apr 2018 09:28:31 +0000 (14:58 +0530)
committerRishabh Garg <rishabh@ti.com>
Tue, 24 Apr 2018 13:00:10 +0000 (18:30 +0530)
- These changes are needed for graph implementation in DCTRL

Signed-off-by: Rishabh Garg <rishabh@ti.com>
include/fvid2_graph.h
src/fvid2_graph.c

index deba224c1b7f86b1fd8fd0337bb97e9a797a46b9..9f15db3814cfafb74c21cb0abba5783b3a9975dd 100755 (executable)
@@ -53,79 +53,144 @@ extern "C" {
 /*                           Macros & Typedefs                                */
 /* ========================================================================== */
 
+/**
+ *  \brief Graph Alignment
+ */
 #define FVID2_GRAPH_DEF_ALIGN        ((uint32_t) 16U)
-#define FVID2_GRAPH_INVALID_NODE_ID  ((uint32_t) 0U)
-#define FVID2_GRAPH_MAX_NODES        ((uint32_t) 80U)
+
+/**
+ *  \brief Invalid Node Id
+ */
+#define FVID2_GRAPH_INVALID_NODE_ID  ((uint32_t) 0xFFU)
+
+/**
+ *  \brief Maximum number of nodes
+ */
+#define FVID2_GRAPH_MAX_NODES        ((uint32_t) 10U)
+
+/**
+ *  \brief Maximum number of paths
+ */
 #define FVID2_GRAPH_MAX_NUM_PATHS    ((uint32_t) 20U)
 
-typedef enum
-{
-    FVID2_GRAPH_NM_DISABLE,
-    FVID2_GRAPH_NM_ENABLE,
-    FVID2_GRAPH_NM_CHECK
-} Fvid2_GraphNodeMode;
+/**
+ *  \anchor Fvid2_GraphNodeMode
+ *  \name   Mode of the node
+ *
+ *  @{
+ */
+/** \brief  Disable mode */
+#define FVID2_GRAPH_NODE_MODE_DISABLE            ((uint32_t) 0x0U)
+/** \brief Enable mode */
+#define FVID2_GRAPH_NODE_MODE_ENABLE             ((uint32_t) 0x1U)
+/** \brief Check Mode */
+#define FVID2_GRAPH_NODE_MODE_CHECK              ((uint32_t) 0x2U)
+/* @} */
 
-typedef enum
-{
-    FVID2_GRAPH_NT_DUMMY,
-    FVID2_GRAPH_NT_DSS,  /* DSS */
-    FVID2_GRAPH_NT_MAX_NODETYPE
-} Fvid2_GraphNodeTypes;
+/**
+ *  \anchor Fvid2_GraphNodeType
+ *  \name   Node Type
+ *
+ *  @{
+ */
+/** \brief Node type is dummy */
+#define FVID2_GRAPH_NODE_TYPE_DUMMY            ((uint32_t) 0x0U)
+/** \brief Node type is DSS Pipe */
+#define FVID2_GRAPH_NODE_TYPE_DSS_PIPE         ((uint32_t) 0x1U)
+/** \brief Node type is DSS Overlay */
+#define FVID2_GRAPH_NODE_TYPE_DSS_OVERLAY      ((uint32_t) 0x2U)
+/** \brief Node type is DSS Video Port */
+#define FVID2_GRAPH_NODE_TYPE_DSS_VP           ((uint32_t) 0x3U)
+/** \brief Node type is DSS Output */
+#define FVID2_GRAPH_NODE_TYPE_DSS_OUT          ((uint32_t) 0x4U)
+/** \brief Maximum Node types */
+#define FVID2_GRAPH_NODE_TYPE_MAX              ((uint32_t) 0x5U)
+/* @} */
 
-typedef enum
-{
-    FVID2_GRAPH_NT_IN_SINGLE,
-    FVID2_GRAPH_NT_IN_MULTI,
-    FVID2_GRAPH_NT_IN_EMPTY
-} Fvid2_GraphNodeInputType;
+/**
+ *  \anchor Fvid2_GraphNodeInputNum
+ *  \name   Number of inputs to a particular node
+ *
+ *  @{
+ */
+/** \brief No Input */
+#define FVID2_GRAPH_NODE_IN_NONE               ((uint32_t) 0x0U)
+/** \brief Single Input */
+#define FVID2_GRAPH_NODE_IN_SINGLE             ((uint32_t) 0x1U)
+/** \brief Multiple Inputs */
+#define FVID2_GRAPH_NODE_IN_MULTI              ((uint32_t) 0x2U)
+/* @} */
 
-typedef enum
-{
-    FVID2_GRAPH_NT_OUT_SINGLE,
-    FVID2_GRAPH_NT_OUT_MULTI,
-    FVID2_GRAPH_NT_OUT_EMPTY
-} Fvid2_GraphNodeOutputType;
+/**
+ *  \anchor Fvid2_GraphNodeOutputNum
+ *  \name   Number of outputs from a particular node
+ *
+ *  @{
+ */
+/** \brief No Output */
+#define FVID2_GRAPH_NODE_OUT_NONE              ((uint32_t) 0x0U)
+/** \brief Single Output */
+#define FVID2_GRAPH_NODE_OUT_SINGLE            ((uint32_t) 0x1U)
+/** \brief Multiple Outputs */
+#define FVID2_GRAPH_NODE_OUT_MULTI             ((uint32_t) 0x2U)
+/* @} */
 
 /* ========================================================================== */
 /*                         Structure Declarations                             */
 /* ========================================================================== */
 
+/** \brief Forward declaration for Node Information. */
 typedef struct Fvid2_GraphNodeInfo_t Fvid2_GraphNodeInfo;
 
-typedef struct Fvid2_GraphNodeSet_t
+/**
+ *  \brief Structure containing Node Set Configuration.
+ */
+typedef struct
 {
-    uint32_t                numNodes;
+    uint32_t numNodes;
     /**< Number of input/output nodes */
-    Fvid2_GraphNodeInfo    *node[FVID2_GRAPH_MAX_NUM_PATHS];
+    Fvid2_GraphNodeInfo *node[FVID2_GRAPH_MAX_NUM_PATHS];
     /**< Pointer to the input/output node */
-    uint32_t                isEnabled[FVID2_GRAPH_MAX_NUM_PATHS];
+    uint32_t isEnabled[FVID2_GRAPH_MAX_NUM_PATHS];
     /**< Flag to indicate whether input/output is enabled or not. */
 } Fvid2_GraphNodeSet;
 
+/**
+ *  \brief Structure containing Node Information.
+ */
 struct Fvid2_GraphNodeInfo_t
 {
-    /*Used to select config structure from the CreateParams */
-    uint32_t                    nodeNum;
-
-    /* Tree-connections */
-    Fvid2_GraphNodeInputType    inType;
-    Fvid2_GraphNodeOutputType   outType;
-
-    /* SI/SO/MI/MO */
-    uint32_t                    nodeType;
-    
-    void                       *corePtr;
-    uint32_t                    isDummy;
-    uint32_t                    inUse;
-    Fvid2_GraphNodeSet          input;
-    Fvid2_GraphNodeSet          output;
+    uint32_t nodeId;
+    /**< Node Id */
+    uint32_t nodeInNum;
+    /**< Number of inputs to this particular node. Refer \ref
+     *   Fvid2_GraphNodeInputNum for values */
+    uint32_t nodeOutNum;
+    /**< Number of outputs from this particular node. Refer \ref
+     *   Fvid2_GraphNodeOutputNum for values */
+    uint32_t nodeType;
+    /**< Node type for the particular node. Refer \ref Fvid2_GraphNodeType
+     *   for values */
+    uint32_t isDummy;
+    /**< Variable defining whether node type is dummy */
+    uint32_t inUse;
+    /**< Variable defining whether node is used in the present context */
+    Fvid2_GraphNodeSet inputNodeSet;
+    /**< Input Node Set */
+    Fvid2_GraphNodeSet outputNodeSet;
+    /**< Output Node Set */
 };
 
+/**
+ *  \brief Structure containing Node List
+ */
 typedef struct
 {
-    uint32_t                    numNodes;
-    Fvid2_GraphNodeInfo        *list;
-} Fvid2_GraphNodeInfoList;
+    uint32_t numNodes;
+    /**< Number of nodes */
+    Fvid2_GraphNodeInfo *list;
+    /**< Pointer to node list */
+} Fvid2_GraphNodeList;
 
 /**
  * \brief Structure containing edge information. Edge is a connection
@@ -141,47 +206,55 @@ typedef struct
     /**< End node of the edge */
 } Fvid2_GraphEdgeInfo;
 
+/**
+ *  \brief Structure containing Edge List.
+ */
 typedef struct
 {
-    uint32_t                numEdges;
+    uint32_t numEdges;
     /**< Number of the edge */
-    Fvid2_GraphEdgeInfo    *list;
+    Fvid2_GraphEdgeInfo *list;
     /**< Edge list */
-} Fvid2_GraphEdgeInfoList;
+} Fvid2_GraphEdgeList;
 
+/**
+ *  \brief Structure containing Graph information.
+ */
 typedef struct
 {
-    Fvid2_GraphNodeInfoList    *nodeList;
-    Fvid2_GraphEdgeInfoList    *edgeList;
+    Fvid2_GraphNodeList *nodeList;
+    /**< Node list of the graph */
+    Fvid2_GraphEdgeList *edgeList;
+    /**< Edge list of the graph */
 } Fvid2_GraphInfo;
 
 /* ========================================================================== */
 /*                          Function Declarations                             */
 /* ========================================================================== */
 
-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);
 
 int32_t Fvid2_graphDeInit(Fvid2_GraphInfo *graphHandle);
 
 Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
-                            const Fvid2_GraphNodeInfoList *nodeList,
+                            const Fvid2_GraphNodeList *nodeList,
                             uint32_t cnt);
 
-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); /* Fvid2_GraphNodeMode */
 
-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);
 
-int32_t Fvid2_graphFreePath(Fvid2_GraphNodeInfoList *nodeList,
-                      Fvid2_GraphEdgeInfoList *edgeList);
+int32_t Fvid2_graphFreePath(Fvid2_GraphNodeList *nodeList,
+                            Fvid2_GraphEdgeList *edgeList);
 
 int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
                                    uint32_t isForward);
@@ -191,12 +264,12 @@ void Fvid2_graphStackInitTraverser(Fvid2_GraphNodeInfo *node);
 Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward);
 
 uint32_t Fvid2_graphIsNodeInputAvailable(
-                            const Fvid2_GraphNodeInfoList *nodeList,
-                            uint32_t nodeNum);
+                            const Fvid2_GraphNodeList *nodeList,
+                            uint32_t nodeId);
 
 uint32_t Fvid2_graphIsNodeOutputAvailable(
-                            const Fvid2_GraphNodeInfoList *nodeList,
-                            uint32_t nodeNum);
+                            const Fvid2_GraphNodeList *nodeList,
+                            uint32_t nodeId);
 
 void Fvid2_graphInitTraverser(Fvid2_GraphNodeInfo *node);
 
index 581dc0c8947a761689705f07b91732b19d32c4f9..66a6cd3aeae8b9883532a4b8e7a13c80f9894b84 100755 (executable)
 /*                         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 */
@@ -71,12 +74,17 @@ typedef struct Fvid2_GraphStack_t
 /*                         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_graphStackPush(Fvid2_GraphNodeInfo *node);
+
 static void Fvid2_graphStackPop(void);
+
 static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node);
+
 int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
                                    uint32_t isForward);
 
@@ -91,16 +99,16 @@ static Fvid2_GraphStack gFvid2GraphNodeStack;
 /* ========================================================================== */
 
 /* 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++)
     {
-        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++)
@@ -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*/
-        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*/
-        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))
         {
-            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
  */
-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));
@@ -152,8 +160,8 @@ Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeInfoList *inNodeList,
 
     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;
@@ -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(
-                            const Fvid2_GraphNodeInfoList *nodeList,
+                            const Fvid2_GraphNodeList *nodeList,
                             uint32_t cnt)
 {
     Fvid2_GraphNodeInfo *node = NULL;
@@ -192,21 +200,21 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
  */
 
 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;
-    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeNum);
+    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeId);
     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;
@@ -217,21 +225,21 @@ uint32_t Fvid2_graphIsNodeInputAvailable(
 }
 
 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;
-    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeNum);
+    Fvid2_GraphNodeInfo *curNode = Fvid2_graphGetNodeInfo(nodeList, nodeId);
     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;
@@ -241,9 +249,9 @@ uint32_t Fvid2_graphIsNodeOutputAvailable(
     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;
@@ -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));
-        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;
         }
@@ -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?
         **/
-        if (FVID2_GRAPH_NT_OUT_SINGLE == startNode->outType)
+        if (FVID2_GRAPH_NODE_OUT_SINGLE == startNode->nodeOutNum)
         {
             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;
                 }
             }
-            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;
                     }
                 }
-                if (j == startNode->output.numNodes)
+                if (j == startNode->outputNodeSet.numNodes)
                 {
                     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;
                 }
             }
-            if (j == startNode->output.numNodes)
+            if (j == startNode->outputNodeSet.numNodes)
             {
                 retVal = FVID2_EFAIL;
             }
@@ -315,44 +323,44 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeInfoList *nodeList,
             /*Do nothing */
         }
 
-        if (FVID2_GRAPH_NT_IN_SINGLE == endNode->inType)
+        if (FVID2_GRAPH_NODE_IN_SINGLE == endNode->nodeInNum)
         {
             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;
                 }
             }
-            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;
                     }
                 }
-                if (j == endNode->input.numNodes)
+                if (j == endNode->inputNodeSet.numNodes)
                 {
                     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;
                 }
             }
-            if (j == endNode->input.numNodes)
+            if (j == endNode->inputNodeSet.numNodes)
             {
                 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.
  */
-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)
 {
@@ -455,9 +463,9 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeInfoList *inNodeList,
                             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);
-            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++;
         }
@@ -466,18 +474,18 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeInfoList *inNodeList,
     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;
-        nodeList->list     = NULL;
+        nodeList->list = NULL;
     }
     if (NULL != edgeList->list)
     {
         edgeList->numEdges = 0;
-        edgeList->list     = NULL;
+        edgeList->list = NULL;
     }
     return FVID2_SOK;
 }
@@ -521,7 +529,7 @@ static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node)
 {
     uint32_t visited = TRUE;
 
-    if (0 == gFvid2GraphNodeStack.isVisited[node->nodeNum])
+    if (0 == gFvid2GraphNodeStack.isVisited[node->nodeId])
     {
         visited = FALSE;
     }
@@ -534,8 +542,8 @@ int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
 {
     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;
     }
@@ -550,21 +558,21 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
 {
     Fvid2_GraphNodeInfo *node = NULL;
     uint32_t isEnabled = TRUE;
-    uint32_t nodeNum, nextNodeNum;
+    uint32_t nodeId, nextNodeNum;
     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 */
-            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
             {
@@ -574,10 +582,10 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
         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
             {
@@ -597,7 +605,7 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
     }
     else
     {
-        gFvid2GraphNodeStack.stNum[nodeNum] = (int32_t) nextNodeNum;
+        gFvid2GraphNodeStack.stNum[nodeId] = (int32_t) nextNodeNum;
     }
     return (node);
 }
@@ -611,13 +619,13 @@ Fvid2_GraphNodeInfo *Fvid2_graphStackPeak(uint32_t *stNum)
 
 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 */
-        currNode = Fvid2_graphStackPeak(&nodeNum);
+        currNode = Fvid2_graphStackPeak(&nodeId);
 
         if (FALSE == Fvid2_graphStackIsVisited(currNode))
         {
@@ -650,8 +658,8 @@ Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward)
 
     if (NULL != currNode)
     {
-        nodeNum = currNode->nodeNum;
-        gFvid2GraphNodeStack.isVisited[nodeNum] = (uint8_t) 1;
+        nodeId = currNode->nodeId;
+        gFvid2GraphNodeStack.isVisited[nodeId] = (uint8_t) 1;
     }
 
     return (currNode);