Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/AnnexBread.h


Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (11 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/AnnexBread.h

    r56 r608  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    3232 */
    3333
     34/**
     35 \file     AnnexBread.h
     36 \brief    reading functions for Annex B byte streams
     37 */
     38
    3439#pragma once
    3540
     
    3742#include <istream>
    3843#include <vector>
     44
     45#include "../TLibCommon/TypeDef.h"
    3946
    4047//! \ingroup TLibDecoder
     
    7582   * n bytes.
    7683   */
    77   bool eofBeforeNBytes(unsigned n)
     84  Bool eofBeforeNBytes(UInt n)
    7885  {
    7986    assert(n <= 4);
     
    8491    try
    8592    {
    86       for (unsigned i = 0; i < n; i++)
     93      for (UInt i = 0; i < n; i++)
    8794      {
    8895        m_FutureBytes = (m_FutureBytes << 8) | m_Input.get();
     
    109116   *
    110117   */
    111   uint32_t peekBytes(unsigned n)
     118  uint32_t peekBytes(UInt n)
    112119  {
    113120    eofBeforeNBytes(n);
     
    139146   * the return value.
    140147   */
    141   uint32_t readBytes(unsigned n)
     148  uint32_t readBytes(UInt n)
    142149  {
    143150    uint32_t val = 0;
    144     for (unsigned i = 0; i < n; i++)
     151    for (UInt i = 0; i < n; i++)
    145152      val = (val << 8) | readByte();
    146153    return val;
     
    148155
    149156private:
    150   unsigned m_NumFutureBytes; /* number of valid bytes in m_FutureBytes */
     157  UInt m_NumFutureBytes; /* number of valid bytes in m_FutureBytes */
    151158  uint32_t m_FutureBytes; /* bytes that have been peeked */
    152159  std::istream& m_Input; /* Input stream to read from */
     
    158165struct AnnexBStats
    159166{
    160   unsigned m_numLeadingZero8BitsBytes;
    161   unsigned m_numZeroByteBytes;
    162   unsigned m_numStartCodePrefixBytes;
    163   unsigned m_numBytesInNALUnit;
    164   unsigned m_numTrailingZero8BitsBytes;
     167  UInt m_numLeadingZero8BitsBytes;
     168  UInt m_numZeroByteBytes;
     169  UInt m_numStartCodePrefixBytes;
     170  UInt m_numBytesInNALUnit;
     171  UInt m_numTrailingZero8BitsBytes;
    165172
    166173  AnnexBStats& operator+=(const AnnexBStats& rhs)
     
    175182};
    176183
    177 bool byteStreamNALUnit(InputByteStream& bs, std::vector<uint8_t>& nalUnit, AnnexBStats& stats);
     184Bool byteStreamNALUnit(InputByteStream& bs, std::vector<uint8_t>& nalUnit, AnnexBStats& stats);
    178185
    179186//! \}
Note: See TracChangeset for help on using the changeset viewer.