PDK-2676 Fixed FVID2 doxygen warnings DEV.FVID2.01.00.00.00 DEV.PROCESSOR-SDK.05.01.00.10 DEV.PROCESSOR-SDK.05.01.00.11
authorRishabh Garg <rishabh@ti.com>
Tue, 18 Sep 2018 12:59:17 +0000 (18:29 +0530)
committerRishabh Garg <rishabh@ti.com>
Tue, 18 Sep 2018 12:59:17 +0000 (18:29 +0530)
Signed-off-by: Rishabh Garg <rishabh@ti.com>
include/fvid2_graph.h
include/fvid2_utils.h
src/fvid2_graph.c

index abbfd69092472f11eebb8a311f0d0e53e53cb7d6..4bb729cb0d76fc1cd1e40b024d597a87158020bc 100755 (executable)
@@ -232,20 +232,100 @@ typedef struct
 /*                          Function Declarations                             */
 /* ========================================================================== */
 
+/**
+ *  \brief Initialize the fvid2 graph.
+ *
+ *  \param inNodeList   Pointer to list of nodes.
+ *                      Refer #Fvid2_GraphNodeList for details
+ *  \param inEdgeList   Pointer to list of edges.
+ *                      Refer #Fvid2_GraphEdgeList for details
+ *  \param graphHandle  Graph handle.
+ *
+ *  \return Graph Handle
+ */
 Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeList *inNodeList,
                                  const Fvid2_GraphEdgeList *inEdgeList,
                                  Fvid2_GraphInfo *graphHandle);
 
+/**
+ *  \brief Un-initialize the fvid2 graph.
+ *
+ *  \param graphHandle  Graph handle.
+ *
+ *  \return status
+ */
 int32_t Fvid2_graphDeInit(Fvid2_GraphInfo *graphHandle);
 
-Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
-                            const Fvid2_GraphNodeList *nodeList,
-                            uint32_t cnt);
+/**
+ *  \brief Function to get the pointer to node for the given index.
+ *
+ *  \param nodeList     Pointer to list of nodes.
+ *                      Refer #Fvid2_GraphNodeList for details
+ *  \param nodeIndex    Node index.
+ *
+ *  \return Node information.
+ */
+Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(const Fvid2_GraphNodeList *nodeList,
+                                            uint32_t nodeIndex);
 
+/**
+ *  \brief Function to check if the particular input node is available.
+ *
+ *  \param nodeList     Pointer to list of nodes.
+ *                      Refer #Fvid2_GraphNodeList for details
+ *  \param nodeId       Node Id
+ *
+ *  \return TRUE if available else FALSE.
+ */
+uint32_t Fvid2_graphIsNodeInputAvailable(const Fvid2_GraphNodeList *nodeList,
+                                         uint32_t nodeId);
+
+/**
+ *  \brief Function to check if the particular output node is available.
+ *
+ *  \param nodeList     Pointer to list of nodes.
+ *                      Refer #Fvid2_GraphNodeList for details
+ *  \param nodeId       Node Id
+ *
+ *  \return TRUE if available else FALSE.
+ */
+uint32_t Fvid2_graphIsNodeOutputAvailable(const Fvid2_GraphNodeList *nodeList,
+                                          uint32_t nodeId);
+
+/**
+ *  \brief This function allocates nodes within the graph by enabling specified
+ *         edges. To enable an edge, it enables output of source node and
+ *         enables input of the target node.
+ *
+ *  \param nodeList       Pointer to list of nodes.
+ *                        Refer #Fvid2_GraphNodeList for details
+ *  \param edgeList       Pointer to list of edges.
+ *                        Refer #Fvid2_GraphEdgeList for details
+ *  \param graphNodeMode  Node mode. Refer \ref Fvid2_GraphNodeMode for values.
+ *
+ *  \return Returns error if a node is already active.
+ */
 int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
                               const Fvid2_GraphEdgeList *edgeList,
-                              uint32_t mode); /* Fvid2_GraphNodeMode */
+                              uint32_t graphNodeMode);
 
