BlackFin处理器视频演示代码

源代码在线查看: itu-r-656.h

软件大小: 5796 K
上传用户: luoxuetian
关键词: BlackFin 处理器 代码 视频
下载地址: 免注册下载 普通下载 VIP

相关代码

				/**
				 * @file itu-r-656.h
				 * @author Zlatan Stanojevic
				 */
				
				
				#ifndef ITU_R_656_H
				#define ITU_R_656_H
				
				
				/**
				 * Flags passed to the @ref SAV and @ref EAV functions
				 */
				typedef enum
				{
					/// Flag for field 1
					FIELD_1			= 0x00, 
					/// Flag for field 2
					FIELD_2			= 0x40,
					FIELD			= FIELD_2,
					///Vertical Blank flag
					VERTICAL_BLANK	= 0x20,
					HORIZ_BLANK		= 0x10
					
				} ITUFlags;
				
				
				static const unsigned char protection_bit_table[] = 
				{
					0x00,
					0x0d,
					0x0b,
					0x06,
					0x07,
					0x0a,
					0x0c,
					0x01
				};
				
				
				/**
				 * Generates four-byte SAV ( = Start of Active Video, H = 0 )
				 * synchronization sequence with flags and protection bits.
				 * 
				 * @param flags A combination of @ref FIELD_1, @ref FIELD_2 and @ref VERTICAL_BLANK
				 *              or'ed together.
				 */
				inline unsigned long SAV( unsigned long flags )
				{
					flags |= protection_bit_table[ flags >> 4 ];
					flags |= 0x80;
						
					return 0x000000ff | flags 				}
				
				
				/**
				 * Generates four-byte EAV ( = End of Active Video, H = 1 )
				 * synchronization sequence with flags and protection bits.
				 * 
				 * @param flags A combination of @ref FIELD_1, @ref FIELD_2 and @ref VERTICAL_BLANK
				 *              or'ed together.
				 */
				inline unsigned long EAV( unsigned long flags )
				{
					flags |= HORIZ_BLANK;
					flags |= protection_bit_table[ flags >> 4 ];
					flags |= 0x80;
					
					return 0x000000ff | flags 				}
				
				
				#endif
							

相关资源