diff --git a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c index 426ee3e6..beb870d4 100644 --- a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c +++ b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c @@ -116,9 +116,10 @@ u32 XVidC_GetPixelClockHzByVmId(XVidC_VideoMode VmId) /******************************************************************************/ /** - * This function check input video mode is interlaced/progressive. + * This function checks if the input video mode is interlaced/progressive based + * on its ID from the video timings table. * - * @param VmId specifies the resolution id. + * @param VmId specifies the resolution ID from the video timings table. * * @return Video format. * - XVIDC_VF_PROGRESSIVE @@ -136,6 +137,30 @@ XVidC_VideoFormat XVidC_GetVideoFormat(XVidC_VideoMode VmId) return (XVIDC_VF_INTERLACED); } +/******************************************************************************/ +/** + * This function checks if the input video mode is interlaced based on its ID + * from the video timings table. + * + * @param VmId specifies the resolution ID from the video timings table. + * + * @return + * - 1 if the video timing with the supplied table ID is + * interlaced. + * - 0 if the video timing is progressive. + * + * @note None. + * +*******************************************************************************/ +u8 XVidC_IsInterlaced(XVidC_VideoMode VmId) +{ + if (XVidC_GetVideoFormat(VmId) == XVIDC_VF_INTERLACED) { + return 1; + } + + return 0; +} + /******************************************************************************/ /** * This function returns the Video Mode ID that matches the detected input diff --git a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.h b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.h index a0e0eb77..e998f422 100644 --- a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.h +++ b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.h @@ -370,6 +370,7 @@ typedef void (*XVidC_DelayHandler)(void *TimerPtr, u32 Delay); u32 XVidC_GetPixelClockHzByHVFr(u32 HTotal, u32 VTotal, u8 FrameRate); u32 XVidC_GetPixelClockHzByVmId(XVidC_VideoMode VmId); XVidC_VideoFormat XVidC_GetVideoFormat(XVidC_VideoMode VmId); +u8 XVidC_IsInterlaced(XVidC_VideoMode VmId); XVidC_VideoMode XVidC_GetVideoModeId(u32 Width, u32 Height, u32 FrameRate, u8 IsInterlaced); const XVidC_VideoTimingMode* XVidC_GetVideoModeData(XVidC_VideoMode VmId);