+/**
+ *  \brief This function gets a list of valid nodes in an edge list and
+ *         also enables the input in each entry.
+ *
+ *  \param inNodeList     Pointer to list of nodes that are input to this API.
+ *                        Refer #Fvid2_GraphNodeList for details
+ *  \param inEdgeList     Pointer to list of edges that are input to this API.
+ *                        Refer #Fvid2_GraphEdgeList for details
+ *  \param outNodeList    Pointer to list of nodes that are output from this API
+ *                        Refer #Fvid2_GraphNodeList for details
+ *  \param outEdgeList    Pointer to list of edges that are output from this API
+ *                        Refer #Fvid2_GraphEdgeList for details
+ *  \param maxOutNodeCnt  Output node count
+ *  \param maxOutEdgeCnt  Output edge count
+ *
+ *  \return status
+ */
 int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
                            const Fvid2_GraphEdgeList *inEdgeList,
                            Fvid2_GraphNodeList *outNodeList,
@@ -253,34 +333,38 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
                            uint32_t maxOutNodeCnt,
                            uint32_t maxOutEdgeCnt);
 
+/**
+ *  \brief This function sets graph nodes and edges to free.
+ *
+ *  \param nodeList   Pointer to list of nodes.
+ *                    Refer #Fvid2_GraphNodeList for details
+ *  \param edgeList   Pointer to list of edges.
+ *                    Refer #Fvid2_GraphEdgeList for details
+ *
+ *  \return status
+ */
 int32_t Fvid2_graphFreePath(Fvid2_GraphNodeList *nodeList,
                             Fvid2_GraphEdgeList *edgeList);
 
-int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
-                                   uint32_t isForward);
-
-void Fvid2_graphStackInitTraverser(Fvid2_GraphNodeInfo *node);
-
-Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward);
-
-uint32_t Fvid2_graphIsNodeInputAvailable(
-                            const Fvid2_GraphNodeList *nodeList,
-                            uint32_t nodeId);
-
-uint32_t Fvid2_graphIsNodeOutputAvailable(
-                            const Fvid2_GraphNodeList *nodeList,
-                            uint32_t nodeId);
-
-void Fvid2_graphInitTraverser(Fvid2_GraphNodeInfo *node);
-
-Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
-                            const Fvid2_GraphNodeInfo *currNode,
-                            uint32_t isForward);
-
-Fvid2_GraphNodeInfo *Fvid2_graphStackPeak(uint32_t *stNum);
-
+/**
+ *  \brief This function finds the enabled node within the array.
+ *
+ *  \param array  Pointer to list of nodes.
+ *  \param size   Size of array.
+ *
+ *  \return Index of enabled node.
+ */
 int32_t Fvid2_graphGetEnabledIndex(const uint32_t *array, uint32_t size);
 
+/**
+ *  \brief This function adds an edge between two nodes.
+ *
+ *  \param edge        Pointer to edge. Refer #Fvid2_GraphEdgeInfo for details
+ *  \param startNode   Start Node
+ *  \param endNode     End Node
+ *
+ *  \return None
+ */
 void Fvid2_graphAddEdge(Fvid2_GraphEdgeInfo *edge,
                         uint32_t startNode,
                         uint32_t endNode);
