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

📄 itu-r-656.h

📁 BlackFin处理器视频演示代码
💻 H
字号:
/**
 * @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 << 24;
}


/**
 * 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 << 24;
}


#endif

⌨️ 快捷键说明

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