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

📄 h265vviewsystem.cpp

📁 ZPAV (H265) PC(X86) demo ZPAV (H265) 是 音视频 压缩解压 协议
💻 CPP
字号:

/*
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//   Copyright (C) 2006-2008  Beijing,  pengzhen (pengzhenxp@yahoo.com.cn)   //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
*/

void CH265VView::Get_Dvp_Functions( int function_id )
{

	switch( function_id )
	{

	/* Image Compression */

	case DVP_FID_H265P_V8_Compression :  
		m_Dvp_Functions = (Dvp_Functions)dvp_encode_frame ; 
		break ;

	/* Image Decompression */

	case DVP_FID_H265P_V8_Decompression : 
		m_Dvp_Functions = (Dvp_Functions)dvp_decode_frame ; 
		break ;

	/* Image Process ( wavelets <2D, 3D, 4D> ) */

	default : 
	case DVP_FID_Wavelets_Analysis_2D : 
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_analysis ; 
		break ;
/*
	case DVP_FID_Wavelets_Analysis_3D :
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_analysis ; 
		break ;
	case DVP_FID_Wavelets_Analysis_4D : 
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_analysis ; 
		break ;
*/

	case DVP_FID_Wavelets_Synthesis_2D : 
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_synthesis ; 
		break ;
/*
	case DVP_FID_Wavelets_Synthesis_3D : 
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_synthesis ; 
		break ;
	case DVP_FID_Wavelets_Synthesis_4D : 
		m_Dvp_Functions = (Dvp_Functions)dvp_wavelets_synthesis ; 
		break ;
*/

	/* Image Process */

	case DVP_FID_Denoise : 
		m_Dvp_Functions = (Dvp_Functions)dvp_denoise ; break ;
	
	}

}

void CH265VView::Get_Dap_Functions( int function_id )
{

	switch( function_id )
	{

	/* Compression */

	default : 
	case DAP_FID_H265P_A8_Compression :  
		m_Dap_Functions = (Dap_Functions)dap_encode_frame ; 
		break ;

	/* Decompression */

	case DAP_FID_H265P_A8_Decompression :  
		m_Dap_Functions = (Dap_Functions)dap_decode_frame ; 
		break ;

	/* Denoise */

	case DAP_FID_Denoise :  
		m_Dap_Functions = (Dap_Functions)dap_denoise  ; 
		break ;

	}

}

void CH265VView::dvp_init( void* dvp, int width, int height )
{

	//if( m_bRecieveWnd ) return ;

	dvp_ctx * lp_dvp     = (dvp_ctx*)(dvp) ;
	dvp_ctx * lp_dvp_enc = (dvp_ctx*)(dvp) ;
	dvp_ctx * lp_dvp_dec = (dvp_ctx*)(dvp) ;

	// dvp system 

	//lp_dvp->m_handle = 0 ; /* handle */ 

	lp_dvp->width  = width ;  /* 352 */ /* picture width. (must be a multiple of 16) */
	lp_dvp->height = height ; /* 288 */ /* picture height. (must be a multiple of 16) */

	//dvp_open( lp_dvp ) ; /* dvp open */

	// dvp encoder 

	//lp_dvp_enc->m_handle = lp_dvp->m_handle; /* handle */ 

	lp_dvp_enc->wavelets = 0  ; /* wavelets */ /* 0 : w1, 1 : w2 */
	//lp_dvp_enc->wavelets = 1  ; /* wavelets */ /* 0 : w1, 1 : w2 */

	lp_dvp_enc->width  = lp_dvp->width ;  /* 352 */ /* picture width. (must be a multiple of 16) */
	lp_dvp_enc->height = lp_dvp->height ; /* 288 */ /* picture height. (must be a multiple of 16) */

	lp_dvp_enc->fps  = 25 ; /* frames/second */ /* <25,30> */ 
	lp_dvp_enc->bps  = 300*1000 ; /* bits/second */ /* <300*1000> */ 
	
	lp_dvp_enc->gop      = 512 ;  /* group of picture */   /* none 'P',   if gop = 0 */ 
	lp_dvp_enc->insert_i = 1 ;    /* insert picture 'I' */ /* insert 'I', if insert_i = 1 */
	lp_dvp_enc->have_b   = 1 ;    /* have picture 'B' */   /* none 'B',   if have_b = 0 */
	//lp_dvp_enc->ratio    = 1 ;    /* ratio of background to foreground */ /* none background, if ratio = 0 */

	lp_dvp_enc->abr  = 1 ; /* adaptive bit rate */ /* 0 : CBR, 1 : ABR */ 
	lp_dvp_enc->me_c = 0 ; /* chroma join motion_estimate (ME) */ /* 0 : no, 1 : yes */
	lp_dvp_enc->ms_t = 0 ; /* motion_search type */ /* 0 : diamond, 1 : advance diamond, 2 : small diamond, 3 : square,*/

	lp_dvp_enc->prp = 0xff ; /* previous process */ /* <0,1,2,3,4> */
	lp_dvp_enc->pop = 0xff ; /* post process */ /* <0,1,2,3,4> */

	lp_dvp_enc->bands   = 2 ; /* wavelets bands */ /* <1,2,3,4> */ 

	dvp_encode_open( lp_dvp_enc ) ; /* dvp encode open */

	// dvp decoder
	
	//lp_dvp_dec->m_handle = lp_dvp->m_handle; /* handle */ 

	//lp_dvp_dec->width  = lp_dvp->width ;  /* 352 */ /* picture width. (must be a multiple of 16) */
	//lp_dvp_dec->height = lp_dvp->height ; /* 288 */ /* picture height. (must be a multiple of 16) */

	//dvp_decode_open( lp_dvp_dec ) ; /* dvp decode open */
}


void CH265VView::dvp_exit( void* dvp )
{

	//if( m_bRecieveWnd ) return ;

	dvp_ctx * lp_dvp = (dvp_ctx*)( dvp ) ;

	dvp_close( lp_dvp ) ; /* dvp encode close */

}

void CH265VView::dap_init( void* dap )
{

	dap_ctx *lp_dap_enc = (dap_ctx*)(dap) ;
	//dap_ctx *lp_dap_dec = (dap_ctx*)(dap) ; 

	lp_dap_enc->m_handle = 0 ; /* handle */

	lp_dap_enc->wavelets = 0  ; /* wavelets */ /* 0 : w1, 1 : w2 */
	//lp_dap_enc->wavelets = 1  ; /* wavelets */ /* 0 : w1, 1 : w2 */

	lp_dap_enc->sps = 8*1000 ; /* samples/second */ /* 8k ~~~ 48k */
	lp_dap_enc->bps = 8*1000 ; /* bits/second */ /* 8 ~~~ 256 kbit/s */
	lp_dap_enc->ch  = 1 ;      /* channels */ /* 1, 2 */

	lp_dap_enc->prp = 0xff ; /* previous process */ /* <0,1,2,3,4> */
	lp_dap_enc->pop = 0xff ; /* post process */ /* <0,1,2,3,4> */

	dap_encode_open( lp_dap_enc ) ; /* dap encode open */

}

void CH265VView::dap_exit( void* dap )
{

	dap_ctx * lp_dap = (dap_ctx*)( dap ) ;

	dap_encode_close( lp_dap ) ; /* dap encode close */

}



⌨️ 快捷键说明

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