source: 3DVCSoftware/branches/0.3-nokia/source/Lib/TLibEncoder/TEncFormattedStringParser.h @ 122

Last change on this file since 122 was 5, checked in by hhi, 13 years ago

Clean version with cfg-files

  • Property svn:eol-style set to native
File size: 6.3 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2011, ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#if !defined(AFX_TEncFormattedStringParser_H__268768B8_4D1D_484A_904E_586985833BAC__INCLUDED_)
35#define AFX_TEncFormattedStringParser_H__268768B8_4D1D_484A_904E_586985833BAC__INCLUDED_
36
37#include "../TLibCommon/CommonDef.h"
38#include <vector>
39
40class TEncFormattedStringParser
41{
42public:
43  static  ErrVal  separatString               ( const std::string&  rcString,
44                                                      std::string& rcFDString,
45                                                      std::string& rcMmcoString,
46                                                      std::string& rcRplrStringL0,
47                                                      std::string& rcRplrStringL1 );
48  static bool   isFrameSequencePart         ( const std::string&  rcString                  );
49
50  static ErrVal extractRepetitions          ( const std::string&  rcString,
51                                              std::string&        rcNoRepString,
52                                              UInt&               ruiNumberOfRepetitions    );
53
54  static ErrVal getNumberOfFrames           ( const std::string&  rcString,
55                                              UInt&               ruiNumberOfFrames         );
56
57  static ErrVal extractNextFrameDescription ( const std::string&  rcString,
58                                              std::string&        rcFDString,
59                                              size_t&        ruiStartPos );
60
61  static ErrVal getNumberOfParts            ( const std::string&  rcString,
62                                              UInt&               ruiNumberOfParts          );
63
64  static ErrVal extractPart                 ( const std::string&  rcString,
65                                              std::string&        rcPartString,
66                                              size_t&        ruiStartPos );
67
68  static ErrVal extractFrameType( const std::string &rcString,
69                                  SliceType& reSliceType,
70                                  bool &rbStoreForRef,
71                                  bool &rbIsIDR,
72                                  std::string::size_type &ruiStartPos );
73  static ErrVal extractFrameIncrement( const std::string &rcString,
74                                       UInt &ruiIncrement,
75                                       std::string::size_type &ruiStartPos );
76
77  static ErrVal extractFrameLayer( const std::string &rcString,
78                                   UInt &ruiLayer,
79                                   std::string::size_type &ruiStartPos );
80
81  static ErrVal extractAllowedRelativeRefPocs( const std::string &rcString,
82                                               std::vector<int> &raiAllowedRelativeRefPocs,
83                                               std::vector<int> &raiAllowedReferenceViewIdx,
84                                               std::string::size_type &ruiStartPos );
85  static ErrVal extractAllowedRelativeRefPocs( const std::string &rcString,
86                                                 std::vector<int> &raiAllowedRelativeRefPocsL0,
87                                                 std::vector<int> &raiAllowedRelativeRefPocsL1,
88                                                 std::vector<int> &raiAllowedReferenceViewIdxL0,
89                                                 std::vector<int> &raiAllowedReferenceViewIdxL1,
90                                                 std::string::size_type &ruiStartPos );
91
92
93  static ErrVal extractHighestLayerOfGOPString( const std::string &rcString, UInt &ruiLayer );
94
95private:
96  static ErrVal xExtractUInt( const std::string &rcString,
97                              UInt &ruiVal,
98                              std::string::size_type &ruiStartPos );
99
100  static ErrVal xExtractInt( const std::string &rcString,
101                             int &riVal,
102                             std::string::size_type &ruiStartPos );
103
104  static ErrVal xEatChar( const std::string &rcString,
105                          char cChar,
106                          std::string::size_type &ruiStartPos );
107
108  static ErrVal xExtractRelRefPocAndRefViewIdx( const std::string &rcString,
109                                                std::vector<int> &raiAllowedRelativeRefPocs,
110                                                std::vector<int> &raiAllowedReferenceViewIdx,
111                                                std::string::size_type &ruiStartPos );
112
113  static const std::string sm_cSetOfTypes;
114  static const std::string sm_cSetOfDigits;
115  static const std::string sm_cSetOfPartStart;
116};
117
118
119
120
121#endif // !defined(AFX_TEncFormattedStringParser_H__268768B8_4D1D_484A_904E_586985833BAC__INCLUDED_)
Note: See TracBrowser for help on using the repository browser.