index 9d1d82523054dc27df71b8b6700cdc81a420f63c..03b828aa5884bda99afe148d9610a304d74b3751 100755 (executable)
@@ -59,7 +59,7 @@ extern "C" {
 /** \brief Log enable for FVID2 Utils. */
 #define Fvid2Trace                      (GT_DEFAULT_MASK)
 
-/**< \brief Number of timestamp log entries. */
+/** \brief Number of timestamps. */
 #define FVID2UTILS_NUM_TIMESTAMP_LOG    (100U)
 
 /**
@@ -669,7 +669,10 @@ static inline void Fvid2Utils_startTsPrfLog(Fvid2Utils_TsPrfLog *tsPrf);
  */
 static inline void Fvid2Utils_endTsPrfLog(Fvid2Utils_TsPrfLog *tsPrf);
 
-//TODO
+/**
+ *  Osal_getTimestamp64
+ *  \brief This API gets the 64 bit time stamp.
+ */
 static inline uint64_t Osal_getTimestamp64(void);
 
 /* ========================================================================== */
index f641233e93798583a0f369684a2c8af40ff71877..c5bb1b560370fc42755ca9ab04ed6920faed8ec3 100755 (executable)
 /*                         Structure Declarations                             */
 /* ========================================================================== */
 
-/**
- *  \brief Structure describing graph stack.
- */
-typedef struct
-{
-    Fvid2_GraphNodeInfo *node[FVID2_GRAPH_MAX_NODES];
-    /**< Array of node pointers */
-    int32_t stNum[FVID2_GRAPH_MAX_NODES];
-    /**< Keeps track of which child of this node is next to be visited, on
-     *   the stack for a node. */
-    uint8_t isVisited[FVID2_GRAPH_MAX_NODES];
-    /**< Flag keeps track of whether given node is visited or not */
-    int32_t top;
-    /**< Top marker of the stack */
-} Fvid2_GraphStack;
+/* None */
 
 /* ========================================================================== */
 /*                         Internal Function Declarations                     */
@@ -77,76 +63,16 @@ typedef struct
 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);
-
 /* ========================================================================== */
 /*                            Global Variables                                */
 /* ========================================================================== */
 
-static Fvid2_GraphStack gFvid2GraphNodeStack;
+/* None */
 
 /* ========================================================================== */
 /*                          Function Definitions                              */
 /* ========================================================================== */
 
-/* Helper function */
-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].inputNodeSet, 0, sizeof (Fvid2_GraphNodeSet));
-        Fvid2Utils_memset(&nodes[cnt].outputNodeSet, 0, sizeof (Fvid2_GraphNodeSet));
-    }
-
-    for (cnt = 0U; cnt < inEdgeList->numEdges; cnt++)
-    {
-        startNode = edges[cnt].startNode;
-        endNode   = edges[cnt].endNode;
-        /* End Node is output node for the start Node so update
-         * information in start node*/
-        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].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].outputNodeSet.isEnabled[index1] = TRUE;
-            nodes[endNode].inputNodeSet.isEnabled[index2]    = TRUE;
-        }
-    }
-
-    return FVID2_SOK;
-}
-
-/** \brief Creates static DSS topology for the fixed edges/nodes. There
- *  are some dummy nodes in the DSS topology. Input and output of these
- *  nodes are always enabled and cannot be changed. This function creates
- *  this static table.
- *  Called at the init time only
- */
 Fvid2_GraphInfo *Fvid2_graphInit(const Fvid2_GraphNodeList *inNodeList,
                                  const Fvid2_GraphEdgeList *inEdgeList,
                                  Fvid2_GraphInfo *graphHandle)
@@ -172,33 +98,18 @@ int32_t Fvid2_graphDeInit(Fvid2_GraphInfo *graphHandle)
     return FVID2_SOK;
 }
 
-/** \brief Function to get the pointer to node for the given index
- */
 Fvid2_GraphNodeInfo *Fvid2_graphGetNodeInfo(
                             const Fvid2_GraphNodeList *nodeList,
-                            uint32_t cnt)
+                            uint32_t nodeIndex)
 {
     Fvid2_GraphNodeInfo *node = NULL;
-    if (cnt < nodeList->numNodes)
+    if (nodeIndex < nodeList->numNodes)
     {
-        node = &nodeList->list[cnt];
+        node = &nodeList->list[nodeIndex];
     }
     return (node);
 }
 
-/** \brief This function allocates nodes within the CORE by enabling
- *  specified edges.
- *
- *  To enable an edge, it enables output of source node and
- *  enables input of the target node.
- *
- *  Returns error if a node is already active.
- *
- *  TODO: First edge is assumed as input, Why/How to disable edges?,
- *  Multiple handle support.
- *  TODO: If FAIL, run through again and disable if anything was enabled.
- */
-
 uint32_t Fvid2_graphIsNodeInputAvailable(
                             const Fvid2_GraphNodeList *nodeList,
                             uint32_t nodeId)
