281 $OverheadPercentage = 0;
283 $AudioBitrate = max(min($AudioBitrate / 1000, 384), 32);
284 $VideoBitrate = max(min($VideoBitrate / 1000, 10000), 10);
286 $OverheadMultiplierByBitrate[32] =
array(0, 0.9676287944368530, 0.9802276264360310, 0.9844916183244460, 0.9852821845179940);
287 $OverheadMultiplierByBitrate[48] =
array(0, 0.9779100089209830, 0.9787770035359320, 0.9846738664076130, 0.9852683013799960);
288 $OverheadMultiplierByBitrate[56] =
array(0, 0.9731249855367600, 0.9776624308938040, 0.9832606361852130, 0.9843922606633340);
289 $OverheadMultiplierByBitrate[64] =
array(0, 0.9755642683275760, 0.9795256705493390, 0.9836573009193170, 0.9851122539404470);
290 $OverheadMultiplierByBitrate[96] =
array(0, 0.9788025247497290, 0.9798553314148700, 0.9822956869792560, 0.9834815119124690);
291 $OverheadMultiplierByBitrate[128] =
array(0, 0.9816940050925480, 0.9821675936072120, 0.9829756927470870, 0.9839763420152050);
292 $OverheadMultiplierByBitrate[160] =
array(0, 0.9825894094561180, 0.9820913399073960, 0.9823907143253970, 0.9832821783651570);
293 $OverheadMultiplierByBitrate[192] =
array(0, 0.9832038474336260, 0.9825731694317960, 0.9821028622712400, 0.9828262076447620);
294 $OverheadMultiplierByBitrate[224] =
array(0, 0.9836516298538770, 0.9824718601823890, 0.9818302180625380, 0.9823735101626480);
295 $OverheadMultiplierByBitrate[256] =
array(0, 0.9845863022094920, 0.9837229411967540, 0.9824521662210830, 0.9828645172100790);
296 $OverheadMultiplierByBitrate[320] =
array(0, 0.9849565280263180, 0.9837683142805110, 0.9822885275960400, 0.9824424382727190);
297 $OverheadMultiplierByBitrate[384] =
array(0, 0.9856094774357600, 0.9844573394432720, 0.9825970399837330, 0.9824673808303890);
299 $BitrateToUseMin = 32;
300 $BitrateToUseMax = 32;
301 $previousBitrate = 32;
302 foreach ($OverheadMultiplierByBitrate as $key => $value) {
303 if ($AudioBitrate >= $previousBitrate) {
304 $BitrateToUseMin = $previousBitrate;
306 if ($AudioBitrate < $key) {
307 $BitrateToUseMax = $key;
310 $previousBitrate = $key;
312 $FactorA = ($BitrateToUseMax - $AudioBitrate) / ($BitrateToUseMax - $BitrateToUseMin);
314 $VideoBitrateLog10 = log10($VideoBitrate);
315 $VideoFactorMin1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][floor($VideoBitrateLog10)];
316 $VideoFactorMin2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][floor($VideoBitrateLog10)];
317 $VideoFactorMax1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][ceil($VideoBitrateLog10)];
318 $VideoFactorMax2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][ceil($VideoBitrateLog10)];
319 $FactorV = $VideoBitrateLog10 - floor($VideoBitrateLog10);
321 $OverheadPercentage = $VideoFactorMin1 * $FactorA * $FactorV;
322 $OverheadPercentage += $VideoFactorMin2 * (1 - $FactorA) * $FactorV;
323 $OverheadPercentage += $VideoFactorMax1 * $FactorA * (1 - $FactorV);
324 $OverheadPercentage += $VideoFactorMax2 * (1 - $FactorA) * (1 - $FactorV);
326 return $OverheadPercentage;
Create styles array
The data for the language used.