Class OptimizationStep
java.lang.Object
org.opencastproject.videosegmenter.ffmpeg.OptimizationStep
- All Implemented Interfaces:
Comparable<OptimizationStep>
An optimization step is one step in the optimization of the number of segments.
This class stores parameters of such an optimization step and calculates error and
absolute error of optimization
-
Constructor Summary
ConstructorsConstructorDescriptioncreates a new optimization step with default valuesOptimizationStep(float changesThreshold, int segNum, int prefNum, Mpeg7Catalog mpeg7, LinkedList<Segment> segments) creates a new optimization step with given parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcalculateErrorAbs(int segmentNum, int prefNum) calculates absolute error from given number of segments and preferred number of segmentsintWith this method a list of OptimizationSteps can be sorted such that the smallest positive error is the first element of the list and the smallest negative error is the last element of the listfloatget changesThresholdfloatgetError()get error of optimizationfloatget absolute errorgetMpeg7()get Mpeg7Catalog with segmentsintget number of segmentsget list of segmentsvoidsetSegmentNumAndRecalcErrors(int segNum) set number of segments
-
Constructor Details
-
OptimizationStep
public OptimizationStep(float changesThreshold, int segNum, int prefNum, Mpeg7Catalog mpeg7, LinkedList<Segment> segments) creates a new optimization step with given parameters- Parameters:
changesThreshold-segNum-prefNum-mpeg7-segments- unfiltered list of segments
-
OptimizationStep
public OptimizationStep()creates a new optimization step with default values
-
-
Method Details
-
getChangesThreshold
public float getChangesThreshold()get changesThreshold- Returns:
- changesThreshold
-
getError
public float getError()get error of optimization- Returns:
- error error of optimization
-
getErrorAbs
public float getErrorAbs()get absolute error- Returns:
- errorAbs absolute error
-
getSegmentNum
public int getSegmentNum()get number of segments- Returns:
- segmentNum number of segments
-
setSegmentNumAndRecalcErrors
public void setSegmentNumAndRecalcErrors(int segNum) set number of segments- Parameters:
segNum- number of segments
-
getMpeg7
get Mpeg7Catalog with segments- Returns:
- mpeg7 Mpeg7Catalog with segments
-
getSegments
get list of segments- Returns:
- segments list of segments
-
calculateErrorAbs
public static float calculateErrorAbs(int segmentNum, int prefNum) calculates absolute error from given number of segments and preferred number of segments- Parameters:
segmentNum- number of segmentsprefNum- preferred number of segments- Returns:
-
compareTo
With this method a list of OptimizationSteps can be sorted such that the smallest positive error is the first element of the list and the smallest negative error is the last element of the list- Specified by:
compareToin interfaceComparable<OptimizationStep>- Parameters:
o- the OptimizationStep to be compared.- Returns:
- a negative integer or a positive integer as this OptimizationStep should be placed to the left or right of the specified OptimizationStep or zero if their errors are equal.
-