Clean up the obsolete codes in libmix

BZ: 62108

Clean up the obsolete codes in libmix for code coverage improvement
and easier maintenance. Use the existing MARRO VBP (#ifndef VBP)
to comment out the unused/uncalled functions or codes.

Change-Id: Ibba20c00e80e85ca0f3c5443bf67a0088d7d7947
Signed-off-by: wfeng6 <wei.feng@intel.com>
Reviewed-on: http://android.intel.com:8080/69984
Reviewed-by: Chen, Tianmi <tianmi.chen@intel.com>
Reviewed-by: Wang, Yi A <yi.a.wang@intel.com>
Reviewed-by: Qiu, Junhai <junhai.qiu@intel.com>
Reviewed-by: Jiang, Fei <fei.jiang@intel.com>
Reviewed-by: Guo, Nana N <nana.n.guo@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/mix_vbp/Merge_readme.txt b/mix_vbp/Merge_readme.txt
deleted file mode 100644
index 90936bb..0000000
--- a/mix_vbp/Merge_readme.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DHG revision #218237
-
diff --git a/mix_vbp/viddec_fw/fw/codecs/h264/parser/viddec_h264_parse.c b/mix_vbp/viddec_fw/fw/codecs/h264/parser/viddec_h264_parse.c
old mode 100755
new mode 100644
index 4cc58d3..2694f7d
--- a/mix_vbp/viddec_fw/fw/codecs/h264/parser/viddec_h264_parse.c
+++ b/mix_vbp/viddec_fw/fw/codecs/h264/parser/viddec_h264_parse.c
@@ -490,7 +490,7 @@
 /* ------------------------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------------------------ */
-
+#ifndef VBP
 static uint32_t viddec_h264_is_frame_start(void *ctxt)
 {
     struct h264_viddec_parser* parser = ctxt;
@@ -504,13 +504,11 @@
 
     return ret;
 }
+#endif
 
-#ifdef VBP
+#ifndef VBP
 uint32_t viddec_h264_wkld_done(void *parent, void *ctxt, unsigned int next_sc,
                                uint32_t *codec_specific_errors)
-#else
-static uint32_t viddec_h264_wkld_done(void *parent, void *ctxt, unsigned int next_sc, uint32_t *codec_specific_errors)
-#endif
 {
     struct h264_viddec_parser* parser = ctxt;
     uint32_t ret = VIDDEC_PARSE_SUCESS;
@@ -548,6 +546,7 @@
 
     return ret;
 }
+#endif
 
 #ifdef VBP
 void viddec_h264_get_context_size(viddec_parser_memory_sizes_t *size)
@@ -563,6 +562,7 @@
                          + sizeof(int32_t) * MAX_NUM_REF_FRAMES_IN_PIC_ORDER_CNT_CYCLE;
 }
 
+#ifndef VBP
 void viddec_h264_get_ops(viddec_parser_ops_t *ops)
 {
     ops->init = viddec_h264_init;
@@ -573,4 +573,5 @@
     ops->is_frame_start = viddec_h264_is_frame_start;
     return;
 }
+#endif
 
diff --git a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_fw_mp4_workload.c b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_fw_mp4_workload.c
index 7c7eaa8..c9ec2fb 100644
--- a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_fw_mp4_workload.c
+++ b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_fw_mp4_workload.c
@@ -1,3 +1,4 @@
+#ifndef VBP
 #include <string.h>
 
 #include "viddec_fw_workload.h"
@@ -373,4 +374,4 @@
 
     return result;
 } // viddec_fw_mp4_emit_workload
-
+#endif
diff --git a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_mp4_parse.c b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_mp4_parse.c
index 72ad8b7..ef9b3f5 100644
--- a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_mp4_parse.c
+++ b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_mp4_parse.c
@@ -9,7 +9,9 @@
 #include "viddec_mp4_videoobjectplane.h"
 #include "viddec_mp4_visualobject.h"
 
+#ifndef VBP
 extern uint32_t viddec_parse_sc_mp4(void *in, void *pcxt, void *sc_state);
+#endif
 
 void viddec_mp4_get_context_size(viddec_parser_memory_sizes_t *size)
 {
@@ -19,6 +21,7 @@
     return;
 } // viddec_mp4_get_context_size
 
+#ifndef VBP
 uint32_t viddec_mp4_wkld_done(void *parent, void *ctxt, uint32_t next_sc, uint32_t *codec_specific_errors)
 {
     viddec_mp4_parser_t *parser = (viddec_mp4_parser_t *) ctxt;
@@ -105,6 +108,7 @@
 
     return result;
 } // viddec_mp4_wkld_done
+#endif
 
 void viddec_mp4_init(void *ctxt, uint32_t *persist_mem, uint32_t preserve)
 {
@@ -282,6 +286,7 @@
     return VIDDEC_PARSE_SUCESS;
 } // viddec_mp4_parse
 
+#ifndef VBP
 uint32_t viddec_mp4_is_frame_start(void *ctxt)
 {
     viddec_mp4_parser_t *parser = (viddec_mp4_parser_t *)ctxt;
@@ -298,3 +303,4 @@
     ops->init = viddec_mp4_init;
     return;
 } // viddec_mp4_get_ops
+#endif
diff --git a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_parse_sc_mp4.c b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_parse_sc_mp4.c
index ba296e7..70f7454 100644
--- a/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_parse_sc_mp4.c
+++ b/mix_vbp/viddec_fw/fw/codecs/mp4/parser/viddec_parse_sc_mp4.c
@@ -17,7 +17,7 @@
    get complicated is resync marker in LVH can potentially be (00 00 8) which will cause false detect
    of SVH start code.
 */
-
+#ifndef VBP
 uint32_t viddec_parse_sc_mp4(void *in, void *pcxt, void *sc_state)
 {
     uint8_t *ptr;
@@ -149,3 +149,4 @@
     /* Return SC found only if phase is 4, else always success */
     return ret;
 }
+#endif
diff --git a/mix_vbp/viddec_fw/fw/parser/Android.mk b/mix_vbp/viddec_fw/fw/parser/Android.mk
index aa5330e..882b081 100644
--- a/mix_vbp/viddec_fw/fw/parser/Android.mk
+++ b/mix_vbp/viddec_fw/fw/parser/Android.mk
@@ -10,13 +10,8 @@
 	vbp_loader.c			\
 	vbp_mp42_parser.c		\
 	vbp_utils.c			\
-	viddec_emit.c			\
 	viddec_parse_sc.c		\
-	viddec_parse_sc_stub.c		\
-	viddec_pm.c			\
 	viddec_pm_parser_ops.c		\
-	viddec_pm_stubs.c		\
-	viddec_pm_tags.c		\
 	viddec_pm_utils_bstream.c	\
 	viddec_pm_utils_list.c
 
