⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mv_dec.c

📁 tuner扫描
💻 C
📖 第 1 页 / 共 4 页
字号:

    Scan modes can be :
    
    - MV_DEC_SCAN_MODE_I_PICTURE : Decode and display only I pictures
    
    - MV_DEC_SCAN_MODE_IP_PICTURE : Decode and display only I and P
    pictures
    
    - MV_DEC_SCAN_MODE_NONE : Scan mode is desactivated
                                  
    Normal decoding and display can be resumed by calling MV_DEC_play() API.

    NOTES:
    MV_DEC_scan() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    Video Decoder is in state MV_DEC_DECODING_STATE_SCANNING
    
    CALLING SEQUENCE:
*/
extern void
MV_DEC_scan(    
   MV_DEC_SCAN_MODE in_scan_mode
   )
/*EMP=======================================================================*/
{
   UInt32 lv_protection_level;

   MV_FBM_scan((MV_DEC_SCAN_MODE)in_scan_mode);

   tmosalDisableInterruptsNoSysCall(&lv_protection_level);
   GV_MV_DEC_status.dec_state = MV_DEC_DECODING_STATE_SCANNING;
   tmosalEnableInterruptsNoSysCall(lv_protection_level);
   
} /* End of MV_DEC_scan */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_step

    PACKAGE:           MV_DEC
 
    SCOPE:             PLATFORM

    DESCRIPTION:
    Perform a single step and display the next picture of the type
    selected with the step mode.

    - MV_DEC_STEP_MODE_I : Decode and display the next I picture
    from the input stream.

    - MV_DEC_STEP_MODE_IP : Decode and display the next I or P
    picture from the input stream.

    - MV_DEC_STEP_MODE_NONE : Step mode is desactivated

    The decoding process is stopped when the next picture is decoded.
    The data in the video input buffer is NOT discarded.
    So stepping should only be used when the incoming datastream is under
    application control. 

    Normal decoding and display can be resumed by calling MV_DEC_play() API.
    
    NOTES:
    MV_DEC_step() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    Video Decoder is in state MV_DEC_DECODING_STATE_STEPPING
    
    CALLING SEQUENCE:
*/
extern void                   
MV_DEC_step(    
   MV_DEC_STEP_MODE in_step_mode)
/*EMP=======================================================================*/
{
   UInt32 lv_protection_level;

   MV_FBM_step(in_step_mode);

   tmosalDisableInterruptsNoSysCall(&lv_protection_level);
   GV_MV_DEC_status.dec_state = MV_DEC_DECODING_STATE_STEPPING;
   tmosalEnableInterruptsNoSysCall(lv_protection_level);
   
} /* End of MV_DEC_step */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_set_dts

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM
    
    DESCRIPTION:
    Sets a decoding time stamp (DTS) for the video decoder.

    NOTE:
    Only the last 24 bits of DTS will be loaded.
    MV_DEC_set_dts() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:
*/
void                              /* Returns: <description> */
extern MV_DEC_set_dts(    
   MV_DEC_DTS in_dts
   )
/*EMP=======================================================================*/
{
   MV_drv_set_video_time_stamp((MV_T24BITS)in_dts);
   MV_drv_set_load_dts(MV_BIT_ON);
   
} /* End of MV_DEC_set_dts */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_set_stc

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM

    DESCRIPTION:
    Load immediately a new system time clock (STC) into the video decoder.

    NOTE:
    Only the last 24 bits of STC will be loaded.

    NOTES:
    MV_DEC_get_picture_info() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:
*/
extern int GV_Delta_VIDEO_DTS_PTS;//JI
extern void
MV_DEC_set_stc(    
   MV_DEC_STC in_stc)
/*EMP=======================================================================*/
{
#ifdef DV_DEBUG
   register unsigned long lv_info0;// = in_stc & 0x00FFFFFF;
#endif
	in_stc += GV_Delta_VIDEO_DTS_PTS;
#ifdef DV_DEBUG
   lv_info0 = in_stc & 0x00FFFFFF;
#endif
	
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_STC_UPDATED, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,0,0,0);
   
    /* load immediately the new STC if we are not handling a discontinuity
       if it's the case, that means the PCR loop regulation need to
       update the new PCR, so update the STC which will be switch on when
       picture of the new time base will be found */
    if(GV_MV_DEC_status.dec_discontinuity_detected == TRUE)
    {
        if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
        {
            MV_drv_set_setup_stc((MV_T24BITS)in_stc);
            MV_drv_set_load_stcb(MV_BIT_ON);
            MV_drv_set_stc_choice(MV_BIT_OFF);
        }
        else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */ 
        {
            MV_drv_set_setup_stc((MV_T24BITS)in_stc);
            MV_drv_set_load_stca(MV_BIT_ON);
            MV_drv_set_stc_choice(MV_BIT_ON);
        }
    }
    else
    {
        if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
        {
            MV_drv_set_setup_stc((MV_T24BITS)in_stc);
            MV_drv_set_load_stca(MV_BIT_ON);    
            MV_drv_set_stc_choice(MV_BIT_OFF);
        }
   
        else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */ 
        {
            MV_drv_set_setup_stc((MV_T24BITS)in_stc);
            MV_drv_set_load_stcb(MV_BIT_ON);
            MV_drv_set_stc_choice(MV_BIT_ON);
        }
    }

} /* End of MV_DEC_set_stc */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_get_stc

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM

    DESCRIPTION:
    retrieve the system time clock (STC) use by the video decoder.

    NOTE:
    The STC retrieved will be given on 24 bits.
    MV_DEC_get_stc() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:
