/*                                                                          */
/* File Name   : mbdr_dsp_debug_prob_write.c                                */
/*                                                                          */
/* Written By  : 79556                                                      */
/*                                                                          */
/* versions    :                                                            */
/*+--------+-----------+---------------------------------------------------+*/
/*| 0.02.02|10/Aug/2009|- optimize mbdr_dsp_cyclic_buf_read_n_items        |*/
/*|        |           |- optimize mbdr_dsp_dbg_print_prob_dw_buf          |*/
/*+--------+-----------+---------------------------------------------------+*/
/*|        |20/Feb/2014|- mbdr_dsp_dbg_print_prob_dw_buf_nop               |*/
/*+--------+-----------+---------------------------------------------------+*/


#include "windef.h"
#include "string.h"
#include "mbdr_dsp_debug_prob.h"
#include "mbdr_dsp_utils.h"


#define MBDR_DSP_DBG_PRINT_PROB_DW_SEND_NEXT_IF_NEED1_M(MY_TEMP)\
     my_next_prob_p = (remain>0)\
                     ?po_prob_fp\
                     :&my_dummy;\
	*my_next_prob_p = MY_TEMP;\
     remain--




void mbdr_dsp_dbg_print_prob_word_buf(const SHORT *pi_word_buf_p,
                                      int   pi_buf_byte_size,
                                      volatile SHORT  *po_prob_fp)
{/* mbdr_dsp_dbg_print_prob_word_buf */
 int i;
 for(i=0; i< pi_buf_byte_size/sizeof(SHORT); i++)
     *po_prob_fp = *pi_word_buf_p++;
}/* mbdr_dsp_dbg_print_prob_word_buf */


void mbdr_dsp_dbg_print_prob_dw_buf_nop(const void     *pi_buf_p,
                                        int             pi_buf_byte_size,
                                        volatile LONG  *po_prob_fp)
{/* mbdr_dsp_dbg_print_prob_dw_buf_nop */

 /* avoid warning */
 mbdr_dsp_utils_dummy = (LONG)pi_buf_p
                       +pi_buf_byte_size
					   +(LONG)po_prob_fp;

}/* mbdr_dsp_dbg_print_prob_dw_buf_nop */




void mbdr_dsp_dbg_print_prob_dw_buf(const void     *pi_buf_p,
                                    int             pi_buf_byte_size,
                                    volatile LONG  *po_prob_fp)
{/* mbdr_dsp_dbg_print_dw_buf */

 SHORT i, remain;
 LONG  temp_0, temp_1, temp_2, temp_3;
 const LONG  *my_dw_input_buf_p;

 LONG  buf_dw_number;

 my_dw_input_buf_p = (LONG *)pi_buf_p;


 buf_dw_number = pi_buf_byte_size/sizeof(LONG);
 remain = buf_dw_number % 4;

 temp_0 = *my_dw_input_buf_p++;
 temp_1 = *my_dw_input_buf_p++;
 temp_2 = *my_dw_input_buf_p++;
 for(i=0; i<buf_dw_number/4; i++)
 {
    temp_3 = *my_dw_input_buf_p++;
   *po_prob_fp = temp_0;
    temp_0 = *my_dw_input_buf_p++;
   *po_prob_fp = temp_1;
    temp_1 = *my_dw_input_buf_p++;
   *po_prob_fp = temp_2;
    temp_2 = *my_dw_input_buf_p++;
   *po_prob_fp = temp_3;
 }

  if(remain>0)
     *po_prob_fp = temp_0;
  if(remain>1)
     *po_prob_fp = temp_1;
  if(remain>2)
     *po_prob_fp = temp_2;

}/* mbdr_dsp_dbg_print_dw_buf */