@@ -214,7 +125,8 @@ uint32_t Fvid2_graphIsNodeInputAvailable(
     {
         for (j = 0; j < curNode->inputNodeSet.numNodes; j++)
         {
-            if (FVID2_GRAPH_NODE_MODE_ENABLE == curNode->inputNodeSet.isEnabled[j])
+            if (FVID2_GRAPH_NODE_MODE_ENABLE ==
+                                            curNode->inputNodeSet.isEnabled[j])
             {
                 retVal = FALSE;
                 break;
@@ -239,7 +151,8 @@ uint32_t Fvid2_graphIsNodeOutputAvailable(
     {
         for (j = 0; j < curNode->outputNodeSet.numNodes; j++)
         {
-            if (FVID2_GRAPH_NODE_MODE_ENABLE == curNode->outputNodeSet.isEnabled[j])
+            if (FVID2_GRAPH_NODE_MODE_ENABLE ==
+                                            curNode->outputNodeSet.isEnabled[j])
             {
                 retVal = FALSE;
                 break;
@@ -251,7 +164,7 @@ uint32_t Fvid2_graphIsNodeOutputAvailable(
 
 int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
                               const Fvid2_GraphEdgeList *edgeList,
-                              uint32_t mode)
+                              uint32_t graphNodeMode)
 {
     uint32_t i, j;
     int32_t retVal = FVID2_SOK;
@@ -270,30 +183,27 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
             break;
         }
 
-        /* TODO: Multiple connections from different path probably does not work
-        **/
-        /*      here. Will it be ever required? */
-        /* Example: One handle connects one source for blender, Second handle */
-        /*         connects second source for blender - Is such a case required?
-        **/
+        /* Multiple connections from different path does not work */
         if (FVID2_GRAPH_NODE_OUT_SINGLE == startNode->nodeOutNum)
         {
             uint32_t inUse = FALSE;
             for (j = 0; j < startNode->outputNodeSet.numNodes; j++)
             {
-                if (FVID2_GRAPH_NODE_MODE_ENABLE == startNode->outputNodeSet.isEnabled[j])
+                if (FVID2_GRAPH_NODE_MODE_ENABLE ==
+                                        startNode->outputNodeSet.isEnabled[j])
                 {
                     inUse = TRUE;
                     break;
                 }
             }
-            if ((FALSE == inUse) || (FVID2_GRAPH_NODE_MODE_DISABLE == mode))
+            if ((FALSE == inUse) ||
+                (FVID2_GRAPH_NODE_MODE_DISABLE == graphNodeMode))
             {
                 for (j = 0; j < startNode->outputNodeSet.numNodes; j++)
                 {
                     if (startNode->outputNodeSet.node[j] == endNode)
                     {
-                        startNode->outputNodeSet.isEnabled[j] = mode;
+                        startNode->outputNodeSet.isEnabled[j] = graphNodeMode;
                         break;
                     }
                 }
@@ -309,7 +219,7 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
             {
                 if (startNode->outputNodeSet.node[j] == endNode)
                 {
-                    startNode->outputNodeSet.isEnabled[j] = mode;
+                    startNode->outputNodeSet.isEnabled[j] = graphNodeMode;
                     break;
                 }
             }
@@ -334,13 +244,14 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
                     break;
                 }
             }
-            if ((FALSE == inUse) || (FVID2_GRAPH_NODE_MODE_DISABLE == mode))
+            if ((FALSE == inUse) ||
+                (FVID2_GRAPH_NODE_MODE_DISABLE == graphNodeMode))
             {
                 for (j = 0; j < endNode->inputNodeSet.numNodes; j++)
                 {
                     if (endNode->inputNodeSet.node[j] == startNode)
                     {
-                        endNode->inputNodeSet.isEnabled[j] = mode;
+                        endNode->inputNodeSet.isEnabled[j] = graphNodeMode;
                         break;
                     }
                 }
@@ -356,7 +267,7 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
             {
                 if (endNode->inputNodeSet.node[j] == startNode)
                 {
-                    endNode->inputNodeSet.isEnabled[j] = mode;
+                    endNode->inputNodeSet.isEnabled[j] = graphNodeMode;
                     break;
                 }
             }
@@ -374,39 +285,6 @@ int32_t Fvid2_graphAllocNodes(const Fvid2_GraphNodeList *nodeList,
     return retVal;
 }
 
-/**
- * findPath()
- */
-/**
- * Inputs
- * PORTA/B_08/16/24
- * isCSCEnabled
- * isSCEnabled
- */
-/**
- * Algo:
- * Decide FirstNode
- * Decide LastNodes
- * curNode = FirstNode
- * if(isCSCEnabled) {join curNode to CSC; curNode = CSC}
- * if(isSCEnabled)  {join curNode to SC; curNode = SC}
- * foreach(LastNode_option1, LastNode_option2)
- * {
- * join curNode to LastNode
- * if (successful) break
- * else next
- * }
- */
-
-/** \brief This function gets a list of valid nodes in an edge list and
- *  also enable the input in each entry. Fill in VpsCore_VipPathObj
- *
- *  Should be called only after Fvid2_graphAllocNodes() is successful
- *
- *  TODO: Connections should be made in this function and not copied from
- *  main graph (as is done currently) since this will fail for multiple handle
- *  scenarios.
- */
 int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
                            const Fvid2_GraphEdgeList *inEdgeList,
                            Fvid2_GraphNodeList *outNodeList,
@@ -416,9 +294,9 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
 {
     uint32_t i, j;
     uint32_t pathEdgeCount = inEdgeList->numEdges;
-    uint32_t pathNodeCount = 0;
+    uint32_t pathNodeCount = 0U;
     uint32_t numInNodes = inNodeList->numNodes;
-    uint32_t nodes[FVID2_GRAPH_MAX_NODES] = {0};
+    uint32_t nodes[FVID2_GRAPH_MAX_NODES] = {0U};
 
     for (i = 0; i < inEdgeList->numEdges; i++)
     {
@@ -445,28 +323,30 @@ int32_t Fvid2_graphGetPath(const Fvid2_GraphNodeList *inNodeList,
     outEdgeList->numEdges = pathEdgeCount;
     GT_assert(Fvid2Trace, (outEdgeList->list != NULL));
 
-    for (i = 0; i < pathEdgeCount; i++)
+    for (i = 0U; i < pathEdgeCount; i++)
     {
-        outEdgeList->list[i].startNode =
-            inEdgeList->list[i].startNode;
-        outEdgeList->list[i].endNode =
-            inEdgeList->list[i].endNode;
+        outEdgeList->list[i].startNode = inEdgeList->list[i].startNode;
+        outEdgeList->list[i].endNode = inEdgeList->list[i].endNode;
     }
 
-    j = 0;
-    for (i = 0; i < numInNodes; i++)
+    j = 0U;
+    for (i = 0U; i < numInNodes; i++)
     {
         if (nodes[i] == 1U)
         {
             Fvid2Utils_memcpy((void *) &outNodeList->list[j],
-                            (void *) &inNodeList->list[i],
-                            sizeof (Fvid2_GraphNodeInfo));
+                              (void *) &inNodeList->list[i],
+                              sizeof (Fvid2_GraphNodeInfo));
 
             /* Reset connection info from the original graph */
-            Fvid2Utils_memset((void *) (outNodeList->list[j].inputNodeSet.node), 0,
-                              sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
-            Fvid2Utils_memset((void *) (outNodeList->list[j].outputNodeSet.node), 0,
-                              sizeof (Fvid2_GraphNodeInfo *) * FVID2_GRAPH_MAX_NUM_PATHS);
+            Fvid2Utils_memset((void *)(outNodeList->list[j].inputNodeSet.node),
+                              0,
+                              sizeof (Fvid2_GraphNodeInfo *)
+                                                   * FVID2_GRAPH_MAX_NUM_PATHS);
+            Fvid2Utils_memset((void *)(outNodeList->list[j].outputNodeSet.node),
+                              0,
+                              sizeof (Fvid2_GraphNodeInfo *)
+                                                   * FVID2_GRAPH_MAX_NUM_PATHS);
             j++;
         }
     }
@@ -479,192 +359,17 @@ int32_t Fvid2_graphFreePath(Fvid2_GraphNodeList *nodeList,
 {
     if (NULL != nodeList->list)
     {
-        nodeList->numNodes = 0;
+        nodeList->numNodes = 0U;
         nodeList->list = NULL;
     }
     if (NULL != edgeList->list)
     {
-        edgeList->numEdges = 0;
+        edgeList->numEdges = 0U;
         edgeList->list = NULL;
     }
     return FVID2_SOK;
 }
 
-void Fvid2_graphInitTraverser(Fvid2_GraphNodeInfo *node)
-{
-    /* Initialize Stack */
-    Fvid2_graphStackReset();
-
-    /* Push root node onto stack */
-    Fvid2_graphStackPush(node);
-}
-
-static void Fvid2_graphStackReset(void)
-{
-    Fvid2Utils_memset(&gFvid2GraphNodeStack, 0, sizeof (gFvid2GraphNodeStack));
-    gFvid2GraphNodeStack.top = (-(int32_t)1);
-
-    /* Initialize All stack numbers with -1 */
-    Fvid2Utils_memset(gFvid2GraphNodeStack.stNum, 0, sizeof (uint32_t) * FVID2_GRAPH_MAX_NODES);
-    Fvid2Utils_memset(gFvid2GraphNodeStack.isVisited, 0, sizeof (FVID2_GRAPH_MAX_NODES));
-}
-
-/* Push a node on the stack */
-static void Fvid2_graphStackPush(Fvid2_GraphNodeInfo *node)
-{
-    gFvid2GraphNodeStack.top++;
-    gFvid2GraphNodeStack.node[gFvid2GraphNodeStack.top] = node;
-}
-
-/* Remove top node from the stack */
-static void Fvid2_graphStackPop(void)
-{
-    /* Remove the node from the stack */
-    gFvid2GraphNodeStack.stNum[gFvid2GraphNodeStack.top] = 0;
-    gFvid2GraphNodeStack.node[gFvid2GraphNodeStack.top]  = NULL;
-    gFvid2GraphNodeStack.top--;
-}
-
-static uint32_t Fvid2_graphStackIsVisited(const Fvid2_GraphNodeInfo *node)
-{
-    uint32_t visited = TRUE;
-
-    if (0 == gFvid2GraphNodeStack.isVisited[node->nodeId])
-    {
-        visited = FALSE;
-    }
-
-    return (visited);
-}
-
-int32_t Fvid2_graphStackIsLastNode(const Fvid2_GraphNodeInfo *currNode,
-                                   uint32_t isForward)
-{
-    int32_t ret = (int32_t) TRUE;
-
-    if (((TRUE == isForward) && (0 != currNode->outputNodeSet.numNodes)) ||
-        ((FALSE == isForward) && (0 != currNode->inputNodeSet.numNodes)))
-    {
-        ret = (int32_t) FALSE;
-    }
-
-    return (ret);
-}
-
-/* Function to get the next enabled node for the currNode */
-Fvid2_GraphNodeInfo *Fvid2_graphGetNextChildNode(
-                            const Fvid2_GraphNodeInfo *currNode,
-                            uint32_t isForward)
-{
-    Fvid2_GraphNodeInfo *node = NULL;
-    uint32_t isEnabled = TRUE;
-    uint32_t nodeId, nextNodeNum;
-    uint32_t loopEnd = 1U;
-
-    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->outputNodeSet.numNodes)
-            {
-                node = currNode->outputNodeSet.node[nextNodeNum];
-                isEnabled = currNode->outputNodeSet.isEnabled[nextNodeNum];
-            }
-            else
-            {
-                loopEnd = 0;
-            }
-        }
-        else  /* Traversing from Venc Nodes to input node */
-        {
-            /* Get the next node from the input nodes */
-            if (nextNodeNum < currNode->inputNodeSet.numNodes)
-            {
-                node = currNode->inputNodeSet.node[(nextNodeNum)];
-                isEnabled = currNode->inputNodeSet.isEnabled[nextNodeNum];
-            }
-            else
-            {
-                loopEnd = 0;
-            }
-        }
-        if (0U == loopEnd)
-        {
-            break;
-        }
-        nextNodeNum += 1U;
-    } while (FALSE == isEnabled);
-
-    if (FALSE == isEnabled)
-    {
-        node = NULL;
-    }
-    else
-    {
-        gFvid2GraphNodeStack.stNum[nodeId] = (int32_t) nextNodeNum;
-    }
-    return (node);
-}
-
-/* Get the top node on the stack */
-Fvid2_GraphNodeInfo *Fvid2_graphStackPeak(uint32_t *stNum)
-{
-    *stNum = (uint32_t) gFvid2GraphNodeStack.stNum[gFvid2GraphNodeStack.top];
-    return (gFvid2GraphNodeStack.node[gFvid2GraphNodeStack.top]);
-}
-
-Fvid2_GraphNodeInfo *Fvid2_graphGetNextNodeToTraverse(uint32_t isForward)
-{
-    uint32_t nodeId;
-    Fvid2_GraphNodeInfo *currNode = NULL, *nextNode = NULL;
-
-    while (gFvid2GraphNodeStack.top > (-(int32_t)1))
-    {
-        /* Get the stack top node */
-        currNode = Fvid2_graphStackPeak(&nodeId);
-
-        if (FALSE == Fvid2_graphStackIsVisited(currNode))
-        {
-            /* If current node is ot visited, return it to the caller. */
-            break;
-        }
-        else
-        {
-            /* Get the Next Node */
-            nextNode = Fvid2_graphGetNextChildNode(currNode, isForward);
-
-            /* If next node is not null, push it onto stack so that it can
-             * be traversed */
-            if (NULL != nextNode)
-            {
-                /* Push the start node onto stack */
-                Fvid2_graphStackPush(nextNode);
-            }
-            else
-            {
-                /* Remove the node from the stack */
-                Fvid2_graphStackPop();
-            }
-        }
-    }
-    if ((-(int32_t)1) == gFvid2GraphNodeStack.top)
-    {
-        currNode = NULL;
-    }
-
-    if (NULL != currNode)
-    {
-        nodeId = currNode->nodeId;
-        gFvid2GraphNodeStack.isVisited[nodeId] = (uint8_t) 1;
-    }
-
-    return (currNode);
-}
-
 int32_t Fvid2_graphGetEnabledIndex(const uint32_t *array, uint32_t size)
 {
     uint32_t i;
@@ -692,3 +397,48 @@ void Fvid2_graphAddEdge(Fvid2_GraphEdgeInfo *edge,
     }
 }
 
+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].inputNodeSet,
+                          0,
+                          sizeof (Fvid2_GraphNodeSet));
+        Fvid2Utils_memset(&nodes[cnt].outputNodeSet,
+                          0,
+                          sizeof (Fvid2_GraphNodeSet));
+    }
+
+    for (cnt = 0U; cnt < inEdgeList->numEdges; cnt++)
+    {
+        startNode = edges[cnt].startNode;
+        endNode   = edges[cnt].endNode;
+        /* End Node is output node for the start Node so update
+         * information in start node*/
+        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].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].outputNodeSet.isEnabled[index1] = TRUE;
+            nodes[endNode].inputNodeSet.isEnabled[index2]    = TRUE;
+        }
+    }
+
+    return FVID2_SOK;
+}