HEVC Test Model (HM)  HM-16.3
Functions
GuessLambdaModifiers.cpp File Reference
#include "GuessLambdaModifiers.h"
#include <limits>
#include <cassert>
#include <cmath>
Include dependency graph for GuessLambdaModifiers.cpp:

Go to the source code of this file.

Functions

double polateLambdaModifier (double targetBitrate, const Point &point1, const Point &point2)
 
double guessLambdaModifier (double initialAdjustmentParameter, double targetBitrate, const std::list< Point > &pointList, double interDampeningFactor)
 
std::vector< double > guessLambdaModifiers (double initialAdjustmentParameter, const std::vector< double > &targetBitrateVector, const std::list< MetaLogEntry< std::vector< double > > > &metaLogEntryList)
 
void guessLambdaModifiers (std::ostream &o, std::istream &initialAdjustmentParameterIstream, std::istream &targetsIstream, std::istream &metaLogIstream)
 

Function Documentation

double guessLambdaModifier ( double  initialAdjustmentParameter,
double  targetBitrate,
const std::list< Point > &  pointList,
double  interDampeningFactor 
)

Guesses a single Lambda-modifier

Parameters
initialAdjustmentParameterIf interpolation/extrapolation cannot be performed, then this parameter is used in the "increment" process.
targetBitrateThe target bitrate value that this Lambda-modifier is trying to reach
pointListThe list of points that correspond with this index
interDampeningFactorThis factor is obtained based on guessed Lambda-modifiers for previous temporal layers. In some cases, this factor will scale down the change of this Lambda-modifier so that we are not making too many severe Lambda-modifier changes for a single encoder run.
Returns
The Lambda-modifier guess
Precondition
pointList cannot be empty
interDampeningFactor must be greater than zero and less than or equal to 1 (0 < interDampeningFactor <= 1)

Definition at line 118 of file GuessLambdaModifiers.cpp.

std::vector< double > guessLambdaModifiers ( double  initialAdjustmentParameter,
const std::vector< double > &  targetBitrateVector,
const std::list< MetaLogEntry< std::vector< double > > > &  metaLogEntryList 
)

Guesses all of the Lambda-modifiers

Parameters
initialAdjustmentParameterIf interpolation/extrapolation cannot be performed, then this parameter is used in the "increment" process.
targetBitrateVectorThe target bitrate values that we are trying to reach
metaLogEntryListAll of the previously run Lambda-modifiers and their corresponding bitrates from the meta-log
Returns
Vector containing all of the guessed Lambda-modifiers
Precondition
targetBitrateVector cannot be empty
metaLogEntryList cannot be empty
The size of targetBitrateVector must be the same as the size of bitrateVector in every item in metaLogEntryList
The size of targetBitrateVector must be the same as the size of lambdaModifiers in every item in metaLogEntryList

Definition at line 203 of file GuessLambdaModifiers.cpp.

void guessLambdaModifiers ( std::ostream &  o,
std::istream &  initialAdjustmentParameterIstream,
std::istream &  targetsIstream,
std::istream &  metaLogIstream 
)

Guesses all of the Lambda-modifiers This function performs all of the necessary input parsing. It ends up calling the other guessLambdaModifiers overload to perform the actual calculations.

Parameters
oThe output stream to write the guessed Lambda-modifiers to
initialAdjustmentParameterIstreamThe input stream that contains the initial adjustment parameter
targetsIstreamThe input stream that contains the target bitrates
metaLogIstreamThe input stream that contains the meta-log
Exceptions
InitialAdjustmentParameterParseExceptionif there is an error parsing the initial adjustment parameter
TargetsParseExceptionif there is an error parsing the target bitrates
MetaLogParseExceptionif there is an error parsing the meta-log
MismatchedIndexesExceptionif there is a mismatch in the vector sizes or the Lambda-modifier indexes

Definition at line 362 of file GuessLambdaModifiers.cpp.

double polateLambdaModifier ( double  targetBitrate,
const Point point1,
const Point point2 
)

Performs interpolation/extrapolation to guess a single Lambda-modifier

Parameters
targetBitrateThe target bitrate value that this Lambda-modifier is trying to reach
point1One of the two previously tried points where first is the Lambda-modifier and second is the obtained bitrate
point2One of the two previously tried points where first is the Lambda-modifier and second is the obtained bitrate
Returns
The interpolated Lambda-modifier guess
Precondition
Both given points must contain only positive non-zero values for first and second
The given points must have different first values and different second values. If either the first values are the same or the second values are the same, then we have either a vertical or horizontal slope, and thus, interpolation cannot be performed.

Definition at line 102 of file GuessLambdaModifiers.cpp.