📄 fbm_synchro_vs.c
字号:
! Store SEQUENCE + GOP (if present) headers !
!-----------------------------------------------------*/
MV_FBM_pip_store_seq_gop_hdr();
GV_MV_DEC_status.dec_shc_found = FALSE;
}
/*------------------------------------------------------!
! Store last PICTURE header if PIP mode enabled !
!-------------------------------------------------------*/
MV_FBM_pip_store_pict_hdr();
}
if(p->pip_decoding_requested == TRUE)
{
if(MV_drv_coding_type() == MV_PICTURE_CODING_TYPE_B)
{
MV_FBM_copy_shc_and_phc_in_still_fifo();
MV_FBM_switch_to_still_fifo();
/* No need to store SHC and PHC of the still fifo */
tmosalDisableInterruptsNoSysCall(&lv_protection_level);
GV_MV_DEC_status.dec_pip_enabled = FALSE;
tmosalEnableInterruptsNoSysCall(lv_protection_level);
p->pip_decoding_requested = FALSE;
p->pip_decoding_launched = TRUE;
/* restart decoder */
MV_drv_set_discard(MV_BIT_ON);
MV_drv_set_fbm_cmd(MV_FBM_CMD_DO_NOT_DECODE);
break;
}
}
if(p->pip_decoding_launched == TRUE)
{
/*------------------------!
! Synchronize !
!------------------------*/
p->pip_waiting_for_in_sync = TRUE;
MV_drv_set_synchronize(MV_BIT_ON);
DV_DBG_STORE_EVENT(IPVD_DBG_EV_PIP,IPVD_DBG_PIP_LEVEL,IPVD_SYNCHRONISE,0,0,0);
p->pip_disp_drv_info.seq_hor_size = MV_drv_seq_hor_size();
/* PR 836 we must program a sequence horizontal size in multiple of 16 */
/* (if not we must take the superior value of multiple of 16) for example */
/* for 354 we program 368 in dec_storing_hrz_size_nxt register*/
lv_modulo_hrz_size = (p->pip_disp_drv_info.seq_hor_size/16);
lv_remainder_hrz_size = (p->pip_disp_drv_info.seq_hor_size%16);
if (lv_remainder_hrz_size != 0)
{
lv_modulo_hrz_size = lv_modulo_hrz_size + 1;
p->pip_disp_drv_info.seq_hor_size = (DISP_SIZE)(lv_modulo_hrz_size * 16);
}
p->pip_disp_drv_info.seq_ver_size = MV_drv_seq_ver_size();
p->pip_disp_drv_info.aspect_ratio = MV_drv_aspect_ratio();
p->pip_disp_drv_info.frame_rate = MV_drv_frame_rate();
p->pip_disp_drv_info.disp_hor_size = MV_drv_disp_hor_size();
p->pip_disp_drv_info.disp_ver_size = MV_drv_disp_ver_size();
p->pip_disp_drv_info.centre_hor_offset = MV_drv_centre_hor_offset();
p->pip_disp_drv_info.centre_ver_offset = MV_drv_centre_ver_offset();
p->pip_disp_drv_info.mpeg2 = MV_drv_mpeg1_2();
/*break;*/
}
/* EOPH and EOPD could be arrived in the mean time but EOPH isr would be processed first,
switch back to video fifo has to be programmed otherwise system will be stucked */
if((p->pip_decoding_terminated == TRUE)||(p->pip_waiting_for_eopd == TRUE))
{
DV_DBG_STORE_EVENT(IPVD_DBG_EV_PIP,IPVD_DBG_PIP_LEVEL,IPVD_SWITCH_TO_FIFO_VIDEO,
(unsigned long)p->pip_decoding_terminated,(unsigned long)p->pip_waiting_for_eopd,0);
MV_FBM_switch_to_mpeg_fifo();
/* Restore copy of SHC and PHC of the mpeg fifo */
tmosalDisableInterruptsNoSysCall(&lv_protection_level);
GV_MV_DEC_status.dec_pip_enabled = TRUE;
if(p->pip_waiting_for_eopd == TRUE)
{
p->pip_eoph_for_video_fifo_switch_back_occured = TRUE;
}
p->pip_decoding_terminated = FALSE;
tmosalEnableInterruptsNoSysCall(lv_protection_level);
/* restart decoder */
MV_drv_set_discard(MV_BIT_ON);
MV_drv_set_fbm_cmd(MV_FBM_CMD_DO_NOT_DECODE);
break;
}
/*-------------------------------!
! End of Picture in picture Mode !
!-------------------------------*/
/*------------------------------------------------------------!
! Set 'waiting_for_sync' flag and increment picture number !
!------------------------------------------------------------*/
p->waiting_for_sync = TRUE;
p->next_picture.picture_number = p->picture_number++;
/*-----------------------------------------------------------!
! Update sequence (if necessary) and picture information !
!-----------------------------------------------------------*/
MV_FBM_update_pic_info(&(p->next_picture));
/* update picture informations fields in GV_MV_DEC_status */
GV_MV_DEC_status.dec_pict_info.temp_ref = p->next_picture.temporal_reference;
GV_MV_DEC_status.dec_pict_info.pict_coding_type = p->next_picture.picture_coding_type;
GV_MV_DEC_status.dec_pict_info.coded_win_width = p->next_picture.disp_drv_info.seq_hor_size;
GV_MV_DEC_status.dec_pict_info.coded_win_height = p->next_picture.disp_drv_info.seq_ver_size;
GV_MV_DEC_status.dec_pict_info.disp_win_width = p->next_picture.disp_drv_info.disp_hor_size;
GV_MV_DEC_status.dec_pict_info.disp_win_height = p->next_picture.disp_drv_info.disp_ver_size;
GV_MV_DEC_status.dec_pict_info.centre_off_hor = p->next_picture.disp_drv_info.centre_hor_offset;
GV_MV_DEC_status.dec_pict_info.centre_off_ver = p->next_picture.disp_drv_info.centre_ver_offset;
GV_MV_DEC_status.dec_pict_info.pitch = p->next_picture.disp_drv_info.seq_hor_size;
GV_MV_DEC_status.dec_pict_info.pict_pts = p->next_picture.pict_pts;
GV_MV_DEC_status.dec_pict_info.pict_dts = (MV_DEC_DTS)MV_drv_info_video_time_stamp();
GV_MV_DEC_status.dec_pict_info.top_field_first = (MV_DEC_TOP_FIELD_FIRST_FLAG)MV_drv_top_field_first();
#ifdef DV_DEBUG
lv_info0 = GV_MV_DEC_status.dec_pict_info.pict_coding_type;
lv_info1 = GV_MV_DEC_status.dec_pict_info.temp_ref;
#endif
DV_DBG_STORE_EVENT(IPVD_DBG_EV_PARSING_EOPH,IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,0,0);
{
int stc;
/*
* do only once after channel changing & received first I picture
* JI 2005-06-20 Initial
* 2005-08-04 Add test dec_sync_mode
*/
if (GV_MV_DEC_status.dec_sync_mode != MV_DEC_SYNC_MODE_BUF_CONTROLLED)
{
if ((GV_Delta_VIDEO_DTS_PTS == 0)&&(GV_MV_DEC_status.dec_pict_info.pict_coding_type == MV_PICTURE_CODING_TYPE_I))
{
MV_DEC_get_stc(&stc);
acquire_delta((stc&0xFFFFFF), (GV_MV_DEC_status.dec_pict_info.pict_dts&0xFFFFFF), ((p->next_picture.vbv_delay)&0xFFFF), &GV_Delta_VIDEO_DTS_PTS);
MV_DEC_set_stc(stc);
DV_DBG_store_event(0,0xFFFF,"STC_ADJUST_%d\n",GV_Delta_VIDEO_DTS_PTS,0,0);
}
}
}
/*-----------------------------------------------------------------!
! Dicontinuity handling : !
! EOPH correspond to picture D99 found after !
! MV_FBM_reset_and_restart_hw, so do not check it on this !
! picture !
!---------------------------------------------------------------*/
if (MV_drv_video_synchronisation_mode() == MV_VIDEO_BUF_CTRL_DTS_LOCKED)
{
if((p->next_picture.picture_coding_type!=MV_PICTURE_CODING_TYPE_D) &&
((p->next_picture.temporal_reference!=99)))
{
LF_FBM_check_discontinuity();
}
}
/*----------------------------------------------------------------------------!
! CHANGE CHANNEL REQUESTED !
!----------------------------------------------------------------------------*/
if(p->change_channel_requested == TRUE)
{
p->change_channel_requested = FALSE;
p->fbm_state = FBM_STATE_DEC_STOPPED;
tmosalDisableInterruptsNoSysCall(&lv_protection_level);
GV_MV_DEC_status.dec_state = MV_DEC_DECODING_STATE_STOPPED;
tmosalEnableInterruptsNoSysCall(lv_protection_level);
/* Make FBM start on new I picture */
MV_FBM_restart_on_I_after_channel_change(p);
if (GV_MV_DEC_status.dec_event_enabled & MV_DEC_STOPPED_EVENT)
{
/* Notify the application. */
GV_MV_DEC_status.function_ptr(MV_DEC_STOPPED_EVENT);
}
break;
}
/*---------------------------------------------------------!
! Prepare the GOP found information !
!---------------------------------------------------------*/
if((GV_MV_DEC_status.dec_gop_sc_found == TRUE) || ((MV_drv_video_event() & MV_DEC_VIDEO_EVENT_GOP_SC) == 1))
/* a GOP has been found */
{
/*-------------------------!
! Set gop_found_flag !
!-------------------------*/
lv_gop_found = TRUE;
tmosalDisableInterruptsNoSysCall(&lv_protection_level);
GV_MV_DEC_status.dec_gop_sc_found = FALSE;
tmosalEnableInterruptsNoSysCall(lv_protection_level);
/*-----------------------------!
! Update gop information !
!-----------------------------*/
MV_FBM_update_gop_info(&(p->gop));
}
else
/* No GOP has been found */
{
/*-------------------------!
! Set gop_found_flag !
!-------------------------*/
lv_gop_found = FALSE;
}
/*---------------------------------------------------------!
! Run play algorithm for decoding !
!---------------------------------------------------------*/
/* Determine whether the next picture corresponds to a new frame */
MV_FBM_is_next_picture_new_frame(p,&lv_next_picture_is_new_frame);
/* Determine whether the next picture is a P picture corresponding
to a Frame whose first picture is an I picture */
lv_second_field_P_picture_with_first_field_I_picture = FALSE;
if((lv_next_picture_is_new_frame == FALSE)&&
(p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_P)&&
(p->cur_picture.picture_coding_type ==MV_PICTURE_CODING_TYPE_I)
)
{
lv_second_field_P_picture_with_first_field_I_picture = TRUE;
}
/*---------------------------------------------------------!
! Determine whether play_decode algorithm should be run: !
! based on the trick mode state !
!---------------------------------------------------------*/
/*------------------!
! Freeze mode !
!------------------*/
/* Picture for freeze has been found AND freeze mode is requested */
if((p->picture_found_for_freeze_flag == TRUE)&&
(p->freeze_mode_requested != MV_DEC_FREEZE_MODE_NONE))
{
if(p->dec_picture_controlled == TRUE)
/*-----------------------------------------------------------------------------!
! Decoding is picture controlled: run FBM_play_dec_algo() for every picture !
!-----------------------------------------------------------------------------*/
{
lv_run_play_dec_algo = TRUE;
}
else if(p->dec_to_disp_N1 == TRUE)
/*-----------------------------------------------------------------!
! 2.6 Frame Store Mode => background decoding only for freeze B !
!-----------------------------------------------------------------*/
{
if(p->freeze_mode_requested == MV_DEC_FREEZE_MODE_B)
/* Freeze B (2.6 frame store mode)*/
{
if(p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)
{
/* Don't decode B picture */
lv_run_play_dec_algo = FALSE;
}
else
{
/* Decode IP picture if possible (run play_dec_algo) */
lv_run_play_dec_algo = TRUE;
}
} /* End of freeze B */
else
/* Freeze IP: No background decoding in 2.6 frame store mode */
{
lv_run_play_dec_algo = FALSE;
} /* End Freeze IP */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -