ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
AVCSequenceParameterSetReader Class Reference
+ Collaboration diagram for 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
 

Detailed Description

Definition at line 630 of file module.audio-video.flv.php.

Constructor & Destructor Documentation

◆ __construct()

AVCSequenceParameterSetReader::__construct (   $sps)

Definition at line 638 of file module.audio-video.flv.php.

638  {
639  $this->sps = $sps;
640  }

Member Function Documentation

◆ expGolombSe()

AVCSequenceParameterSetReader::expGolombSe ( )

Definition at line 729 of file module.audio-video.flv.php.

References $result.

729  {
730  $result = $this->expGolombUe();
731  if (($result & 0x01) == 0) {
732  return -($result >> 1);
733  } else {
734  return ($result + 1) >> 1;
735  }
736  }
$result

◆ expGolombUe()

AVCSequenceParameterSetReader::expGolombUe ( )

Definition at line 714 of file module.audio-video.flv.php.

714  {
715  $significantBits = 0;
716  $bit = $this->getBit();
717  while ($bit == 0) {
718  $significantBits++;
719  $bit = $this->getBit();
720 
721  if ($significantBits > 31) {
722  // something is broken, this is an emergency escape to prevent infinite loops
723  return 0;
724  }
725  }
726  return (1 << $significantBits) + $this->getBits($significantBits) - 1;
727  }

◆ getBit()

AVCSequenceParameterSetReader::getBit ( )

Definition at line 700 of file module.audio-video.flv.php.

References $result, and getid3_lib\BigEndian2Int().

700  {
701  $result = (getid3_lib::BigEndian2Int(substr($this->sps, $this->currentBytes, 1)) >> (7 - $this->currentBits)) & 0x01;
702  $this->skipBits(1);
703  return $result;
704  }
$result
BigEndian2Int($byteword, $synchsafe=false, $signed=false)
Definition: getid3.lib.php:234
+ Here is the call graph for this function:

◆ getBits()

AVCSequenceParameterSetReader::getBits (   $bits)

Definition at line 706 of file module.audio-video.flv.php.

References $result.

706  {
707  $result = 0;
708  for ($i = 0; $i < $bits; $i++) {
709  $result = ($result << 1) + $this->getBit();
710  }
711  return $result;
712  }
$result

◆ getHeight()

AVCSequenceParameterSetReader::getHeight ( )

Definition at line 742 of file module.audio-video.flv.php.

◆ getWidth()

AVCSequenceParameterSetReader::getWidth ( )

Definition at line 738 of file module.audio-video.flv.php.

◆ readData()

AVCSequenceParameterSetReader::readData ( )

Definition at line 642 of file module.audio-video.flv.php.

642  {
643  $this->skipBits(8);
644  $this->skipBits(8);
645  $profile = $this->getBits(8); // read profile
646  if ($profile > 0) {
647  $this->skipBits(8);
648  $level_idc = $this->getBits(8); // level_idc
649  $this->expGolombUe(); // seq_parameter_set_id // sps
650  $this->expGolombUe(); // log2_max_frame_num_minus4
651  $picOrderType = $this->expGolombUe(); // pic_order_cnt_type
652  if ($picOrderType == 0) {
653  $this->expGolombUe(); // log2_max_pic_order_cnt_lsb_minus4
654  } elseif ($picOrderType == 1) {
655  $this->skipBits(1); // delta_pic_order_always_zero_flag
656  $this->expGolombSe(); // offset_for_non_ref_pic
657  $this->expGolombSe(); // offset_for_top_to_bottom_field
658  $num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle
659  for ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) {
660  $this->expGolombSe(); // offset_for_ref_frame[ i ]
661  }
662  }
663  $this->expGolombUe(); // num_ref_frames
664  $this->skipBits(1); // gaps_in_frame_num_value_allowed_flag
665  $pic_width_in_mbs_minus1 = $this->expGolombUe(); // pic_width_in_mbs_minus1
666  $pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1
667 
668  $frame_mbs_only_flag = $this->getBits(1); // frame_mbs_only_flag
669  if ($frame_mbs_only_flag == 0) {
670  $this->skipBits(1); // mb_adaptive_frame_field_flag
671  }
672  $this->skipBits(1); // direct_8x8_inference_flag
673  $frame_cropping_flag = $this->getBits(1); // frame_cropping_flag
674 
675  $frame_crop_left_offset = 0;
676  $frame_crop_right_offset = 0;
677  $frame_crop_top_offset = 0;
678  $frame_crop_bottom_offset = 0;
679 
680  if ($frame_cropping_flag) {
681  $frame_crop_left_offset = $this->expGolombUe(); // frame_crop_left_offset
682  $frame_crop_right_offset = $this->expGolombUe(); // frame_crop_right_offset
683  $frame_crop_top_offset = $this->expGolombUe(); // frame_crop_top_offset
684  $frame_crop_bottom_offset = $this->expGolombUe(); // frame_crop_bottom_offset
685  }
686  $this->skipBits(1); // vui_parameters_present_flag
687  // etc
688 
689  $this->width = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2);
690  $this->height = ((2 - $frame_mbs_only_flag) * ($pic_height_in_map_units_minus1 + 1) * 16) - ($frame_crop_top_offset * 2) - ($frame_crop_bottom_offset * 2);
691  }
692  }

◆ skipBits()

AVCSequenceParameterSetReader::skipBits (   $bits)

Definition at line 694 of file module.audio-video.flv.php.

694  {
695  $newBits = $this->currentBits + $bits;
696  $this->currentBytes += (int)floor($newBits / 8);
697  $this->currentBits = $newBits % 8;
698  }

Field Documentation

◆ $currentBits

AVCSequenceParameterSetReader::$currentBits = 0

Definition at line 634 of file module.audio-video.flv.php.

◆ $currentBytes

AVCSequenceParameterSetReader::$currentBytes = 0

Definition at line 633 of file module.audio-video.flv.php.

◆ $height

AVCSequenceParameterSetReader::$height

Definition at line 636 of file module.audio-video.flv.php.

◆ $sps

AVCSequenceParameterSetReader::$sps

Definition at line 631 of file module.audio-video.flv.php.

◆ $start

AVCSequenceParameterSetReader::$start = 0

Definition at line 632 of file module.audio-video.flv.php.

◆ $width

AVCSequenceParameterSetReader::$width

Definition at line 635 of file module.audio-video.flv.php.


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