diff --git a/mix_vbp/viddec_fw/fw/parser/gv_sven_devh.c b/mix_vbp/viddec_fw/fw/parser/gv_sven_devh.c
deleted file mode 100644
index c815406..0000000
--- a/mix_vbp/viddec_fw/fw/parser/gv_sven_devh.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
-
-  This file is provided under a dual BSD/GPLv2 license.  When using or
-  redistributing this file, you may do so under either license.
-
-  GPL LICENSE SUMMARY
-
-  Copyright(c) 2005-2008 Intel Corporation. All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of version 2 of the GNU General Public License as
-  published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-  The full GNU General Public License is included in this distribution
-  in the file called LICENSE.GPL.
-
-  Contact Information:
-    Intel Corporation
-    2200 Mission College Blvd.
-    Santa Clara, CA  97052
-
-  BSD LICENSE
-
-  Copyright(c) 2005-2008 Intel Corporation. All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the
-      distribution.
-    * Neither the name of Intel Corporation nor the names of its
-      contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#ifndef SVEN_FW_H
-#include "sven_fw.h"
-#endif
-
-#define _OSAL_IO_MEMMAP_H  /* to prevent errors when including sven_devh.h */
-#define _OSAL_ASSERT_H     /* to prevent errors when including sven_devh.h */
-#include "sven_devh.h"
-
-#include "fw_pvt.h"
-
-static os_devhandle_t         g_svenh;
-
-#define FW_SVEN_DEVH_DISABLE_SVEN_REGISTER_IO
-//#define SVEN_DEVH_DISABLE_SVEN
-
-extern int sven_fw_is_tx_enabled(
-    struct SVENHandle       *svenh );
-
-#ifndef SVEN_DEVH_DISABLE_SVEN
-static void sven_write_event(
-    struct SVENHandle        *svenh,
-    struct SVENEvent         *ev )
-{
-    if ( NULL == svenh )
-        svenh = &g_svenh.devh_svenh;
-
-    if ( NULL != svenh->phot )
-        sven_fw_write_event(svenh,ev);
-}
-
-static void sven_fw_initialize_event_top(
-    struct SVENEvent         *ev,
-    int                      module,
-    int                      unit,
-    int                      event_type,
-    int                      event_subtype )
-{
-    ev->se_et.et_gencount = 0;
-    ev->se_et.et_module = module;
-    ev->se_et.et_unit = unit;
-    ev->se_et.et_type = event_type;
-    ev->se_et.et_subtype = event_subtype;
-}
-#endif
-
-uint32_t sven_get_timestamp()
-{
-    uint32_t    value = 0;
-
-    if ( NULL != g_svenh.devh_svenh.ptime )
-    {
-        value = sven_fw_read_external_register( &g_svenh.devh_svenh, g_svenh.devh_svenh.ptime );
-    }
-
-    return(value);
-}
-
-/* ---------------------------------------------------------------------- */
-/* ---------------------------------------------------------------------- */
-
-void devh_SVEN_SetModuleUnit(
-    os_devhandle_t          *devh,
-    int                      sven_module,
-    int                      sven_unit )
-{
-#ifndef SVEN_DEVH_DISABLE_SVEN
-    if ( NULL == devh )
-        devh = &g_svenh;
-    devh->devh_sven_module = sven_module;
-    devh->devh_sven_unit = sven_unit;
-#endif
-}
-
-os_devhandle_t *devhandle_factory( const char *desc )
-{
-    /* pointer to global vsparc local registers */
-    g_svenh.devh_regs_ptr = (void *) 0x10000000;   /* firmware address to Local (GV) registers */
-
-    return( &g_svenh );
-}
-
-int devhandle_connect_name(
-    os_devhandle_t          *devh,
-    const char              *devname )
-{
-    return(1);
-}
-
-/* ---------------------------------------------------------------------- */
-/* ---------------------------------------------------------------------- */
-
-void devh_SVEN_WriteModuleEvent(
-    os_devhandle_t  *devh,
-    int              module_event_subtype,
-    unsigned int     payload0,
-    unsigned int     payload1,
-    unsigned int     payload2,
-    unsigned int     payload3,
-    unsigned int     payload4,
-    unsigned int     payload5 )
-{
-#ifndef SVEN_DEVH_DISABLE_SVEN
-    struct SVENEvent        ev __attribute__ ((aligned(8)));
-
-    devh = (NULL != devh) ? devh :  &g_svenh;
-
-    if ( ! sven_fw_is_tx_enabled( &devh->devh_svenh ) )
-        return;
-
-    sven_fw_initialize_event_top( &ev,
-                                  devh->devh_sven_module,
-                                  1 /* devh->devh_sven_unit */,
-                                  SVEN_event_type_module_specific,
-                                  module_event_subtype );
-
-    ev.u.se_uint[0]        = payload0;
-    ev.u.se_uint[1]        = payload1;
-    ev.u.se_uint[2]        = payload2;
-    ev.u.se_uint[3]        = payload3;
-    ev.u.se_uint[4]        = payload4;
-    ev.u.se_uint[5]        = payload5;
-
-    sven_write_event( &devh->devh_svenh, &ev );
-#endif
-}
-
-/* ---------------------------------------------------------------------- */
-/* SVEN FW TX: Required custom routines to enable FW TX                   */
-/* ---------------------------------------------------------------------- */
-int sven_fw_set_globals(
-    struct SVEN_FW_Globals  *fw_globals )
-{
-    sven_fw_attach( &g_svenh.devh_svenh, fw_globals );
-    devh_SVEN_SetModuleUnit( &g_svenh, SVEN_module_GEN4_GV, 1 );
-    return(0);
-}
-
-uint32_t cp_using_dma_phys(uint32_t ddr_addr, uint32_t local_addr, uint32_t size, char to_ddr, char swap);
-
-unsigned int sven_fw_read_external_register(
-    struct SVENHandle       *svenh,
-    volatile unsigned int   *preg )
-{
-    unsigned int      reg __attribute__ ((aligned(8)));
-
-    (void)svenh;   // argument unused
-
-    cp_using_dma_phys( (uint32_t) preg, (uint32_t) &reg, 4, 0, 0 );
-
-    return( reg );
-}
-
-void sven_fw_copy_event_to_host_mem(
-    struct SVENHandle          *svenh,
-    volatile struct SVENEvent  *to,
-    const struct SVENEvent     *from )
-{
-    (void)svenh;   // argument unused
-
-    cp_using_dma_phys( (uint32_t) to, (uint32_t) from, sizeof(*to), 1, 0 );
-}
-/* ---------------------------------------------------------------------- */
-/* ---------------------------------------------------------------------- */
diff --git a/mix_vbp/viddec_fw/fw/parser/include/viddec_h264_parse.h b/mix_vbp/viddec_fw/fw/parser/include/viddec_h264_parse.h
index 4712be7..130ce39 100644
--- a/mix_vbp/viddec_fw/fw/parser/include/viddec_h264_parse.h
+++ b/mix_vbp/viddec_fw/fw/parser/include/viddec_h264_parse.h
@@ -1,6 +1,6 @@
 #ifndef VIDDEC_H264_PARSE_H
 #define VIDDEC_H264_PARSE_H
-
+#ifndef VBP
 void viddec_h264_get_ops(viddec_parser_ops_t *ops);
-
+#endif
 #endif
diff --git a/mix_vbp/viddec_fw/fw/parser/include/viddec_pm_utils_list.h b/mix_vbp/viddec_fw/fw/parser/include/viddec_pm_utils_list.h
index 7f406fd..1ead7ec 100644
--- a/mix_vbp/viddec_fw/fw/parser/include/viddec_pm_utils_list.h
+++ b/mix_vbp/viddec_fw/fw/parser/include/viddec_pm_utils_list.h
@@ -34,7 +34,7 @@
 
 /* This function initialises the list to default values */
 void viddec_pm_utils_list_init(viddec_pm_utils_list_t *cxt);
-
+#ifndef VBP
 /* This function adds a new entry to list and will emit tags if needed */
 uint32_t viddec_pm_utils_list_addbuf(viddec_pm_utils_list_t *list, viddec_input_buffer_t *es_buf);
 
@@ -49,3 +49,4 @@
 /* this function returns 1 if the requested byte is not found. If found returns list and offset into list */
 uint32_t viddec_pm_utils_list_getbyte_position(viddec_pm_utils_list_t *list, uint32_t byte, uint32_t *list_index, uint32_t *offset);
 #endif
+#endif
diff --git a/mix_vbp/viddec_fw/fw/parser/main.c b/mix_vbp/viddec_fw/fw/parser/main.c
deleted file mode 100644
index ad921b4..0000000
--- a/mix_vbp/viddec_fw/fw/parser/main.c
+++ /dev/null
@@ -1,608 +0,0 @@
-#include "fw_pvt.h"
-#include "viddec_fw_parser_ipclib_config.h"
-#include "viddec_fw_common_defs.h"
-#include "viddec_fw_parser.h"
-#include "viddec_fw_debug.h"
-
-/* This define makes sure that the structure is stored in Local memory.
-   This is shared memory between host and FW.*/
-volatile dmem_t _dmem __attribute__ ((section (".exchange")));
-/* Debug index should be disbaled for Production FW */
-uint32_t dump_ptr=0;
-uint32_t timer=0;
-
-/* Auto Api definitions */
-ismd_api_group viddec_fw_api_array[2];
-
-extern void viddec_fw_parser_register_callbacks(void);
-
-/*------------------------------------------------------------------------------
- * Function:  initialize firmware SVEN TX Output
- *------------------------------------------------------------------------------
- */
-int SMDEXPORT viddec_fw_parser_sven_init(struct SVEN_FW_Globals  *sven_fw_globals )
-{
-    extern int sven_fw_set_globals(struct SVEN_FW_Globals  *fw_globals );
-    return(sven_fw_set_globals(sven_fw_globals));
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_check_watermark_boundary
- * This function figures out if we crossesd watermark boundary on input data.
- * before represents the ES Queue data when we started and current represents ES Queue data
- * when we are ready to swap.Threshold is the amount of data specified by the driver to trigger an
- * interrupt.
- * We return true if threshold is between before and current.
- *------------------------------------------------------------------------------
- */
-static inline uint32_t viddec_fw_check_watermark_boundary(uint32_t before, uint32_t current, uint32_t threshold)
-{
-    return ((before >= threshold) && (current < threshold));
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_get_total_input_Q_data
- * This function figures out how much data is available in input queue of the FW
- *------------------------------------------------------------------------------
- */
-static uint32_t viddec_fw_get_total_input_Q_data(uint32_t indx)
-{
-    FW_IPC_Handle *fwipc = GET_IPC_HANDLE(_dmem);
-    uint32_t ret;
-    int32_t pos=0;
-    FW_IPC_ReceiveQue   *rcv_q;
-
-    rcv_q = &fwipc->rcv_q[indx];
-    /* count the cubby buffer which we already read if present */
-    ret = (_dmem.stream_info[indx].buffered_data) ? CONFIG_IPC_MESSAGE_MAX_SIZE:0;
-    ret += ipc_mq_read_avail(&rcv_q->mq, (int32_t *)&pos);
-    return ret;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  mfd_round_robin
- * Params:
- *        [in]  pri: Priority of the stream
- *        [in] indx: stream id number of the last stream that was scheduled.
- *        [out] qnum: Stream id of priority(pri) which has data.
- * This function is responsible for figuring out which stream needs to be scheduled next.
- * It starts after the last scheduled stream and walks through all streams until it finds
- * a stream which is of required priority, in start state, has space on output and data in
- * input.
- * If no such stream is found qnum is not updated and return value is 0.
- * If a stream is found then qnum is updated with that id and function returns 1.
- *------------------------------------------------------------------------------
- */
-
-uint32_t mfd_round_robin(uint32_t pri, int32_t *qnum, int32_t indx)
-{
-    FW_IPC_Handle *fwipc = GET_IPC_HANDLE(_dmem);
-    int32_t i = CONFIG_IPC_FW_MAX_RX_QUEUES;
-    uint32_t ret = 0;
-    /* Go through all queues until we find a valid queue of reqd priority */
-    while (i>0)
-    {
-        indx++;
-        if (indx >=  CONFIG_IPC_FW_MAX_RX_QUEUES) indx = 0;
-
-        /* We should look only at queues which match priority and
-           in running state */
-        if ( (_dmem.stream_info[indx].state == 1)
-                && (_dmem.stream_info[indx].priority == pri))
-        {
-            uint32_t inpt_avail=0, output_avail=0, wklds_avail =0 , pos;
-            FW_IPC_ReceiveQue   *rcv_q;
-            rcv_q = &fwipc->rcv_q[indx];
-            inpt_avail = (_dmem.stream_info[indx].buffered_data > 0) || (ipc_mq_read_avail(&rcv_q->mq, (int32_t *)&pos) > 0);
-            /* we have to check for two workloads to protect against error cases where we might have to push both current and next workloads */
-            output_avail = FwIPC_SpaceAvailForMessage(fwipc, &fwipc->snd_q[indx], CONFIG_IPC_MESSAGE_MAX_SIZE, &pos) >= 2;
-            pos = 0;
-            /* Need at least current and next to proceed */
-            wklds_avail =  (ipc_mq_read_avail(&fwipc->wkld_q[indx].mq, (int32_t *)&pos) >= (CONFIG_IPC_MESSAGE_MAX_SIZE << 1));
-            if (inpt_avail && output_avail && wklds_avail)
-            {/* Success condition: we have some data on input and enough space on output queue */
-                *qnum = indx;
-                ret =1;
-                break;
-            }
-        }
-        i--;
-    }
-    return ret;
-}
-static inline void mfd_setup_emitter(FW_IPC_Handle *fwipc, FW_IPC_ReceiveQue *rcv_q, mfd_pk_strm_cxt *cxt)
-{
-    int32_t ret1=0,ret=0;
-    /* We don't check return values for the peek as round robin guarantee's that we have required free workloads */
-    ret = FwIPC_PeekReadMessage(fwipc, rcv_q, (char *)&(cxt->wkld1), sizeof(ipc_msg_data), 0);
-    ret1 = FwIPC_PeekReadMessage(fwipc, rcv_q, (char *)&(cxt->wkld2), sizeof(ipc_msg_data), 1);
-    viddec_emit_update(&(cxt->pm.emitter), cxt->wkld1.phys, cxt->wkld2.phys, cxt->wkld1.len, cxt->wkld2.len);
-}
-
-static inline void mfd_init_swap_memory(viddec_pm_cxt_t *pm, uint32_t codec_type, uint32_t start_addr, uint32_t clean)
-{
-    uint32_t *persist_mem;
-    persist_mem = (uint32_t *)(start_addr | GV_DDR_MEM_MASK);
-    viddec_pm_init_context(pm,codec_type, persist_mem, clean);
-    pm->sc_prefix_info.first_sc_detect = 1;
-    viddec_emit_init(&(pm->emitter));
-}
-
-void output_omar_wires( unsigned int value )
-{
-#ifdef RTL_SIMULATION
-    reg_write(CONFIG_IPC_ROFF_HOST_DOORBELL, value );
-#endif
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_init_swap_memory
- * This function is responsible for seeting the swap memory to a good state for current stream.
- * The swap parameter tells us whether we need to dma the context to local memory.
- * We call init on emitter and parser manager which inturn calls init of the codec we are opening the stream for.
- *------------------------------------------------------------------------------
- */
-
-void viddec_fw_init_swap_memory(unsigned int stream_id, unsigned int swap, unsigned int clean)
-{
-    mfd_pk_strm_cxt *cxt;
-    mfd_stream_info *cxt_swap;
-    cxt = (mfd_pk_strm_cxt *)&(_dmem.srm_cxt);
-    cxt_swap = (mfd_stream_info *)&(_dmem.stream_info[stream_id]);
-
-    if (swap)
-    {/* Swap context into local memory */
-        cp_using_dma(cxt_swap->ddr_cxt, (uint32_t) &(cxt->pm), sizeof(viddec_pm_cxt_t), false, false);
-    }
-
-    {
-        mfd_init_swap_memory(&(cxt->pm), cxt_swap->strm_type, cxt_swap->ddr_cxt+cxt_swap->cxt_size, clean);
-        cxt_swap->wl_time = 0;
-        cxt_swap->es_time = 0;
-    }
-    if (swap)
-    {/* Swap context into DDR */
-        cp_using_dma(cxt_swap->ddr_cxt, (uint32_t) &(cxt->pm), sizeof(viddec_pm_cxt_t), true, false);
-    }
-}
-
-/*------------------------------------------------------------------------------
- * Function: viddec_fw_push_current_frame_to_output
- * This is a helper function to read a workload from input queue and push to output queue.
- * This is called when are done with a frame.
- *------------------------------------------------------------------------------
- */
-static inline void viddec_fw_push_current_frame_to_output(FW_IPC_Handle *fwipc, uint32_t cur)
-{
-    ipc_msg_data wkld_to_push;
-    FwIPC_ReadMessage(fwipc, &fwipc->wkld_q[cur], (char *)&(wkld_to_push), sizeof(ipc_msg_data));
-    FwIPC_SendMessage(fwipc, cur, (char *)&(wkld_to_push),  sizeof(ipc_msg_data));
-}
-
-/*------------------------------------------------------------------------------
- * Function: viddec_fw_get_next_stream_to_schedule
- * This is a helper function to figure out which active stream needs to be scheduled next.
- * If none of the streams are active it returns -1.
- *------------------------------------------------------------------------------
- */
-static inline int viddec_fw_get_next_stream_to_schedule(void)
-{
-    int32_t cur = -1;
-
-    if (mfd_round_robin(viddec_stream_priority_REALTIME, &cur, _dmem.g_pk_data.high_id))
-    {
-        /* On success store the stream id */
-        _dmem.g_pk_data.high_id = cur;
-    }
-    else
-    {
-        /* Check Low priority Queues, Since we couldn't find a valid realtime stream */
-        if (mfd_round_robin(viddec_stream_priority_BACKGROUND, &cur, _dmem.g_pk_data.low_id))
-        {
-            _dmem.g_pk_data.low_id = cur;
-        }
-    }
-
-    return cur;
-}
-
-/*------------------------------------------------------------------------------
- * Function: viddec_fw_update_pending_interrupt_flag
- * This is a helper function to figure out if we need to mark an interrupt pending for this stream.
- * We update status value here if we find any of the interrupt conditions are true.
- * If this stream has a interrupt pending which we could not send to host, we don't overwrite past status info.
- *------------------------------------------------------------------------------
- */
-static inline void viddec_fw_update_pending_interrupt_flag(int32_t cur, mfd_stream_info *cxt_swap, uint8_t pushed_a_workload,
-        uint32_t es_Q_data_at_start)
-{
-    if (_dmem.int_status[cur].mask)
-    {
-        if (!cxt_swap->pending_interrupt)
-        {
-            uint32_t es_Q_data_now;
-            uint8_t wmark_boundary_reached=false;
-            es_Q_data_now = viddec_fw_get_total_input_Q_data((uint32_t)cur);
-            wmark_boundary_reached = viddec_fw_check_watermark_boundary(es_Q_data_at_start, es_Q_data_now, cxt_swap->low_watermark);
-            _dmem.int_status[cur].status = 0;
-            if (pushed_a_workload)
-            {
-                _dmem.int_status[cur].status |= VIDDEC_FW_WKLD_DATA_AVAIL;
-            }
-            if (wmark_boundary_reached)
-            {
-                _dmem.int_status[cur].status |= VIDDEC_FW_INPUT_WATERMARK_REACHED;
-            }
-            cxt_swap->pending_interrupt = ( _dmem.int_status[cur].status != 0);
-        }
-    }
-    else
-    {
-        cxt_swap->pending_interrupt = false;
-    }
-}
-
-static inline void viddec_fw_handle_error_and_inband_messages(int32_t cur, uint32_t pm_ret)
-{
-    FW_IPC_Handle *fwipc = GET_IPC_HANDLE(_dmem);
-
-    viddec_fw_push_current_frame_to_output(fwipc, cur);
-    switch (pm_ret)
-    {
-    case PM_EOS:
-    case PM_OVERFLOW:
-    {
-        viddec_fw_init_swap_memory(cur, false, true);
-    }
-    break;
-    case PM_DISCONTINUITY:
-    {
-        viddec_fw_init_swap_memory(cur, false, false);
-    }
-    break;
-    default:
-        break;
-    }
-}
-
-void viddec_fw_debug_scheduled_stream_state(int32_t indx, int32_t start)
-{
-    FW_IPC_Handle *fwipc = GET_IPC_HANDLE(_dmem);
-    uint32_t inpt_avail=0, output_avail=0, wklds_avail =0 , pos;
-    FW_IPC_ReceiveQue   *rcv_q;
-    uint32_t message;
-
-    message = (start) ? SVEN_MODULE_EVENT_GV_FW_PK_SCHDL_STRM_START: SVEN_MODULE_EVENT_GV_FW_PK_SCHDL_STRM_END;
-    rcv_q = &fwipc->rcv_q[indx];
-    inpt_avail = ipc_mq_read_avail(&rcv_q->mq, (int32_t *)&pos);
-    inpt_avail += ((_dmem.stream_info[indx].buffered_data > 0) ? CONFIG_IPC_MESSAGE_MAX_SIZE: 0);
-    inpt_avail = inpt_avail >> 4;
-    pos = 0;
-    output_avail = ipc_mq_read_avail(&fwipc->snd_q[indx].mq, (int32_t *)&pos);
-    output_avail = output_avail >> 4;
-    pos = 0;
-    wklds_avail =  ipc_mq_read_avail(&fwipc->wkld_q[indx].mq, (int32_t *)&pos);
-    wklds_avail = wklds_avail >> 4;
-    WRITE_SVEN(message, (int)indx, (int)inpt_avail, (int)output_avail,
-               (int)wklds_avail, 0, 0);
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_process_async_queues(A.K.A -> Parser Kernel)
- * This function is responsible for handling the asynchronous queues.
- *
- * The first step is to figure out which stream to run. The current algorithm
- * will go through all high priority queues for a valid stream, if not found we
- * go through lower priority queues.
- *
- * If a valid stream is found we swap the required context from DDR to DMEM and do all necessary
- * things to setup the stream.
- * Once a stream is setup we call the parser manager and wait until a wrkld is created or no more input
- * data left.
- * Once we find a wkld we push it to host and save the current context to DDR.
- *------------------------------------------------------------------------------
- */
-
-static inline int32_t viddec_fw_process_async_queues()
-{
-    int32_t cur = -1;
-
-    cur = viddec_fw_get_next_stream_to_schedule();
-
-    if (cur != -1)
-    {
-        FW_IPC_Handle *fwipc = GET_IPC_HANDLE(_dmem);
-        FW_IPC_ReceiveQue   *rcv_q;
-        /* bits captured by OMAR */
-        output_omar_wires( 0x0 );
-        rcv_q = &fwipc->rcv_q[cur];
-        {
-            mfd_pk_strm_cxt *cxt;
-            mfd_stream_info *cxt_swap;
-            cxt = (mfd_pk_strm_cxt *)&(_dmem.srm_cxt);
-            cxt_swap = (mfd_stream_info *)&(_dmem.stream_info[cur]);
-
-            /* Step 1: Swap rodata to local memory. Not doing this currently as all the rodata fits in local memory. */
-            {/* Step 2: Swap context into local memory */
-                cp_using_dma(cxt_swap->ddr_cxt, (uint32_t) &(cxt->pm), sizeof(viddec_pm_cxt_t), false, false);
-            }
-            /* Step 3:setup emitter by reading input data and workloads and initialising it */
-            mfd_setup_emitter(fwipc, &fwipc->wkld_q[cur], cxt);
-            viddec_fw_debug_scheduled_stream_state(cur, true);
-            /* Step 4: Call Parser Manager until workload done or No more ES buffers */
-            {
-                ipc_msg_data *data = 0;
-                uint8_t stream_active = true, pushed_a_workload=false;
-                uint32_t pm_ret = PM_SUCCESS, es_Q_data_at_start;
-                uint32_t start_time, time=0;
-
-                start_time = set_wdog(VIDDEC_WATCHDOG_COUNTER_MAX);
-                timer=0;
-                es_Q_data_at_start = viddec_fw_get_total_input_Q_data((uint32_t)cur);
-                do
-                {
-                    output_omar_wires( 0x1 );
-                    {
-                        uint32_t es_t0,es_t1;
-                        get_wdog(&es_t0);
-                        pm_ret = viddec_pm_parse_es_buffer(&(cxt->pm), cxt_swap->strm_type, data);
-                        get_wdog(&es_t1);
-                        cxt_swap->es_time += get_total_ticks(es_t0, es_t1);
-                    }
-                    switch (pm_ret)
-                    {
-                    case PM_EOS:
-                    case PM_WKLD_DONE:
-                    case PM_OVERFLOW:
-                    case PM_DISCONTINUITY:
-                    {/* Finished a frame worth of data or encountered fatal error*/
-                        stream_active = false;
-                    }
-                    break;
-                    case PM_NO_DATA:
-                    {
-                        uint32_t next_ret=0;
-                        if ( (NULL != data) && (0 != cxt_swap->es_time) )
-                        {
-                            /* print performance info for this buffer */
-                            WRITE_SVEN(SVEN_MODULE_EVENT_GV_FW_PK_ES_DONE, (int)cur, (int)cxt_swap->es_time, (int)cxt->input.phys,
-                                       (int)cxt->input.len, (int)cxt->input.id, (int)cxt->input.flags );
-                            cxt_swap->es_time = 0;
-                        }
-
-                        next_ret = FwIPC_ReadMessage(fwipc, rcv_q, (char *)&(cxt->input), sizeof(ipc_msg_data));
-                        if (next_ret != 0)
-                        {
-                            data = &(cxt->input);
-                            WRITE_SVEN(SVEN_MODULE_EVENT_GV_FW_PK_ES_START, (int)cur, (int)cxt_swap->wl_time,
-                                       (int)cxt->input.phys, (int)cxt->input.len, (int)cxt->input.id, (int)cxt->input.flags );
-                        }
-                        else
-                        {/* No data on input queue */
-                            cxt_swap->buffered_data = 0;
-                            stream_active = false;
-                        }
-                    }
-                    break;
-                    default:
-                    {/* Not done with current buffer */
-                        data = NULL;
-                    }
-                    break;
-                    }
-                } while (stream_active);
-                get_wdog(&time);
-                cxt_swap->wl_time += get_total_ticks(start_time, time);
-                /* Step 5: If workload done push workload out */
-                switch (pm_ret)
-                {
-                case PM_EOS:
-                case PM_WKLD_DONE:
-                case PM_OVERFLOW:
-                case PM_DISCONTINUITY:
-                {/* Push current workload as we are done with the frame */
-                    cxt_swap->buffered_data = (PM_WKLD_DONE == pm_ret) ? true: false;
-                    viddec_pm_update_time(&(cxt->pm), cxt_swap->wl_time);
-
-                    /* xmit performance info for this workload output */
-                    WRITE_SVEN( SVEN_MODULE_EVENT_GV_FW_PK_WL_DONE, (int)cur, (int)cxt_swap->wl_time, (int)cxt->wkld1.phys,
-                                (int)cxt->wkld1.len, (int)cxt->wkld1.id, (int)cxt->wkld1.flags );
-                    cxt_swap->wl_time = 0;
-
-                    viddec_fw_push_current_frame_to_output(fwipc, cur);
-                    if (pm_ret != PM_WKLD_DONE)
-                    {
-                        viddec_fw_handle_error_and_inband_messages(cur, pm_ret);
-                    }
-                    pushed_a_workload = true;
-                }
-                break;
-                default:
-                    break;
-                }
-                /* Update information on whether we have active interrupt for this stream */
-                viddec_fw_update_pending_interrupt_flag(cur, cxt_swap, pushed_a_workload, es_Q_data_at_start);
-            }
-            viddec_fw_debug_scheduled_stream_state(cur, false);
-            /* Step 6: swap context into DDR */
-            {
-                cp_using_dma(cxt_swap->ddr_cxt, (uint32_t) &(cxt->pm), sizeof(viddec_pm_cxt_t), true, false);
-            }
-        }
-
-    }
-    return cur;
-}
-
-
-/*------------------------------------------------------------------------------
- * Function:  process_command
- * This magic function figures out which function to excute based on autoapi.
- *------------------------------------------------------------------------------
- */
-
-static inline void process_command(uint32_t cmd_id, unsigned char *command)
-{
-    int32_t groupid = ((cmd_id >> 24) - 13) & 0xff;
-    int32_t funcid = cmd_id & 0xffffff;
-    /* writing func pointer to hsot doorbell */
-    output_omar_wires( (int) viddec_fw_api_array[groupid].unmarshal[funcid] );
-    WRITE_SVEN( SVEN_MODULE_EVENT_GV_FW_AUTOAPI_CMD,(int) cmd_id, (int) command, ((int *)command)[0],
-                ((int *)command)[1], ((int *)command)[2], ((int *)command)[3] );
-
-    viddec_fw_api_array[groupid].unmarshal[funcid](0, command);
-
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_process_sync_queues(A.K.A auto api)
- * Params:
- *       [in] msg: common sync structure where all required parameters are present for autoapi.
- *
- * This function is responsible for handling synchronous messages. All synchronous messages
- * are handled through auto api.
- * what are synchronous messages?  Anything releated to teardown or opening a stream Ex: open, close, flush etc.
- *
- * Only once synchronous message at a time. When a synchronous message its id is usually in cp doorbell. Once
- * we are done handling synchronous message through auto api we release doorbell to let the host write next
- * message.
- *------------------------------------------------------------------------------
- */
-
-static inline int32_t viddec_fw_process_sync_queues(unsigned char *msg)
-{
-    int32_t ret = -1;
-
-    if (0 == reg_read(CONFIG_IPC_ROFF_RISC_DOORBELL_STATUS))
-    {
-        uint32_t command1=0;
-        command1 = reg_read(CONFIG_IPC_ROFF_RISC_RX_DOORBELL);
-        process_command(command1, msg);
-        reg_write(CONFIG_IPC_ROFF_RISC_DOORBELL_STATUS, 0x2); /* Inform Host we are done with this message */
-        ret = 0;
-    }
-    return ret;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_check_for_pending_int
- * This function walks through all active streams to see if atleast one stream has a pending interrupt
- * and returns true if it finds one.
- *------------------------------------------------------------------------------
- */
-static inline uint32_t viddec_fw_check_for_pending_int(void)
-{
-    uint32_t i=0, ret=false;
-    /* start from 0 to max streams that fw can handle*/
-    while (i < FW_SUPPORTED_STREAMS)
-    {
-        if (_dmem.stream_info[i].state == 1)
-        {
-            if ((_dmem.stream_info[i].pending_interrupt) && _dmem.int_status[i].mask)
-            {
-                ret = true;
-            }
-            else
-            {/* If this is not in INT state clear the status before sending it to host */
-                _dmem.int_status[i].status = 0;
-            }
-        }
-        i++;
-    }
-    return ret;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_clear_processed_int
- * This function walks through all active streams to clear pending interrupt state.This is
- * called after a INT was issued.
- *------------------------------------------------------------------------------
- */
-static inline void viddec_fw_clear_processed_int(void)
-{
-    uint32_t i=0;
-    /* start from 0 to max streams that fw can handle*/
-    while (i < FW_SUPPORTED_STREAMS)
-    {
-        //if(_dmem.stream_info[i].state == 1)
-        _dmem.stream_info[i].pending_interrupt = false;
-        i++;
-    }
-    return;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  viddec_fw_int_host
- * This function interrupts host if data is available for host or any other status
- * is valid which the host configures the FW to.
- * There is only one interrupt line so this is a shared Int for all streams, Host should
- * look at status of all streams when it receives a Int.
- * The FW will interrupt the host only if host doorbell is free, in other words the host
- * should always make the doorbell free at the End of its ISR.
- *------------------------------------------------------------------------------
- */
-
-static inline int32_t viddec_fw_int_host()
-{
-    /* We Interrupt the host only if host is ready to receive an interrupt */
-    if ((reg_read(CONFIG_IPC_ROFF_HOST_DOORBELL_STATUS) & GV_DOORBELL_STATS) == GV_DOORBELL_STATS)
-    {
-        if (viddec_fw_check_for_pending_int())
-        {
-            /* If a pending interrupt is found trigger INT */
-            reg_write(CONFIG_IPC_ROFF_HOST_DOORBELL, VIDDEC_FW_PARSER_IPC_HOST_INT);
-            /* Clear all stream's pending Interrupt info since we use a global INT for all streams */
-            viddec_fw_clear_processed_int();
-        }
-    }
-    return 1;
-}
-volatile unsigned int stack_corrupted __attribute__ ((section (".stckovrflwchk")));
-/*------------------------------------------------------------------------------
- * Function:  main
- * This function is the main firmware function. Its a infinite loop where it polls
- * for messages and processes them if they are available. Currently we ping pong between
- * synchronous and asynchronous messages one at a time. If we have multiple aysnchronous
- * queues we always process only one between synchronous messages.
- *
- * For multiple asynchronous queues we round robin through the high priorities first and pick
- * the first one available. Next time when we come around for asynchronous message we start
- * from the next stream onwards so this guarantees that we give equal time slices for same
- * priority queues. If no high priority queues are active we go to low priority queues and repeat
- * the same process.
- *------------------------------------------------------------------------------
- */
-
-int main(void)
-{
-    unsigned char *msg = (uint8_t *)&(_dmem.buf.data[0]);
-
-    /* We wait until host reads sync message */
-    reg_write(CONFIG_IPC_ROFF_HOST_RX_DOORBELL, GV_FW_IPC_HOST_SYNC);
-
-    while ( GV_DOORBELL_STATS != reg_read(CONFIG_IPC_ROFF_HOST_DOORBELL_STATUS) )
-    { /*poll register until done bit is set */
-        /* Host re-writes Vsparc DRAM (BSS) in this loop and will hit the DONE bit when complete */
-    }
-    enable_intr();
-    /* Initialize State for queues */
-    viddec_fw_parser_register_callbacks();
-    FwIPC_Initialize(GET_IPC_HANDLE(_dmem), (volatile char *)msg);
-    _dmem.g_pk_data.high_id = _dmem.g_pk_data.low_id = -1;
-    viddec_pm_init_ops();
-    stack_corrupted = 0xDEADBEEF;
-    while (1)
-    {
-        viddec_fw_process_sync_queues(msg);
-        viddec_fw_process_async_queues();
-        viddec_fw_int_host();
-#if 0
-        if (stack_corrupted != 0xDEADBEEF)
-        {
-            WRITE_SVEN(SVEN_MODULE_EVENT_GV_FW_FATAL_STACK_CORRPON, 0, 0, 0, 0, 0, 0);
-            while (1);
-        }
-#endif
-    }
-    return 1;
-}
diff --git a/mix_vbp/viddec_fw/fw/parser/utils.c b/mix_vbp/viddec_fw/fw/parser/utils.c
deleted file mode 100644
index dd65bf5..0000000
--- a/mix_vbp/viddec_fw/fw/parser/utils.c
+++ /dev/null
@@ -1,253 +0,0 @@
-#include "fw_pvt.h"
-#include "viddec_fw_parser_ipclib_config.h"
-
-extern uint32_t timer;
-
-/*------------------------------------------------------------------------------
- * Function:  memcpy
- * This is a memory-copy function.
- *------------------------------------------------------------------------------
- */
-/* NOTE: we are inventing memcpy since we don't want to include string libs as part of FW Due to size limitations*/
-void *memcpy(void *dest, const void *src, uint32_t n)
-{
-    uint8_t *ptr8_frm, *ptr8_to;
-    uint32_t *ptr32_frm, *ptr32_to;
-    uint32_t bytes_left=n,trail = 0;
-    uint32_t align=0;
-
-    ptr8_frm = (uint8_t *)src;
-    ptr8_to = (uint8_t *)dest;
-
-    trail = ((uint32_t)ptr8_frm) & 0x3;
-    if ((trail == (((uint32_t)ptr8_to) & 0x3)) && (n > 4))
-    {
-        /* check to see what's the offset bytes to go to a word alignment */
-        bytes_left -= trail;
-        while (align > 0) {
-            *ptr8_to ++ = *ptr8_frm ++;
-            trail--;
-        }
-        /* check to see if rest of bytes is a multiple of 4. */
-        trail = bytes_left & 0x3;
-        bytes_left = (bytes_left >> 2) << 2;
-        ptr32_to = (uint32_t *)ptr8_to;
-        ptr32_frm = (uint32_t *)ptr8_frm;
-        /* copy word by word */
-        while (bytes_left > 0) {
-            *ptr32_to ++ = *ptr32_frm ++;
-            bytes_left -= 4;
-        }
-        /* If there are any trailing bytes do a byte copy */
-        ptr8_to = (uint8_t *)ptr32_to;
-        ptr8_frm = (uint8_t *)ptr32_frm;
-        while (trail > 0) {
-            *ptr8_to ++ = *ptr8_frm ++;
-            trail--;
-        }
-    }
-    else
-    {/* case when src and dest addr are not on same alignment.
-        Just do a byte copy */
-        while (bytes_left > 0) {
-            *ptr8_to ++ = *ptr8_frm ++;
-            bytes_left -= 1;
-        }
-    }
-    return dest;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  memset
- * This is a function to copy specificed value into memory array.
- *------------------------------------------------------------------------------
- */
-/* NOTE: we are inventing memset since we don't want to include string libs as part of FW Due to size limitations*/
-void *memset(void *s, int32_t c, uint32_t n)
-{
-    uint8_t *ptr8 = (uint8_t *)s;
-    uint32_t *ptr32, data;
-    uint32_t mask = 0, bytes_left = n;
-
-    mask = c & 0xFF;
-    mask |= (mask << 8);
-    mask |= (mask << 16);
-    if (n >= 4)
-    {
-        uint32_t trail=0;
-        trail = 4 - (((uint32_t)ptr8) & 0x3);
-        if (trail < 4)
-        {
-            ptr32 = (uint32_t *)(((uint32_t)ptr8) & ~0x3);
-            data = (*ptr32 >> (8*trail)) << (8*trail);
-            data |= (mask >> (32 - (8*trail)));
-            *ptr32 = data;
-            bytes_left -= trail;
-            ptr8 += trail;
-        }
-        ptr32 = (uint32_t *)((uint32_t)ptr8);
-        while (bytes_left >= 4)
-        {
-            *ptr32 = mask;
-            ptr32++;
-            bytes_left -=4;
-        }
-        if (bytes_left > 0)
-        {
-            data = (*ptr32 << (8*bytes_left)) >> (8*bytes_left);
-            data |= (mask << (32 - (8*bytes_left)));
-            *ptr32=data;
-        }
-    }
-
-    return s;
-}
-
-/*------------------------------------------------------------------------------
- * Function:  cp_using_dma
- * This is a function to copy data from local memory to/from system memory.
- * Params:
- *         [in] ddr_addr  : Word aligned ddr address.
- *         [in] local_addr: Word aligned local address.
- *         [in] size      : No of bytes to transfer.
- *         [in] to_ddr    : Direction of copy, if true copy to ddr else copy to local memory.
- *         [in] swap      : Enable or disable byte swap(endian).
- *         [out] return   : Actual number of bytes copied, which can be more than what was requested
- *                          since we can only copy words at a time.
- * Limitations: DMA can transfer Words only, Local addr & DDR addr should be word aligned.
- *------------------------------------------------------------------------------
- */
-uint32_t cp_using_dma(uint32_t ddr_addr, uint32_t local_addr, uint32_t size, char to_ddr, char swap)
-{
-    uint32_t val=0, wrote = size;
-
-    while ((reg_read(DMA_CONTROL_STATUS) & DMA_CTRL_STATUS_BUSY) != 0)
-    {
-        /* wait if DMA is busy with a transcation Error condition??*/
-    }
-
-    reg_write(DMA_SYSTEM_ADDRESS, (ddr_addr & ~3) & ~GV_DDR_MEM_MASK);
-    reg_write(DMA_LOCAL_ADDRESS, (local_addr & 0xfffc));
-    //wrote += (ddr_addr & 0x3);
-    wrote = (wrote+3)>>2;/* make number of bytes multiple of 4 */
-    val=(wrote & 0xffff) << 2;
-    reg_write(DMA_CONTROL_STATUS, DMA_CTRL_STATUS_DONE);
-    val |= DMA_CTRL_STATUS_START;
-    /* If size > 64 use 128 byte burst speed */
-    if (wrote > 64)
-        val |= (1<<18);
-    if (swap) /* Endian swap if needed */
-        val |= DMA_CTRL_STATUS_SWAP;
-    if (to_ddr)
-        val = val | DMA_CTRL_STATUS_DIRCN;
-    reg_write(DMA_CONTROL_STATUS, val);
-    while ((reg_read(DMA_CONTROL_STATUS) & DMA_CTRL_STATUS_DONE) == 0)
-    {
-        /* wait till DMA is done */
-    }
-    reg_write(DMA_CONTROL_STATUS, DMA_CTRL_STATUS_DONE);
-
-    return (wrote << 2);
-}
-
-/*------------------------------------------------------------------------------
- * Function:  cp_using_dma
- * This is a function to copy data from local memory to/from system memory.
- * Params:
- *         [in] ddr_addr  : Word aligned ddr address.
- *         [in] local_addr: Word aligned local address.
- *         [in] size      : No of bytes to transfer.
- *         [in] to_ddr    : Direction of copy, if true copy to ddr else copy to local memory.
- *         [in] swap      : Enable or disable byte swap(endian).
- *         [out] return   : Actual number of bytes copied, which can be more than what was requested
- *                          since we can only copy words at a time.
- * Limitations: DMA can transfer Words only, Local addr & DDR addr should be word aligned.
- *------------------------------------------------------------------------------
- */
-uint32_t cp_using_dma_phys(uint32_t ddr_addr, uint32_t local_addr, uint32_t size, char to_ddr, char swap)
-{
-    uint32_t val=0, wrote = size;
-
-    while ((reg_read(DMA_CONTROL_STATUS) & DMA_CTRL_STATUS_BUSY) != 0)
-    {
-        /* wait if DMA is busy with a transcation Error condition??*/
-    }
-
-    reg_write(DMA_SYSTEM_ADDRESS, (ddr_addr & ~3));
-    reg_write(DMA_LOCAL_ADDRESS, (local_addr & 0xfffc));
-    //wrote += (ddr_addr & 0x3);
-    wrote = (wrote+3)>>2;/* make number of bytes multiple of 4 */
-    val=(wrote & 0xffff) << 2;
-    reg_write(DMA_CONTROL_STATUS, DMA_CTRL_STATUS_DONE);
-    val |= DMA_CTRL_STATUS_START;
-    /* If size > 64 use 128 byte burst speed */
-    if (wrote > 64)
-        val |= (1<<18);
-    if (swap) /* Endian swap if needed */
-        val |= DMA_CTRL_STATUS_SWAP;
-    if (to_ddr)
-        val = val | DMA_CTRL_STATUS_DIRCN;
-    reg_write(DMA_CONTROL_STATUS, val);
-    while ((reg_read(DMA_CONTROL_STATUS) & DMA_CTRL_STATUS_DONE) == 0)
-    {
-        /* wait till DMA is done */
-    }
-    reg_write(DMA_CONTROL_STATUS, DMA_CTRL_STATUS_DONE);
-
-    return (wrote << 2);
-}
-
-void update_ctrl_reg(uint8_t enable, uint32_t mask)
-{
-    uint32_t read_val = 0;
-    read_val = reg_read(CONFIG_CP_CONTROL_REG);
-    if (enable)
-    {
-        read_val = read_val | mask;
-    }
-    else
-    {
-        read_val = read_val & ~mask;
-    }
-    reg_write(CONFIG_CP_CONTROL_REG, read_val);
-    return;
-
-}
-
-extern uint32_t sven_get_timestamp();
-
-uint32_t set_wdog(uint32_t offset)
-{
-#ifdef B0_TIMER_FIX
-    update_ctrl_reg(0, WATCH_DOG_ENABLE);
-    reg_write(INT_REG, INT_WDOG_ENABLE);
-    reg_write(WATCH_DOG_COUNTER, offset & WATCH_DOG_MASK);
-    update_ctrl_reg(1, WATCH_DOG_ENABLE);
-    return offset & WATCH_DOG_MASK;
-#else
-    return sven_get_timestamp();
-#endif
-}
-
-void get_wdog(uint32_t *value)
-{
-#ifdef B0_TIMER_FIX
-    *value = reg_read(WATCH_DOG_COUNTER) & WATCH_DOG_MASK;
-    reg_write(INT_REG, ~INT_WDOG_ENABLE);
-    update_ctrl_reg(0, WATCH_DOG_ENABLE);
-#else
-    *value = sven_get_timestamp();
-#endif
-}
-
-uint32_t get_total_ticks(uint32_t start, uint32_t end)
-{
-    uint32_t value;
-#ifdef B0_TIMER_FIX
-    value = (start-end) + (start*timer);
-    timer=0;
-#else
-    value = end-start;/* convert to 1 MHz clocks */
-#endif
-    return value;
-}
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c b/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
index 9ed4285..1bf8ee6 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_h264_parser.c
@@ -177,14 +177,16 @@
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#ifdef VBP
+    pcontext->parser_ops->is_wkld_done = NULL;
+#else
     pcontext->parser_ops->is_wkld_done = dlsym(pcontext->fd_parser, "viddec_h264_wkld_done");
     if (NULL == pcontext->parser_ops->is_wkld_done)
     {
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#endif
     /* entry point not needed */
     pcontext->parser_ops->is_frame_start = NULL;
     return VBP_OK;
diff --git a/mix_vbp/viddec_fw/fw/parser/vbp_mp42_parser.c b/mix_vbp/viddec_fw/fw/parser/vbp_mp42_parser.c
index 249a9f8..dfa536b 100644
--- a/mix_vbp/viddec_fw/fw/parser/vbp_mp42_parser.c
+++ b/mix_vbp/viddec_fw/fw/parser/vbp_mp42_parser.c
@@ -104,14 +104,16 @@
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#ifdef VBP
+    pcontext->parser_ops->parse_sc = NULL;
+#else
     pcontext->parser_ops->parse_sc = dlsym(pcontext->fd_parser, "viddec_parse_sc_mp4");
     if (pcontext->parser_ops->parse_sc == NULL)
     {
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#endif
     pcontext->parser_ops->parse_syntax = dlsym(pcontext->fd_parser, "viddec_mp4_parse");
     if (pcontext->parser_ops->parse_syntax == NULL)
     {
@@ -125,14 +127,16 @@
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#ifdef VBP
+    pcontext->parser_ops->is_wkld_done = NULL;
+#else
     pcontext->parser_ops->is_wkld_done = dlsym(pcontext->fd_parser, "viddec_mp4_wkld_done");
     if (pcontext->parser_ops->is_wkld_done == NULL)
     {
         ETRACE ("Failed to set entry point." );
         return VBP_LOAD;
     }
-
+#endif
     return VBP_OK;
 }
 
diff --git a/mix_vbp/viddec_fw/fw/parser/viddec_pm_parser_ops.c b/mix_vbp/viddec_fw/fw/parser/viddec_pm_parser_ops.c
index d23c758..f96cd53 100644
--- a/mix_vbp/viddec_fw/fw/parser/viddec_pm_parser_ops.c
+++ b/mix_vbp/viddec_fw/fw/parser/viddec_pm_parser_ops.c
@@ -73,6 +73,7 @@
 
 }
 
+#ifndef VBP
 static inline int32_t viddec_pm_append_restof_pixel_data(void *parent, uint32_t cur_wkld)
 {
     int32_t ret = 1;
@@ -101,6 +102,7 @@
 {
     return viddec_pm_append_restof_pixel_data(parent,  0);
 }
+#endif
 
 viddec_workload_t* viddec_pm_get_header(void *parent)
 {
@@ -140,6 +142,7 @@
     return ret;
 }
 
+#ifndef VBP
 int32_t viddec_pm_append_misc_tags(void *parent, uint32_t start, uint32_t end, viddec_workload_item_t *wi, uint32_t using_next)
 {
     int32_t ret = 1;
@@ -152,6 +155,7 @@
     return ret;
 
 }
+#endif
 
 void viddec_pm_set_next_frame_error_on_eos(void *parent, uint32_t error)
 {
diff --git a/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_bstream.c b/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_bstream.c
index 4130234..853e52a 100644
--- a/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_bstream.c
+++ b/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_bstream.c
@@ -51,6 +51,7 @@
     return ret;
 }
 
+#ifndef VBP
 /*
   This function returns true if cubby buffer has the last byte of access unit.
 */
@@ -67,13 +68,14 @@
     }
     return ret;
 }
+#endif
 
 /* This function initializes scratch buffer, which is used for staging already read data, due to DMA limitations */
 static inline void viddec_pm_utils_bstream_scratch_init(viddec_pm_utils_bstream_scratch_cxt_t *cxt)
 {
     cxt->st = cxt->size = cxt->bitoff=0;
 }
-
+#ifndef VBP
 /* This function tells us how much more data is in the current es buffer from current position. Its used to figure out if
    we need to go to next es buffer
 */
@@ -137,6 +139,7 @@
         data++;
     }
 }
+#endif
 
 /* This function populates requested number of bytes into data parameter, skips emulation prevention bytes if needed */
 static inline int32_t viddec_pm_utils_getbytes(viddec_pm_utils_bstream_buf_cxt_t *bstream,
@@ -259,6 +262,7 @@
     }
 }
 
+#ifndef VBP
 /*
   This function gets physical address of the requested au offset(pos).
 */
@@ -344,6 +348,7 @@
         }
     }
 }
+#endif
 
 /*
   Init function called by parser manager after sc code detected.
diff --git a/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_list.c b/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_list.c
index 1641c6c..dc2e47c 100644
--- a/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_list.c
+++ b/mix_vbp/viddec_fw/fw/parser/viddec_pm_utils_list.c
@@ -14,6 +14,7 @@
     cxt->first_scprfx_length = 0;
 }
 
+#ifndef VBP
 /*
   Add a new ES buffer to list. If not succesful returns 0.
  */
@@ -223,3 +224,4 @@
         list->total_bytes = length;
     }
 }
+#endif
diff --git a/mix_video/docs/reference/MixVideo/html/home.png b/mix_video/docs/reference/MixVideo/html/home.png
deleted file mode 100644
index 1700361..0000000
--- a/mix_video/docs/reference/MixVideo/html/home.png
+++ /dev/null
Binary files differ
diff --git a/mix_video/docs/reference/MixVideo/html/left.png b/mix_video/docs/reference/MixVideo/html/left.png
deleted file mode 100644
index 2d05b3d..0000000
--- a/mix_video/docs/reference/MixVideo/html/left.png
+++ /dev/null
Binary files differ
diff --git a/mix_video/docs/reference/MixVideo/html/right.png b/mix_video/docs/reference/MixVideo/html/right.png
deleted file mode 100644
index 92832e3..0000000
--- a/mix_video/docs/reference/MixVideo/html/right.png
+++ /dev/null
Binary files differ
diff --git a/mix_video/docs/reference/MixVideo/html/up.png b/mix_video/docs/reference/MixVideo/html/up.png
deleted file mode 100644
index 85b3e2a..0000000
--- a/mix_video/docs/reference/MixVideo/html/up.png
+++ /dev/null
Binary files differ