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

📄 fbm_synchro_vs.c

📁 tuner扫描
💻 C
📖 第 1 页 / 共 5 页
字号:
               } /* End 2.6 frame store mode */

               else if(p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)
                  /*-----------------------------------------------------------------!
                    !  3.0 Frame Store Mode: background decoding of I/P picture =>     !
                    !  B picture not decoded                                           !
                    !-----------------------------------------------------------------*/
               {
                  lv_run_play_dec_algo = FALSE;
               }
               else
               {
                  lv_run_play_dec_algo = TRUE;
               }
            } /* End: Picture for freeze has been found AND freeze mode is requested */

            /* Current trick mode is a freeze trick mode AND LEAVING this trick mode IS
               requested */

            else if((p->freeze_status          != MV_DEC_FREEZE_MODE_NONE)&&
                    (p->freeze_mode_requested  == MV_DEC_FREEZE_MODE_NONE))
            {
               if(p->freeze_status != MV_DEC_FREEZE_MODE_B)
               {
                  /* Handled normally by the play_dec_algorithm */
                  lv_run_play_dec_algo = TRUE; 
               }
               else
               {
                  /* freeze_status == MV_DEC_FREEZE_MODE_B */
                  if(p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)
                  {
                     /* Don't decode any B picture as long as the freeze mode is MV_DEC_FREEZE_MODE_B
                        It's because of BUFFER DEALLOCATION ISSUE */
                     lv_run_play_dec_algo = FALSE;
                  }
                  else
                  {
                     lv_run_play_dec_algo = TRUE;
                  }
               } /* End freeze_status == MV_DEC_FREEZE_MODE_B */
            } /* End: Current trick mode is a freeze trick mode AND change of trick mode IS
                 requested */

	    /*------------------!
              !    Scan mode      !
              !------------------*/

            else if((p->scan_status == MV_DEC_SCAN_MODE_I_PICTURE)
                    &&
                    (((p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_P)&&
                      (lv_second_field_P_picture_with_first_field_I_picture==FALSE))
                     ||
                     (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B))
                    )
            {
               lv_run_play_dec_algo = FALSE;
            }

            else if ((p->scan_status == MV_DEC_SCAN_MODE_IP_PICTURE)&&
                     (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)
                     )
            {
               lv_run_play_dec_algo = FALSE;
            }

          
            /*------------------!
              !    Step mode      !
              !------------------*/

            else if(p->step_status != MV_DEC_STEP_MODE_NONE)
            {
               if((p->step_status == MV_DEC_STEP_MODE_I)&&
                  (((p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_P) &&
                    (lv_second_field_P_picture_with_first_field_I_picture==FALSE)) ||
                   (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)))
               {
                  lv_run_play_dec_algo = FALSE;
               }
               else if((p->step_status == MV_DEC_STEP_MODE_IP) &&
                       (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B))
               {
                  lv_run_play_dec_algo = FALSE;
               }
               else
               {
                  lv_run_play_dec_algo = TRUE;
               }
             
            }

            /*-----------------------------------------------------------------!
              !  EOPH correspond to picture D99 found after                    !
              !  MV_FBM_reset_and_restart_hw, so it must be discarded          !
              !---------------------------------------------------------------*/
            else if((p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_D) &&
                    ((p->next_picture.temporal_reference==99)))
            {
               lv_run_play_dec_algo = FALSE;
            }
            else
            {
               lv_run_play_dec_algo = TRUE;
            }
         
            if(lv_run_play_dec_algo == FALSE)
            {
               /*----------------------------------------------------------------!
                 !    Not running the play decoding algorithm means that the next  !
                 !    picture should not be decoded                                !
                 !----------------------------------------------------------------*/

               lv_decode_picture = FALSE;
            }
            else
            {
               /*----------------------------------------------------------------!
                 !    Decoding play algorithm should be run: set input parameters  !
                 !----------------------------------------------------------------*/
     
               if(p->freeze_status!= MV_DEC_FREEZE_MODE_NONE)
               {
                  lv_forbidden_frame_store = p->next_displayed_picture_for_freeze.frame_store;
               }
               else
               {
                  lv_forbidden_frame_store = FBM_NO_FS;
               }

               MV_FBM_play_dec_algo(
                  &(p->next_picture),
                  &(p->next_past_picture),
                  &(p->next_future_picture),
                  &lv_decode_picture,
                  &lv_discard_picture,
                  (const BOOLEAN)            lv_next_picture_is_new_frame,
                  (const FBM_PICTURE *)      (&(p->cur_picture)),
                  (const FBM_PICTURE *)      (&(p->cur_past_picture)),
                  (const FBM_PICTURE *)      (&(p->cur_future_picture)),
                  (const BOOLEAN)            lv_gop_found,
                  (const FBM_GOP *)          (&(p->gop)),
                  (const BOOLEAN)            p->dec_to_disp_N1,
                  (const MV_FBM_FRAME_STORE) lv_forbidden_frame_store,
                  &(p->I_or_GI_P_found_after_trick_mode_broken_link),
                  &(p->trick_mode_broken_link),
                  &(p->decode_P_possible),
                  &(p->decode_B_possible),
                  &(p->last_tab_label_used),
                  &(p->toggle_24hz),
                  &(p->top_field_first_24hz)
                  );

               GV_MV_DEC_status.dec_pict_info.pict_y_odd_buf_addr =
                  (void *)p->frame_store_y_odd_add[p->next_picture.frame_store];
               GV_MV_DEC_status.dec_pict_info.pict_y_even_buf_addr =
                  (void *)p->frame_store_y_even_add[p->next_picture.frame_store];
               GV_MV_DEC_status.dec_pict_info.pict_c_odd_buf_addr =
                  (void *)p->frame_store_c_odd_add[p->next_picture.frame_store];
               GV_MV_DEC_status.dec_pict_info.pict_c_even_buf_addr = 
                  (void *)p->frame_store_c_even_add[p->next_picture.frame_store];
              
            } /* End run decoding algorithm for play mode */
          
            /* Notify the application MV_DEC_EOPH_EVENT
               this event is notify here and not directly in ISR LF_FBM_eoph_handler()
               because if we are not using FBM_IN_ISR_ONLY mode, we are not sure
               picture informations are updated before application receive
               MV_DEC_EOPH_EVENT, which is used to aware application that it can
               call MV_DEC_get_picture_info() API */
            if ((GV_MV_DEC_status.dec_event_enabled & MV_DEC_EOPH_EVENT) && (p->pip_decoding_launched  == FALSE))
            {
               /* Notify the application. */
               GV_MV_DEC_status.function_ptr(MV_DEC_EOPH_EVENT);
            }
            else if ((GV_MV_DEC_status.dec_event_enabled & MV_DEC_PIP_EOPH_EVENT) && (p->pip_decoding_launched  == TRUE))
            {
               /* Notify the application. */
               GV_MV_DEC_status.function_ptr(MV_DEC_PIP_EOPH_EVENT);
            }
         
            
            /*--------------------------------------------------------------------------------!
              !   According to the output of the algorithm, synchronize or discard the picture  !
              !--------------------------------------------------------------------------------*/

            if(lv_decode_picture == TRUE)
            {
               /* DTS found */
               /* PR244 : streams without DTS */
               if((GV_MV_DEC_status.dec_dts_found == FALSE) && (GV_MV_DEC_status.dec_first_pict == TRUE))
               {
                  GV_MV_DEC_status.dec_first_pict = FALSE;               
                  MV_DEC_set_dts(p->next_picture.pict_pts);
                  /*DV_DBG_STORE_EVENT(IPVD_DBG_EV_USER,IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,p->next_picture.pict_pts,0,0,0);*/
               }

               MV_FBM_synchronize();

#ifdef DV_DEBUG
               /* Log synchronize event */
               if(GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_A)
               {
                  DV_DBG_STORE_EVENT( IPVD_DBG_EV_FBM_SYNCHRONIZE,IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                                      p->next_picture.picture_coding_type,
                                      p->next_picture.temporal_reference,MV_drv_info_video_time_stamp(),MV_drv_info_video_stca());
               }
               else /* GV_MV_DEC_status.dec_stc_used == MV_DEC_STC_B */
               {
                  DV_DBG_STORE_EVENT( IPVD_DBG_EV_FBM_SYNCHRONIZE,IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                                      p->next_picture.picture_coding_type,
                                      p->next_picture.temporal_reference,MV_drv_info_video_time_stamp(),MV_drv_info_video_stcb());
               }
#endif   
               /*------------------------!
                 !    Freeze IP mode       !
                 !------------------------*/
	      
               if((p->freeze_mode_requested         == MV_DEC_FREEZE_MODE_IP)&&
                  (p->freeze_status                 != MV_DEC_FREEZE_MODE_IP)&&
                  (p->picture_found_for_freeze_flag == FALSE))
               {
                  MV_FBM_freeze_expected_picture_yn(
                     (const FBM_PICTURE*) &(p->next_picture),
                     (const MV_FBM_FRAME_STORE) FBM_ANY_FS,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_I,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_I,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_P,
                     (const BOOLEAN) lv_next_picture_is_new_frame,                  
                     &(p->picture_found_for_freeze_flag));

                  if(p->picture_found_for_freeze_flag == TRUE)
                  {
                     p->picture_found_for_freeze = p->next_picture;
                  }

               }

               /*------------------------!
                 !    Freeze B mode        !
                 !------------------------*/

               if((p->freeze_mode_requested         == MV_DEC_FREEZE_MODE_B)&&
                  (p->freeze_status                 != MV_DEC_FREEZE_MODE_B)&&
                  (p->picture_found_for_freeze_flag == FALSE))
               {
                  MV_FBM_freeze_expected_picture_yn(
                     (const FBM_PICTURE*) &(p->next_picture),
                     (const MV_FBM_FRAME_STORE) FBM_ANY_FS,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_B,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_B,
                     (const MV_PICTURE_CODING_TYPE) MV_PICTURE_CODING_TYPE_B,
                     (const BOOLEAN) lv_next_picture_is_new_frame,                  
                     &(p->picture_found_for_freeze_flag));

                  if(p->picture_found_for_freeze_flag == TRUE)
                  {
                     p->picture_found_for_freeze = p->next_picture;
                  }
               }


            } /* End Picture to be decoded */
            else
            {
               /*------------------------!
                 ! 	Discard           !
                 !------------------------*/

               p->picture_discarded_since_last_in_sync = TRUE;

               if((p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_I)||
                  (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_P))
               {
                  MV_FBM_discard_IP(p);
               }
               else if (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_B)
               {
                  MV_FBM_discard_B(p);
               }
               else if (p->next_picture.picture_coding_type==MV_PICTURE_CODING_TYPE_D)
               {
                  if (LV_cleanup_and_restart_on_I_requested == TRUE)
                  {
                     LV_cleanup_and_restart_on_I_requested = FALSE;
                     /*--------------------------------------------!
                     !    Set the flags to restart on I picture    !
                     !--------------------------------------------*/
                     p->decode_B_possible             = FALSE;
                     p->decode_P_possible             = FALSE;
                     /* Flag trick mode broken link in order to restart on an I picture */

⌨️ 快捷键说明

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