algorithms

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_EXPONENT float64 = 0.4
View Source
var DEFAULT_HISTORIC_ESTIMATION_WINDOW int = 10
View Source
var DEFAULT_MAXIMUM_SWITCH = 2
View Source
var DEFAULT_MAX_BUFFER_FACTOR float64 = 1.15
View Source
var DEFAULT_MIN_BUFFER_FACTOR float64 = 0.75
View Source
var DEFAULT_PREDICTIVE_ESTIMATION_WINDOW = 5

Functions

func CalculateSelectedIndexArbiter

func CalculateSelectedIndexArbiter(newThr int, lastDuration int, lastIndex int, maxBufferLevel int,
	lastRate int, thrList *[]int, mpdDuration int, currentMPD http.MPD, currentURL string,
	currentMPDRepAdaptSet int, segmentNumber int, baseURL string, debugLog bool, downloadTime int, bufferLevel int,
	highestMPDrepRateIndex int, lowestMPDrepRateIndex int, bandwithList []int,
	segmentSize int) int

CalculateSelectedIndexArbiter :

  • return the index of the segment which should be selected *

func CalculateSelectedIndexBba

func CalculateSelectedIndexBba(newThr int, lastDuration int, lastIndex int, maxBufferLevel int,
	lastRate int, thrList *[]int, mpdDuration int, currentMPD http.MPD, currentURL string,
	currentMPDRepAdaptSet int, segmentNumber int, baseURL string, debugLog bool, downloadTime int, bufferLevel int,
	highestMPDrepRateIndex int, lowestMPDrepRateIndex int, bandwithList []int) int

CalculateSelectedIndexBba :

  • return the index of the segment which should be selected *

func CalculateThroughtput

func CalculateThroughtput(segmentSize, time int) int

CalculateThroughtput : input segment size and time, returns the throughtput

func Conventional

func Conventional(thrList *[]int, newThr int, repRate *int, bandwithList []int, lowestMPDrepRateIndex int)

Conventional :

* calculate of the throughtput with the ancient one and the new one * call the func to select the repRate from the throughtput * return the repRate and the list of throughtput

func EMWAAverageAlgo

func EMWAAverageAlgo(thrList *[]int, repRate *int, exponentialRatio float64, window int, newThr int, bandwithList []int, lowestMPDrepRateIndex int)

EMWAAverageAlgo :

call the func expAverage with all the values of the throughtput list and a window size to make an exponential average

func ElasticAlgo

func ElasticAlgo(thrList *[]int, newThr int, delTime int, maxBuffer int, repRate *int, bandwithList []int, staticAlgParameter *float64, bufferLevel int, kP float64, kI float64, lowestMPDrepRateIndex int)

ElasticAlgo call the func harmonicAverage with the last 5 values of throughtput to have a better estimate of the throughtput

func ExpAverage

func ExpAverage(thrList []int, ratio float64, window int, average *float64)

ExpAverage :

  • return the exponential average of the last "window" number of throughtputs

func FloatMin

func FloatMin(a, b float64) float64

FloatMin :

  • return the minimum of two float numbers

func GeomAverageAlgo

func GeomAverageAlgo(thrList *[]int, newThr int, repRate *int, bandwithList []int, lowestMPDrepRateIndex int)

GeomAverageAlgo : call the func geomAverage with all the values of the throughtput list to make a geometric average

func HighestBitrate

func HighestBitrate(thrList []int) float64

HighestBitrate : return the highest bitrate of the list

func Logistic

func Logistic(thrList *[]int, newThr int, repRate *int, bandwithList []int, bufferLevel int,
	highestMPDrepRateIndex int, lowestMPDrepRateIndex int, debugFiles string, debugLogs bool,
	maxBufferLevel int)

Logistic : add the last throughtput to the list and call CalculateSelectedIndex, return the rate and throughtput list

func LogisticFunction

func LogisticFunction(lastRateIndex int, thrList []int, bufferLevel int, highestMPDrepRateIndex int,
	lowestMPDrepRateIndex int, maxBufferLevel int, bandwithList []int) int

LogisticFunction : calculate and return the rate index

func LowestBitrate

func LowestBitrate(thrList []int) float64

LowestBitrate : return the lowest bitrate of the list

func MeanAverageAlgo

func MeanAverageAlgo(thrList *[]int, newThr int, repRate *int, bandwithList []int, lowestMPDrepRateIndex int)

MeanAverageAlgo : "normal average" -> take all the throughtputs and make the average call the func meanAverage with all the values of throughtput to make a "standard" average

func SelectRepRateWithThroughtput

func SelectRepRateWithThroughtput(thr int, bandwithList []int, lowestMPDrepRateIndex int) int

SelectRepRateWithThroughtput :

  • Select the rate the nearest just below the throughtput
  • return the selected rate

func SmartConvHelper

func SmartConvHelper(qIndex int, videoWindow int, estRate float64, currentMPD http.MPD, currentURL string, currentMPDRepAdaptSet int, lastRate int, segmentNumber int, baseURL string, debugLog bool, lastDuration int) bool

SmartConvHelper :

  • Checks next "videoWindow" of segments and makes sure the average rate is less than the estimated rate

func SmartConvHelperFromFile

func SmartConvHelperFromFile(videoWindow int, estRate float64, qRate int, segmentNumber int, lastDuration int) bool

SmartConvHelperFromFile :

  • Checks next "videoWindow" of segments and makes sure the average rate is less than the estimated rate

func ThroughputSamples

func ThroughputSamples(window int, thrList []int) []int

ThroughputSamples :

  • return the last "window" number of throughtputs

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL