資源簡介
C++視頻聊天,MFC程序,有運行文件和說明,代碼文件,齊全。

代碼片段和文件信息
//Download?by?http://www.NewXing.com
////////////////////////////////////////////////////////////////////////////
//
//
//????Project?????:?VideoNet?version?1.1.
//????Description?:?Peer?to?Peer?Video?Conferencing?over?the?LAN.
// ??Author??????: Nagareshwar?Y?Talekar?(?nsry2002@yahoo.co.in)
//????Date????????:?15-6-2004.
//
//
//????File?description?:?
//????Name????:?convert.cpp
//????Details?:?Conversion?routine?from?RGB24?to?YUV420?&?YUV420?to?RGB24.
//
/////////////////////////////////////////////////////////////////////////////
#include?“convert.h“
//?Conversion?from?RGB?to?YUV420
int?RGB2YUV_YR[256]?RGB2YUV_YG[256]?RGB2YUV_YB[256];
int?RGB2YUV_UR[256]?RGB2YUV_UG[256]?RGB2YUV_UBVR[256];
int?RGB2YUV_VG[256]?RGB2YUV_VB[256];
//?Conversion?from?YUV420?to?RGB24
static?long?int?crv_tab[256];
static?long?int?cbu_tab[256];
static?long?int?cgu_tab[256];
static?long?int?cgv_tab[256];
static?long?int?tab_76309[256];
static?unsigned?char?clp[1024]; //for?clip?in?CCIR601
//
//?Table?used?for?RGB?to?YUV420?conversion
//
void?InitLookupTable()
{
int?i;
for?(i?=?0;?i?256;?i++)?RGB2YUV_YR[i]?=?(float)65.481?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_YG[i]?=?(float)128.553?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_YB[i]?=?(float)24.966?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_UR[i]?=?(float)37.797?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_UG[i]?=?(float)74.203?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_VG[i]?=?(float)93.786?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_VB[i]?=?(float)18.214?*?(i<<8);
for?(i?=?0;?i?256;?i++)?RGB2YUV_UBVR[i]?=?(float)112?*?(i<<8);
}
//
//??Convert?from??RGB24?to?YUV420
//
int?ConvertRGB2YUV(int?wint?hunsigned?char?*bmpunsigned?int?*yuv)
{
unsigned?int?*u*v*y*uu*vv;
unsigned?int?*pu1*pu2*pu3*pu4;
unsigned?int?*pv1*pv2*pv3*pv4;
unsigned?char?*r*g*b;
int?ij;
uu=new?unsigned?int[w*h];
vv=new?unsigned?int[w*h];
if(uu==NULL?||?vv==NULL)
return?0;
y=yuv;
u=uu;
v=vv;
//?Get?rgb?pointers?from?bmp?image?data....
r=bmp;
g=bmp+1;
b=bmp+2;
//Get?YUV?values?for?rgb?values...
for(i=0;i {
for(j=0;j {
*y++=(?RGB2YUV_YR[*r]??+RGB2YUV_YG[*g]+RGB2YUV_YB[*b]+1048576)>>16;
*u++=(-RGB2YUV_UR[*r]??-RGB2YUV_UG[*g]+RGB2YUV_UBVR[*b]+8388608)>>16;
*v++=(?RGB2YUV_UBVR[*r]-RGB2YUV_VG[*g]-RGB2YUV_VB[*b]+8388608)>>16;
r+=3;
g+=3;
b+=3;
}
}
//?Now?sample?the?U?&?V?to?obtain?YUV?4:2:0?format
//?Sampling?mechanism...
/* ??@??->??Y
??#??->??U?or?V
??
??@???@???@???@
#???????#
??@???@???@???@
??@???@???@???@
#???????#
??@???@???@???@
*/
//?Get?the?right?pointers...
u=yuv+w*h;
v=u+(w*h)/4;
//?For?U
pu1=uu;
pu2=pu1+1;
pu3=pu1+w;
pu4=pu3+1;
//?For?V
pv1=vv;
pv2=pv1+1;
pv3=pv1+w;
pv4=pv3+1;
//?Do?sampling....
for(i=0;i {
for(j=0;j {
*u++=(*pu1+*pu2+*pu3+*pu4)>>2;
*v++
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-30?10:57??TestVideo\
?????目錄???????????0??2018-03-30?10:58??TestVideo\exe程序\
?????文件??????114688??2009-06-23?09:06??TestVideo\exe程序\TestVideo.exe
?????文件???????????0??2018-03-31?19:47??TestVideo\exe程序\decoder.log
?????文件?????1107200??2009-01-15?18:04??TestVideo\exe程序\mfc80.dll
?????文件??????632064??2009-01-15?18:04??TestVideo\exe程序\msvcr80.dll
?????文件??????????96??2009-06-23?09:13??TestVideo\exe程序\說明.txt
?????目錄???????????0??2009-06-23?09:14??TestVideo\源代碼\
?????目錄???????????0??2009-06-23?09:14??TestVideo\源代碼\Decoder\
?????文件????????7734??2012-11-25?11:10??TestVideo\源代碼\Decoder\DGlobal.cpp
?????文件????????3738??2012-11-25?11:10??TestVideo\源代碼\Decoder\DGlobal.h
?????文件????????5312??2009-06-17?11:12??TestVideo\源代碼\Decoder\Decoder.vcproj
?????文件????????1381??2009-06-23?09:13??TestVideo\源代碼\Decoder\Decoder.vcproj.LIUBO.劉波.user
?????文件????????6056??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetBits.cpp
?????文件????????1665??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetBits.h
?????文件???????10594??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetBlk.cpp
?????文件????????1767??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetBlk.h
?????文件????????5489??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetHdr.cpp
?????文件????????1566??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetHdr.h
?????文件???????32565??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetPic.cpp
?????文件????????2296??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetPic.h
?????文件???????11223??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetVlc.cpp
?????文件????????1741??2012-11-25?11:10??TestVideo\源代碼\Decoder\GetVlc.h
?????文件????????6845??2012-11-25?11:10??TestVideo\源代碼\Decoder\Idct.cpp
?????文件????????1963??2012-11-25?11:10??TestVideo\源代碼\Decoder\Idct.h
?????文件????????4458??2012-11-25?11:10??TestVideo\源代碼\Decoder\Idctref.cpp
?????文件????????1475??2012-11-25?11:10??TestVideo\源代碼\Decoder\Idctref.h
?????文件????????4354??2012-11-25?11:10??TestVideo\源代碼\Decoder\Indices.cpp
?????文件????????1821??2012-11-25?11:10??TestVideo\源代碼\Decoder\Indices.h
?????文件???????22253??2012-11-25?11:10??TestVideo\源代碼\Decoder\Recon.cpp
?????文件????????2798??2012-11-25?11:10??TestVideo\源代碼\Decoder\Recon.h
............此處省略70個文件信息
- 上一篇:Pt100溫度報警 電路圖程序
- 下一篇:C++基礎與提高-王桂林(第二版)
評論
共有 條評論