Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
rlib.cpp
Package: meeting_video_system.rar [view]
Upload User: panstart
Upload Date: 2022-04-12
Package Size: 199k
Code Size: 3k
Category:
VOIP program
Development Platform:
C++ Builder
- ////////////////////////////////////////////////////////////////////////////
- //
- //
- // 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.
- //
- // I have converted origional fast h.263 encoder library from C to C++
- // so that it can be integrated into any windows application easily.
- // I have removed some of unnecessary codes/files from the
- // fast h263 library.Also moved definitions and declarations
- // in their proper .h and .cpp files.
- //
- // File description :
- // Name : rlib.cpp
- // Details : Reading and writing to file...
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "rlib.h"
- //#include "owntypes.h"
- int ReadQCIF(FILE *f, struct qcif *qc)
- {
- struct qcif8bit source;
- int i;
- int file_err;
- unsigned int *ud;
- unsigned char *us;
- file_err = fread(&source, sizeof(source), 1, f);
- if(file_err != 1)
- return FALSE;
- us = &source.Y[0][0];
- ud = &qc->Y[0][0];
- for(i = 0; i < QCIF_YWIDTH*QCIF_YHEIGHT; i++)
- *ud++ = (unsigned int) *us++;
- us = &source.U[0][0];
- ud = &qc->U[0][0];
- for(; i < QCIF_YWIDTH*QCIF_YHEIGHT + QCIF_UWIDTH*QCIF_UHEIGHT +
- QCIF_VWIDTH*QCIF_VHEIGHT; i++)
- *ud++ = (signed int) *us++;
- return TRUE;
- }
- int ReadCIF(FILE *f, struct cif *qc)
- {
- struct cif8bit source;
- int i;
- int file_err;
- unsigned int *ud;
- unsigned char *us;
- file_err = fread(&source, sizeof(source), 1, f);
- if(file_err != 1)
- return FALSE;
- us = &source.Y[0][0];
- ud = &qc->Y[0][0];
- for(i = 0; i < CIF_YWIDTH*CIF_YHEIGHT; i++)
- *ud++ = (unsigned int) *us++;
- us = &source.U[0][0];
- ud = &qc->U[0][0];
- for(; i < CIF_YWIDTH*CIF_YHEIGHT + CIF_UWIDTH*CIF_UHEIGHT +
- CIF_VWIDTH*CIF_VHEIGHT; i++)
- *ud++ = (signed int) *us++;
- return TRUE;
- }
- int WriteQCIF(FILE *f, struct qcif *qc)
- {
- struct qcif8bit dest;
- int i;
- int file_err;
- unsigned char *ud;
- unsigned int *us;
- us = &qc->Y[0][0];
- ud = &dest.Y[0][0];
- for(i = 0; i < QCIF_YWIDTH*QCIF_YHEIGHT; i++)
- *ud++ = (unsigned char) *us++;
- us = &qc->U[0][0];
- ud = &dest.U[0][0];
- for(; i < QCIF_YWIDTH*QCIF_YHEIGHT + QCIF_UWIDTH*QCIF_UHEIGHT +
- QCIF_VWIDTH*QCIF_VHEIGHT; i++)
- *ud++ = (unsigned char) *us++;
- file_err = fwrite(&dest, sizeof(dest), 1, f);
- return (file_err == 1);
- }
- int WriteCIF(FILE *f, struct cif *qc)
- {
- struct cif8bit dest;
- int i;
- int file_err;
- unsigned char *ud;
- unsigned int *us;
- us = &qc->Y[0][0];
- ud = &dest.Y[0][0];
- for(i = 0; i < CIF_YWIDTH*CIF_YHEIGHT; i++)
- *ud++ = (unsigned char) *us++;
- us = &qc->U[0][0];
- ud = &dest.U[0][0];
- for(; i < CIF_YWIDTH*CIF_YHEIGHT + CIF_UWIDTH*CIF_UHEIGHT +
- CIF_VWIDTH*CIF_VHEIGHT; i++)
- *ud++ = (unsigned char) *us++;
- file_err = fwrite(&dest, sizeof(dest), 1, f);
- return (file_err == 1);
- }