wppaste
WordPress

AVCSequenceParameterSetReader::readData()

Source
wp-includes/ID3/module.audio-video.flv.php:784

Compatibility

WordPress
core
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Performance profile

How much work a call to AVCSequenceParameterSetReader::readData() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Light

Touches nothing outside its own arguments.

Scaling
Scales with input

The body loops, so the work grows with how much data it finds.

Instructions
13–110

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 116.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What one call costs · 13 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost AVCSequenceParameterSetReader::readData() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!$profile13->skipBits(), ->skipBits(), ->getBits()
$profile && $picOrderType != 0 && $picOrderType != 1 && $frame_mbs_only_flag != 081->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType == 0 && $frame_mbs_only_flag != 082->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType != 1 && $frame_mbs_only_flag == 084->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType == 0 && $frame_mbs_only_flag == 085->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType != 1 && $frame_mbs_only_flag != 093->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()
$profile && $picOrderType == 0 && $frame_mbs_only_flag != 094->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType == 1 && !$i && $frame_mbs_only_flag != 095->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombSe(), ->expGolombSe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType != 1 && $frame_mbs_only_flag == 096->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()
$profile && $picOrderType == 0 && $frame_mbs_only_flag == 097->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType == 1 && !$i && $frame_mbs_only_flag == 098->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombSe(), ->expGolombSe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->skipBits()
$profile && $picOrderType != 0 && $picOrderType == 1 && !$i && $frame_mbs_only_flag != 0107->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombSe(), ->expGolombSe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()
1 further outcome, up to 110 instructions
$profile && $picOrderType != 0 && $picOrderType == 1 && !$i && $frame_mbs_only_flag == 0110->skipBits(), ->skipBits(), ->getBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombSe(), ->expGolombSe(), ->expGolombUe(), ->expGolombUe(), ->skipBits(), ->expGolombUe(), ->expGolombUe(), ->getBits(), ->skipBits(), ->skipBits(), ->getBits(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->expGolombUe(), ->skipBits()

Across PHP versions

Compiles the same on PHP 7.4, 8.1, 8.2, 8.3, 8.4, 8.5 and 8.6-dev: 116 instructions, 13–110 executed per call, 6 branches. The work does not change between versions.

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Uses · 4

Source code

	public function readData() {		$this->skipBits(8);		$this->skipBits(8);		$profile = $this->getBits(8);                               // read profile		if ($profile > 0) {			$this->skipBits(8);			$level_idc = $this->getBits(8);                         // level_idc			$this->expGolombUe();                                   // seq_parameter_set_id // sps			$this->expGolombUe();                                   // log2_max_frame_num_minus4			$picOrderType = $this->expGolombUe();                   // pic_order_cnt_type			if ($picOrderType == 0) {				$this->expGolombUe();                               // log2_max_pic_order_cnt_lsb_minus4			} elseif ($picOrderType == 1) {				$this->skipBits(1);                                 // delta_pic_order_always_zero_flag				$this->expGolombSe();                               // offset_for_non_ref_pic				$this->expGolombSe();                               // offset_for_top_to_bottom_field				$num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle				for ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) {					$this->expGolombSe();                           // offset_for_ref_frame[ i ]				}			}			$this->expGolombUe();                                   // num_ref_frames			$this->skipBits(1);                                     // gaps_in_frame_num_value_allowed_flag			$pic_width_in_mbs_minus1 = $this->expGolombUe();        // pic_width_in_mbs_minus1			$pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1 			$frame_mbs_only_flag = $this->getBits(1);               // frame_mbs_only_flag			if ($frame_mbs_only_flag == 0) {				$this->skipBits(1);                                 // mb_adaptive_frame_field_flag			}			$this->skipBits(1);                                     // direct_8x8_inference_flag			$frame_cropping_flag = $this->getBits(1);               // frame_cropping_flag 			$frame_crop_left_offset   = 0;			$frame_crop_right_offset  = 0;			$frame_crop_top_offset    = 0;			$frame_crop_bottom_offset = 0; 			if ($frame_cropping_flag) {				$frame_crop_left_offset   = $this->expGolombUe();   // frame_crop_left_offset				$frame_crop_right_offset  = $this->expGolombUe();   // frame_crop_right_offset				$frame_crop_top_offset    = $this->expGolombUe();   // frame_crop_top_offset				$frame_crop_bottom_offset = $this->expGolombUe();   // frame_crop_bottom_offset			}			$this->skipBits(1);                                     // vui_parameters_present_flag			// etc 			$this->width  = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2);			$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);		}	}

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/ID3/module.audio-video.flv.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.