ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
GetId3\Module\AudioVideo\AVCSequenceParameterSetReader Class Reference

GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //. More...

+ Collaboration diagram for GetId3\Module\AudioVideo\AVCSequenceParameterSetReader:

Public Member Functions

 __construct ($sps)
 
 readData ()
 
 skipBits ($bits)
 
 getBit ()
 
 getBits ($bits)
 
 expGolombUe ()
 
 expGolombSe ()
 
 getWidth ()
 
 getHeight ()
 

Data Fields

 $sps
 
 $start = 0
 
 $currentBytes = 0
 
 $currentBits = 0
 
 $width
 
 $height
 
const H264_AVC_SEQUENCE_HEADER = 0
 
const H264_PROFILE_BASELINE = 66
 
const H264_PROFILE_MAIN = 77
 
const H264_PROFILE_EXTENDED = 88
 
const H264_PROFILE_HIGH = 100
 
const H264_PROFILE_HIGH10 = 110
 
const H264_PROFILE_HIGH422 = 122
 
const H264_PROFILE_HIGH444 = 144
 
const H264_PROFILE_HIGH444_PREDICTIVE = 244
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::__construct (   $sps)

Member Function Documentation

◆ expGolombSe()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::expGolombSe ( )
Returns
type

Definition at line 180 of file AVCSequenceParameterSetReader.php.

References $result, and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\expGolombUe().

Referenced by GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\readData().

181  {
182  $result = $this->expGolombUe();
183  if (($result & 0x01) == 0) {
184  return -($result >> 1);
185  } else {
186  return ($result + 1) >> 1;
187  }
188  }
$result
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expGolombUe()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::expGolombUe ( )
Returns
int

Definition at line 159 of file AVCSequenceParameterSetReader.php.

References GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBit(), and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBits().

Referenced by GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\expGolombSe(), and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\readData().

160  {
161  $significantBits = 0;
162  $bit = $this->getBit();
163  while ($bit == 0) {
164  $significantBits++;
165  $bit = $this->getBit();
166 
167  if ($significantBits > 31) {
168  // something is broken, this is an emergency escape to prevent infinite loops
169  return 0;
170  }
171  }
172 
173  return (1 << $significantBits) + $this->getBits($significantBits) - 1;
174  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBit()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::getBit ( )

◆ getBits()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::getBits (   $bits)
Parameters
type$bits
Returns
type

Definition at line 145 of file AVCSequenceParameterSetReader.php.

References $result, and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBit().

Referenced by GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\expGolombUe(), and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\readData().

146  {
147  $result = 0;
148  for ($i = 0; $i < $bits; $i++) {
149  $result = ($result << 1) + $this->getBit();
150  }
151 
152  return $result;
153  }
$result
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeight()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::getHeight ( )

◆ getWidth()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::getWidth ( )

◆ readData()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::readData ( )

Definition at line 61 of file AVCSequenceParameterSetReader.php.

References $size, array, GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\expGolombSe(), GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\expGolombUe(), GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBit(), GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBits(), and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\skipBits().

62  {
63  $this->skipBits(8);
64  $this->skipBits(8);
65  $profile = $this->getBits(8); // read profile
66  $this->skipBits(16);
67  $this->expGolombUe(); // read sps id
68  if (in_array($profile,
69  array(self::H264_PROFILE_HIGH, self::H264_PROFILE_HIGH10, self::H264_PROFILE_HIGH422, self::H264_PROFILE_HIGH444, self::H264_PROFILE_HIGH444_PREDICTIVE))) {
70  if ($this->expGolombUe() == 3) {
71  $this->skipBits(1);
72  }
73  $this->expGolombUe();
74  $this->expGolombUe();
75  $this->skipBits(1);
76  if ($this->getBit()) {
77  for ($i = 0; $i < 8; $i++) {
78  if ($this->getBit()) {
79  $size = $i < 6 ? 16 : 64;
80  $lastScale = 8;
81  $nextScale = 8;
82  for ($j = 0; $j < $size; $j++) {
83  if ($nextScale != 0) {
84  $deltaScale = $this->expGolombUe();
85  $nextScale = ($lastScale + $deltaScale + 256) % 256;
86  }
87  if ($nextScale != 0) {
88  $lastScale = $nextScale;
89  }
90  }
91  }
92  }
93  }
94  }
95  $this->expGolombUe();
96  $pocType = $this->expGolombUe();
97  if ($pocType == 0) {
98  $this->expGolombUe();
99  } elseif ($pocType == 1) {
100  $this->skipBits(1);
101  $this->expGolombSe();
102  $this->expGolombSe();
103  $pocCycleLength = $this->expGolombUe();
104  for ($i = 0; $i < $pocCycleLength; $i++) {
105  $this->expGolombSe();
106  }
107  }
108  $this->expGolombUe();
109  $this->skipBits(1);
110  $this->width = ($this->expGolombUe() + 1) * 16;
111  $heightMap = $this->expGolombUe() + 1;
112  $this->height = (2 - $this->getBit()) * $heightMap * 16;
113  }
$size
Definition: RandomTest.php:79
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ skipBits()

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::skipBits (   $bits)
Parameters
type$bits

Definition at line 119 of file AVCSequenceParameterSetReader.php.

Referenced by GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\getBit(), and GetId3\Module\AudioVideo\AVCSequenceParameterSetReader\readData().

120  {
121  $newBits = $this->currentBits + $bits;
122  $this->currentBytes += (int) floor($newBits / 8);
123  $this->currentBits = $newBits % 8;
124  }
+ Here is the caller graph for this function:

Field Documentation

◆ $currentBits

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$currentBits = 0

◆ $currentBytes

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$currentBytes = 0

Definition at line 34 of file AVCSequenceParameterSetReader.php.

◆ $height

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$height

◆ $sps

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$sps

◆ $start

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$start = 0

Definition at line 33 of file AVCSequenceParameterSetReader.php.

◆ $width

GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::$width

◆ H264_AVC_SEQUENCE_HEADER

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_AVC_SEQUENCE_HEADER = 0

◆ H264_PROFILE_BASELINE

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_BASELINE = 66

Definition at line 40 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_EXTENDED

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_EXTENDED = 88

Definition at line 42 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_HIGH

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_HIGH = 100

Definition at line 43 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_HIGH10

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_HIGH10 = 110

Definition at line 44 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_HIGH422

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_HIGH422 = 122

Definition at line 45 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_HIGH444

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_HIGH444 = 144

Definition at line 46 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_HIGH444_PREDICTIVE

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_HIGH444_PREDICTIVE = 244

Definition at line 47 of file AVCSequenceParameterSetReader.php.

◆ H264_PROFILE_MAIN

const GetId3\Module\AudioVideo\AVCSequenceParameterSetReader::H264_PROFILE_MAIN = 77

Definition at line 41 of file AVCSequenceParameterSetReader.php.


The documentation for this class was generated from the following file: