Dirac - A Video Codec
Created by the British Broadcasting Corporation.
dirac Namespace Reference
Definition of class AccessUnitByteIO.
More...
Classes
Typedefs
Enumerations
- enum StatType {
STAT_TOTAL_BYTE_COUNT = 0,
STAT_MV_BYTE_COUNT,
STAT_YCOMP_BYTE_COUNT,
STAT_UCOMP_BYTE_COUNT,
STAT_VCOMP_BYTE_COUNT
}
- enum ParseUnitType {
PU_SEQ_HEADER = 0,
PU_FRAME,
PU_END_OF_SEQUENCE,
PU_AUXILIARY_DATA,
PU_PADDING_DATA,
PU_CORE_FRAME,
PU_LOW_DELAY_FRAME,
PU_UNDEFINED
}
- enum PredMode {
INTRA,
REF1_ONLY,
REF2_ONLY,
REF1AND2,
UNDEFINED
}
- Prediction modes for blocks. More...
- enum CompSort { Y_COMP,
U_COMP,
V_COMP
}
- Types of picture component. More...
- enum AddOrSub { ADD,
SUBTRACT
}
- Addition or subtraction. More...
- enum Direction { FORWARD,
BACKWARD
}
- Forward or backward. More...
- enum CtxAliases {
SIGN0_CTX,
SIGN_POS_CTX,
SIGN_NEG_CTX,
Z_FBIN1z_CTX,
Z_FBIN1nz_CTX,
Z_FBIN2_CTX,
Z_FBIN3_CTX,
Z_FBIN4_CTX,
Z_FBIN5_CTX,
Z_FBIN6plus_CTX,
NZ_FBIN1z_CTX,
NZ_FBIN1nz_CTX,
NZ_FBIN2_CTX,
NZ_FBIN3_CTX,
NZ_FBIN4_CTX,
NZ_FBIN5_CTX,
NZ_FBIN6plus_CTX,
INFO_CTX,
BLOCK_SKIP_CTX,
Q_OFFSET_FOLLOW_CTX,
Q_OFFSET_INFO_CTX,
Q_OFFSET_SIGN_CTX,
TOTAL_COEFF_CTXS
}
- Contexts used for coefficient coding. More...
- enum MvCtxAliases {
DC_FBIN1_CTX,
DC_FBIN2plus_CTX,
DC_INFO_CTX,
DC_SIGN_CTX,
MV_FBIN1_CTX,
MV_FBIN2_CTX,
MV_FBIN3_CTX,
MV_FBIN4_CTX,
MV_FBIN5plus_CTX,
MV_INFO_CTX,
MV_SIGN_CTX,
PMODE_BIT0_CTX,
PMODE_BIT1_CTX,
MB_SPLIT_BIN1_CTX,
MB_SPLIT_BIN2_CTX,
MB_SPLIT_INFO_CTX,
TOTAL_MV_CTXS
}
- Contexts used for MV data coding. More...
- enum DiracErrorCode {
ERR_UNSUPPORTED_STREAM_DATA = 0,
ERR_END_OF_STREAM,
ERR_INVALID_VIDEO_FORMAT,
ERR_INVALID_CHROMA_FORMAT,
ERR_INVALID_FRAME_RATE,
ERR_INVALID_SIGNAL_RANGE,
ERR_INVALID_PIXEL_ASPECT_RATIO,
ERR_INVALID_VIDEO_DEPTH,
ERR_INVALID_MOTION_VECTOR_PRECISION,
ERR_INVALID_INIT_DATA
}
- Enumeration of Dirac-defined error codes. More...
- enum DiracSeverityCode {
SEVERITY_NO_ERROR = 0,
SEVERITY_WARNING,
SEVERITY_FRAME_ERROR,
SEVERITY_ACCESSUNIT_ERROR,
SEVERITY_SEQUENCE_ERROR,
SEVERITY_TERMINATE
}
- Error-severity states. More...
- enum MvElement { HORIZONTAL,
VERTICAL
}
- Horizontal or vertical. More...
Functions
- template<class T> std::ostream & operator<< (std::ostream &stream, TwoDArray< T > &array)
- A function for extracting array data.
- template<class T> std::istream & operator>> (std::istream &stream, TwoDArray< T > &array)
- A function for inserting array data.
- VideoFormat IntToVideoFormat (int video_format)
- Function to convert an integer to a valid VideoFormat.
- ChromaFormat IntToChromaFormat (int chroma_format)
- Function to convert an integer to a valid VideoFormat.
- FrameRateType IntToFrameRateType (int frame_rate_idx)
- Function to convert an integer to a valid FrameRate type.
- PixelAspectRatioType IntToPixelAspectRatioType (int pix_asr_idx)
- Function to convert an integer to a valid PixelAspectRatio type.
- SignalRangeType IntToSignalRangeType (int signal_range_idx)
- Function to convert an integer to a valid SignalRange type.
- MVPrecisionType IntToMVPrecisionType (int mv_prec)
- Function to convert an integer to a valid motion-vector precision type.
- ValueType BChk (const ValueType &num, const ValueType &max)
- A simple bounds checking function, very useful in a number of places.
- void dirac_assert (const char *p_fname, int line_number, const char *p_mess)
- void dirac_report (const char *p_fname, int line_number, const char *p_mess)
- std::ostream & operator<< (std::ostream &dst, const DiracException &exception)
- template<class T> std::ostream & operator<< (std::ostream &stream, MotionVector< T > &mv)
- Overloaded operator<< for MotionVector class for output to stream.
- template<class T> std::istream & operator>> (std::istream &stream, MotionVector< T > &mv)
- Overloaded operator>> for MotionVector class for input from stream.
- int Median (const int val1, const int val2, const int val3)
- Return the median of 3 integers.
- MVector MvMedian (const MVector &mv1, const MVector &mv2, const MVector &mv3)
- Return the median of three motion vectors.
- int Median (const std::vector< int > &val_list)
- Return the median of a set of integers.
- MVector MvMedian (const std::vector< MVector > &vect_list)
- Return the median of a set of (up to 4) motion vectors.
- MVector MvMean (const MVector &mv1, const MVector &mv2)
- Return the mean of two motion vectors.
- int Norm2 (const MVector &mv)
- Return the squared length of a motion vector.
- int Norm1 (const MVector &mv)
- Return the sum of the lengths of a motion vector's componets.
- unsigned int GetUMean (std::vector< unsigned int > &values)
- Return the mean of a set of unsigned integer values.
- int GetSMean (std::vector< int > &values)
- Return the mean of a set of signed integer values.
- void SetDefaultCodecParameters (CodecParams &cparams, FrameType ftype, unsigned int num_refs)
- Sets default codec parameters - common to encoder and decoder.
- void SetDefaultEncoderParameters (EncoderParams &encparams)
- Sets default encoder parameters.
- void SetDefaultSourceParameters (const VideoFormat &vf, SourceParams &sparams)
- Sets default Source parameters.
- void SetDefaultBlockParameters (OLBParams &bparams, const VideoFormat &video_format)
- Sets default block parameters.
- void SetDefaultBlockParameters (OLBParams &bparams, int pidx)
- Sets default block parameters.
- unsigned int BlockParametersIndex (const OLBParams &bparams)
- Returns index of block parameters in Defaults table.
- void SetDefaultTransformFilter (FrameType ftype, WltFilter &wf)
- Sets the default Transform filter depending on frame type.
- void AddNewVlist (CandidateList &vect_list, const MVector &mv, const int xr, const int yr)
- Add a new motion vector list of neighbours of a vector to the set of lists.
- void AddNewVlist (CandidateList &vect_list, const MVector &mv, const int xr, const int yr, const int step)
- Add a new motion vector list to the set of lists for sub-pixel matching.
- void AddNewVlistD (CandidateList &vect_list, const MVector &mv, const int xr, const int yr)
- Add a new motion vector list of diagnonal neighbours of a vector to the set of lists.
- void AddVect (CandidateList &vect_list, const MVector &mv, const int list_num)
- Add a motion vector to the set of motion vector lists.
- ValueType GetVar (const MVector &mv1, const MVector &mv2)
- Get the (absolute) variation between two motion vectors.
- ValueType GetVar (const std::vector< MVector > &pred_list, const MVector &mv)
- Get the (absolute) variation between a motion vector and a list of motion vectors.
Detailed Description
Returns structures containing default parameter values for different video-formats.
Definition of class DiracException.
Definition of class TransformByteIO.
Definition of class SubbandByteIO.
Definition of class ParseUnitByteIO.
Definition of class ParseParamsByteIO.
Definition of class MvDataElementByteIO.
Definition of class MvDataByteIO.
Definition of class FrameByteIO.
Definition of class EndOfSequenceByteIO.
Definition of class SourceParamsByteIO.
Definition of class DiracByteStream.
Definition of class DiracByteStats.
Definition of class ComponentByteIO.
Definition of class CodingParamsByteIO.
Definition of class ByteIO.
Typedef Documentation
Enumeration Type Documentation
- Enumerator:
-
SIGN0_CTX |
|
SIGN_POS_CTX |
|
SIGN_NEG_CTX |
|
Z_FBIN1z_CTX |
|
Z_FBIN1nz_CTX |
|
Z_FBIN2_CTX |
|
Z_FBIN3_CTX |
|
Z_FBIN4_CTX |
|
Z_FBIN5_CTX |
|
Z_FBIN6plus_CTX |
|
NZ_FBIN1z_CTX |
|
NZ_FBIN1nz_CTX |
|
NZ_FBIN2_CTX |
|
NZ_FBIN3_CTX |
|
NZ_FBIN4_CTX |
|
NZ_FBIN5_CTX |
|
NZ_FBIN6plus_CTX |
|
INFO_CTX |
|
BLOCK_SKIP_CTX |
|
Q_OFFSET_FOLLOW_CTX |
|
Q_OFFSET_INFO_CTX |
|
Q_OFFSET_SIGN_CTX |
|
TOTAL_COEFF_CTXS |
|
- Enumerator:
-
ERR_UNSUPPORTED_STREAM_DATA |
|
ERR_END_OF_STREAM |
|
ERR_INVALID_VIDEO_FORMAT |
|
ERR_INVALID_CHROMA_FORMAT |
|
ERR_INVALID_FRAME_RATE |
|
ERR_INVALID_SIGNAL_RANGE |
|
ERR_INVALID_PIXEL_ASPECT_RATIO |
|
ERR_INVALID_VIDEO_DEPTH |
|
ERR_INVALID_MOTION_VECTOR_PRECISION |
|
ERR_INVALID_INIT_DATA |
|
- Enumerator:
-
SEVERITY_NO_ERROR |
|
SEVERITY_WARNING |
|
SEVERITY_FRAME_ERROR |
|
SEVERITY_ACCESSUNIT_ERROR |
|
SEVERITY_SEQUENCE_ERROR |
|
SEVERITY_TERMINATE |
|
- Enumerator:
-
DC_FBIN1_CTX |
|
DC_FBIN2plus_CTX |
|
DC_INFO_CTX |
|
DC_SIGN_CTX |
|
MV_FBIN1_CTX |
|
MV_FBIN2_CTX |
|
MV_FBIN3_CTX |
|
MV_FBIN4_CTX |
|
MV_FBIN5plus_CTX |
|
MV_INFO_CTX |
|
MV_SIGN_CTX |
|
PMODE_BIT0_CTX |
|
PMODE_BIT1_CTX |
|
MB_SPLIT_BIN1_CTX |
|
MB_SPLIT_BIN2_CTX |
|
MB_SPLIT_INFO_CTX |
|
TOTAL_MV_CTXS |
|
- Enumerator:
-
PU_SEQ_HEADER |
|
PU_FRAME |
|
PU_END_OF_SEQUENCE |
|
PU_AUXILIARY_DATA |
|
PU_PADDING_DATA |
|
PU_CORE_FRAME |
|
PU_LOW_DELAY_FRAME |
|
PU_UNDEFINED |
|
- Enumerator:
-
INTRA |
|
REF1_ONLY |
|
REF2_ONLY |
|
REF1AND2 |
|
UNDEFINED |
|
- Enumerator:
-
STAT_TOTAL_BYTE_COUNT |
|
STAT_MV_BYTE_COUNT |
|
STAT_YCOMP_BYTE_COUNT |
|
STAT_UCOMP_BYTE_COUNT |
|
STAT_VCOMP_BYTE_COUNT |
|
Function Documentation
void dirac::AddNewVlist |
( |
CandidateList & |
vect_list, |
|
|
const MVector & |
mv, |
|
|
const int |
xr, |
|
|
const int |
yr, |
|
|
const int |
step | |
|
) |
| | |
void dirac::AddNewVlist |
( |
CandidateList & |
vect_list, |
|
|
const MVector & |
mv, |
|
|
const int |
xr, |
|
|
const int |
yr | |
|
) |
| | |
void dirac::AddNewVlistD |
( |
CandidateList & |
vect_list, |
|
|
const MVector & |
mv, |
|
|
const int |
xr, |
|
|
const int |
yr | |
|
) |
| | |
void dirac::AddVect |
( |
CandidateList & |
vect_list, |
|
|
const MVector & |
mv, |
|
|
const int |
list_num | |
|
) |
| | |
Add a motion vector to the set of motion vector lists, making sure it's not a duplicate.
ValueType dirac::BChk |
( |
const ValueType & |
num, |
|
|
const ValueType & |
max | |
|
) |
| | [inline] |
unsigned int dirac::BlockParametersIndex |
( |
const OLBParams & |
bparams |
) |
|
- Parameters:
-
| bparams | Params object for getting index |
void dirac::dirac_assert |
( |
const char * |
p_fname, |
|
|
int |
line_number, |
|
|
const char * |
p_mess | |
|
) |
| | |
Print a message to standard error and abort if in debug mode
void dirac::dirac_report |
( |
const char * |
p_fname, |
|
|
int |
line_number, |
|
|
const char * |
p_mess | |
|
) |
| | |
Print a message to standard error
int dirac::GetSMean |
( |
std::vector< int > & |
values |
) |
|
unsigned int dirac::GetUMean |
( |
std::vector< unsigned int > & |
values |
) |
|
ValueType dirac::GetVar |
( |
const std::vector< MVector > & |
pred_list, |
|
|
const MVector & |
mv | |
|
) |
| | |
Return the variation between a motion vector and a list of motion vectos, computed as the sum of absolute differences between the components of the vector and the median vector produced by the list of vectors
ValueType dirac::GetVar |
( |
const MVector & |
mv1, |
|
|
const MVector & |
mv2 | |
|
) |
| | |
Return the variation between two motion vectors, computed as the sum of absolute differences of their components.
- Parameters:
-
| chroma_format | Integer corresponding to a format |
- Returns:
- Valid chroma-format (returns formatNK if no valid format found)
- Parameters:
-
| frame_rate_idx | Integer corresponding to a frame-rate in the spec table |
- Returns:
- Valid FrameRateType (returns FRAMERATE_UNDEFINED if no valid frame-rate found)
- Parameters:
-
| mv_prec | Integer corresponding to a valid motion-vector precision |
- Returns:
- Valid MVPrecisionType (returns SIGNAL_RANGE_UNDEFINED if no valid precision found)
- Parameters:
-
| pix_asr_idx | Integer corresponding to a pixel aspect ratio in the spec table |
- Returns:
- Valid PixelAspectRatioType (returns PIXEL_ASPECT_RATIO_UNDEFINED if no valid pixel aspect ratio found)
- Parameters:
-
| signal_range_idx | Integer corresponding to a signal-range in the spec table |
- Returns:
- Valid SignalRangeType (returns SIGNAL_RANGE_UNDEFINED if no valid signal-ratio found)
VideoFormat dirac::IntToVideoFormat |
( |
int |
video_format |
) |
|
- Parameters:
-
| video_format | Integer corresponding to a format |
- Returns:
- Valid video-format (returns VIDEO_FORMAT_UNDEFINED if no valid format found)
int dirac::Median |
( |
const std::vector< int > & |
val_list |
) |
|
int dirac::Median |
( |
const int |
val1, |
|
|
const int |
val2, |
|
|
const int |
val3 | |
|
) |
| | |
MVector dirac::MvMean |
( |
const MVector & |
mv1, |
|
|
const MVector & |
mv2 | |
|
) |
| | |
MVector dirac::MvMedian |
( |
const std::vector< MVector > & |
vect_list |
) |
|
MVector dirac::MvMedian |
( |
const MVector & |
mv1, |
|
|
const MVector & |
mv2, |
|
|
const MVector & |
mv3 | |
|
) |
| | |
int dirac::Norm1 |
( |
const MVector & |
mv |
) |
[inline] |
int dirac::Norm2 |
( |
const MVector & |
mv |
) |
[inline] |
template<class T>
std::ostream& dirac::operator<< |
( |
std::ostream & |
stream, |
|
|
MotionVector< T > & |
mv | |
|
) |
| | [inline] |
std::ostream& dirac::operator<< |
( |
std::ostream & |
dst, |
|
|
const DiracException & |
exception | |
|
) |
| | |
template<class T>
std::ostream& dirac::operator<< |
( |
std::ostream & |
stream, |
|
|
TwoDArray< T > & |
array | |
|
) |
| | [inline] |
template<class T>
std::istream& dirac::operator>> |
( |
std::istream & |
stream, |
|
|
MotionVector< T > & |
mv | |
|
) |
| | [inline] |
template<class T>
std::istream& dirac::operator>> |
( |
std::istream & |
stream, |
|
|
TwoDArray< T > & |
array | |
|
) |
| | [inline] |
void dirac::SetDefaultBlockParameters |
( |
OLBParams & |
bparams, |
|
|
int |
pidx | |
|
) |
| | |
- Parameters:
-
| bparams | Params object for setting defaults |
| pidx | Index into Block Parameters table |
void dirac::SetDefaultBlockParameters |
( |
OLBParams & |
bparams, |
|
|
const VideoFormat & |
video_format | |
|
) |
| | |
- Parameters:
-
| bparams | Params object for setting defaults |
| video_format | Video format |
void dirac::SetDefaultCodecParameters |
( |
CodecParams & |
cparams, |
|
|
FrameType |
ftype, |
|
|
unsigned int |
num_refs | |
|
) |
| | |
- Parameters:
-
| cparams | Codec Params objects for setting defaults |
| ftype | Frame type i,e, INTRA or INTER |
| num_refs | Number of reference frames |
void dirac::SetDefaultEncoderParameters |
( |
EncoderParams & |
encparams |
) |
|
- Parameters:
-
| encparams | Params objects for setting defaults |
void dirac::SetDefaultSourceParameters |
( |
const VideoFormat & |
vf, |
|
|
SourceParams & |
sparams | |
|
) |
| | |
- Parameters:
-
| vf | Video Format |
| sparams | Params object for setting defaults |
- Parameters:
-
| ftype | Frame type i.e. intra or inter |
| wf | WltFilter object for getting the default wavelet filter |
© 2004 British Broadcasting Corporation.
Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's
excellent Doxygen tool.