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
nalu.c
Package: chapter15.rar [view]
Upload User: hjq518
Upload Date: 2021-12-09
Package Size: 5084k
Code Size: 2k
Category:
Audio program
Development Platform:
Visual C++
- /*!
- ************************************************************************
- * file nalu.c
- *
- * brief
- * Decoder NALU support functions
- *
- * author
- * Main contributors (see contributors.h for copyright, address and affiliation details)
- * - Stephan Wenger <stewe@cs.tu-berlin.de>
- ************************************************************************
- */
- #include "global.h"
- #include "nalu.h"
- #include "annexb.h"
- #include "rtp.h"
- /*!
- *************************************************************************************
- * brief
- * Converts a NALU to an RBSP
- *
- * param
- * nalu: nalu structure to be filled
- *
- * return
- * length of the RBSP in bytes
- *************************************************************************************
- */
- int NALUtoRBSP (NALU_t *nalu)
- {
- assert (nalu != NULL);
- nalu->len = EBSPtoRBSP (nalu->buf, nalu->len, 1) ;
- return nalu->len ;
- }
- /*!
- ************************************************************************
- * brief
- * Read the next NAL unit (with error handling)
- ************************************************************************
- */
- int read_next_nalu(FILE *bitstream, NALU_t *nalu)
- {
- int ret;
- if (params->FileFormat == PAR_OF_ANNEXB)
- ret = GetAnnexbNALU (bitstream, nalu);
- else
- ret = GetRTPNALU (bitstream, nalu);
- if (ret < 0)
- {
- snprintf (errortext, ET_SIZE, "Error while getting the NALU in file format %s, exitn", params->FileFormat==PAR_OF_ANNEXB?"Annex B":"RTP");
- error (errortext, 601);
- }
- if (ret == 0)
- {
- FreeNALU(nalu);
- return 0;
- }
- //In some cases, zero_byte shall be present. If current NALU is a VCL NALU, we can't tell
- //whether it is the first VCL NALU at this point, so only non-VCL NAL unit is checked here.
- CheckZeroByteNonVCL(nalu);
- ret = NALUtoRBSP(nalu);
- if (ret < 0)
- error ("Invalid startcode emulation prevention found.", 602);
- // Got a NALU
- if (nalu->forbidden_bit)
- {
- error ("Found NALU with forbidden_bit set, bit error?", 603);
- }
- return nalu->len;
- }