Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/AnnexBread.cpp


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

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

    r1179 r1313  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4242#include <vector>
    4343#include "AnnexBread.h"
     44#if RExt__DECODER_DEBUG_BIT_STATISTICS
     45#include "TLibCommon/TComCodingStatistics.h"
     46#endif
    4447
    4548using namespace std;
     
    5659 * be correct at this point.
    5760 */
    58 static void
     61static Void
    5962_byteStreamNALUnit(
    6063  InputByteStream& bs,
     
    7073   * 0x00000001.
    7174   */
     75#if RExt__DECODER_DEBUG_BIT_STATISTICS
     76  TComCodingStatistics::SStat &statBits=TComCodingStatistics::GetStatisticEP(STATS__NAL_UNIT_PACKING);
     77#endif
    7278  while ((bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) != 0x000001)
    7379  &&     (bs.eofBeforeNBytes(32/8) || bs.peekBytes(32/8) != 0x00000001))
    7480  {
    7581    uint8_t leading_zero_8bits = bs.readByte();
     82#if RExt__DECODER_DEBUG_BIT_STATISTICS
     83    statBits.bits+=8; statBits.count++;
     84#endif
    7685    assert(leading_zero_8bits == 0);
    7786    stats.m_numLeadingZero8BitsBytes++;
     
    8998  {
    9099    uint8_t zero_byte = bs.readByte();
     100#if RExt__DECODER_DEBUG_BIT_STATISTICS
     101    statBits.bits+=8; statBits.count++;
     102#endif
    91103    assert(zero_byte == 0);
    92104    stats.m_numZeroByteBytes++;
     
    100112  /* NB, (1) guarantees that the next three bytes are 0x00 00 01 */
    101113  uint32_t start_code_prefix_one_3bytes = bs.readBytes(24/8);
     114#if RExt__DECODER_DEBUG_BIT_STATISTICS
     115  statBits.bits+=24; statBits.count+=3;
     116#endif
    102117  assert(start_code_prefix_one_3bytes == 0x000001);
    103118  stats.m_numStartCodePrefixBytes += 3;
     
    117132   */
    118133  /* NB, (unsigned)x > 2 implies n!=0 && n!=1 */
    119   while (bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) > 2)
     134#if RExt__DECODER_DEBUG_BIT_STATISTICS
     135  TComCodingStatistics::SStat &bodyStats=TComCodingStatistics::GetStatisticEP(STATS__NAL_UNIT_TOTAL_BODY);
     136#endif
     137  while (bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) > 2)
    120138  {
     139#if RExt__DECODER_DEBUG_BIT_STATISTICS
     140    uint8_t thebyte=bs.readByte();bodyStats.bits+=8;bodyStats.count++;
     141    nalUnit.push_back(thebyte);
     142#else
    121143    nalUnit.push_back(bs.readByte());
     144#endif
    122145  }
    123  
     146
    124147  /* 5. When the current position in the byte stream is:
    125148   *  - not at the end of the byte stream (as determined by unspecified means)
     
    141164  {
    142165    uint8_t trailing_zero_8bits = bs.readByte();
     166#if RExt__DECODER_DEBUG_BIT_STATISTICS
     167    statBits.bits+=8; statBits.count++;
     168#endif
    143169    assert(trailing_zero_8bits == 0);
    144170    stats.m_numTrailingZero8BitsBytes++;
Note: See TracChangeset for help on using the changeset viewer.