*/
extern void                              /* Returns: <description> */
MV_DEC_get_stc(    
   MV_DEC_STC * ou_stc_ptr)
/*EMP=======================================================================*/
{
   
   if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
   {
      *ou_stc_ptr = MV_drv_info_video_stca();
   }
   else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */ 
   {
      *ou_stc_ptr = MV_drv_info_video_stcb();
   }
   
} /* End of MV_DEC_get_stc */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_discontinuity

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM

    DESCRIPTION:
    Prepare handling of discontinuity by video decoder.
    This function must be called by the application when the MSP finds a
    new PCR in the video data stream.

    NOTE:
    The PCR must be given on 24 bits.
    MV_DEC_discontinuity() can be call in an ISR.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:
*/
extern void                              /* Returns: <description> */
MV_DEC_discontinuity(    
MV_DEC_STC in_new_pcr)
/*EMP=======================================================================*/
{
   UInt32 lv_protection_level;

#ifdef DV_DEBUG
   register unsigned long lv_info0;// = in_new_pcr; JI
#endif   
	in_new_pcr += GV_Delta_VIDEO_DTS_PTS;
#ifdef DV_DEBUG
   lv_info0 = in_new_pcr & 0x00FFFFFF;
#endif   

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ENTER_DISCONTINUITY, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,0,0,0);

   /* PR346 : discontinuity occurs before firts DTS/PTS found */
   if ((GV_MV_DEC_status.dec_dts_found == FALSE) && (GV_MV_DEC_status.dec_pts_found == FALSE))
   {
      /* load immediately the new STC */
      if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
      {
         MV_drv_set_setup_stc((MV_T24BITS)in_new_pcr);
         MV_drv_set_load_stca(MV_BIT_ON);
      }
      else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */ 
      {
         MV_drv_set_setup_stc((MV_T24BITS)in_new_pcr);
         MV_drv_set_load_stcb(MV_BIT_ON);
      }
   }
   else
   {
      /* load immediately the new STC */
      if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
      {
         MV_drv_set_setup_stc((MV_T24BITS)in_new_pcr);
         MV_drv_set_load_stcb(MV_BIT_ON);
      }
      else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */ 
      {
         MV_drv_set_setup_stc((MV_T24BITS)in_new_pcr);
         MV_drv_set_load_stca(MV_BIT_ON);
      }

      tmosalDisableInterruptsNoSysCall(&lv_protection_level);
      GV_MV_DEC_status.dec_discontinuity_detected = TRUE;
      GV_MV_DEC_status.dec_dts_found = FALSE;
      GV_MV_DEC_status.dec_pts_found = FALSE;
      tmosalEnableInterruptsNoSysCall(lv_protection_level);
   }
   
} /* End of MV_DEC_discontinuity */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_decode_picture_in_picture

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM

    DESCRIPTION:
    Decode a still picture while video is decoding a stream.
    Decoding of this picture is possible by skipping a B picture
    in the mpeg video stream.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:
*/
extern void
MV_DEC_decode_picture_in_picture(    
unsigned long in_still_pict_y_odd_addr,
unsigned long in_still_pict_y_even_addr,
unsigned long in_still_pict_c_odd_addr,
unsigned long in_still_pict_c_even_addr
)
/*EMP=======================================================================*/
{
   MV_FBM_decode_pip(in_still_pict_y_odd_addr,
                     in_still_pict_y_even_addr,
                     in_still_pict_c_odd_addr,
                     in_still_pict_c_even_addr);
   
} /* End of MV_DEC_decode_picture_in_picture */


/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_DEC_set_pip_mode

    PACKAGE:           MV_DEC

    SCOPE:             PLATFORM

    DESCRIPTION:
    Prepare decoding of a still picture while video is decoding
    a stream.

    PRECONDITIONS:
    None

    POSTCONDITIONS:
    None

    CALLING SEQUENCE:    
    */
extern void
MV_DEC_set_pip_mode(    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -