# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

Public Member Functions | Private Attributes
dirac::SourceParams Class Reference

Parameters relating to the source material being encoded/decoded.

`#include <common.h>`

List of all members.

## Public Member Functions
| SourceParams (const VideoFormat &vf=VIDEO_FORMAT_CUSTOM, bool set_defaults=true)
| default constructor
VideoFormat | GetVideoFormat () const
| Returns video-format.
unsigned int | Xl () const
| Returns the picture width.
unsigned int | Yl () const
| Returns the picture height.
ChromaFormat | CFormat () const
| Returns the chroma format of the sequence (420, 422, 444)
int | ChromaWidth () const
| Returns the chroma width.
int | ChromaHeight () const
| Returns the chroma height.
unsigned int | SourceSampling () const
| Returns the source sampling field of the source scan format.
bool | TopFieldFirst () const
| Returns true if top field comes first in time.
Rational | FrameRate () const
| Return the number for frames per second.
FrameRateType | FrameRateIndex () const
| Return the type from the frame rate table.
Rational | PixelAspectRatio () const
| Return the pixel aspect ratio.
PixelAspectRatioType | PixelAspectRatioIndex () const
| Return the type from the pixel aspect ratio table.
unsigned int | CleanWidth () const
| Return the Clean area width.
unsigned int | CleanHeight () const
| Return the Clean area height.
unsigned int | LeftOffset () const
| Return the Clean area left offset.
unsigned int | TopOffset () const
| Return the Clean area top offset.
SignalRangeType | SignalRangeIndex () const
| Return the type from the signal range table.
unsigned int | LumaOffset () const
| Return the luma offset.
unsigned int | LumaExcursion () const
| Return the luma excursion.
unsigned int | ChromaOffset () const
| Return the chroma offset.
unsigned int | ChromaExcursion () const
| Return the chroma excursion.
unsigned int | ColourSpecificationIndex () const
| Return the index into the colour specification table.
ColourPrimaries | ColourPrimariesIndex () const
| Return the colour primaries index.
ColourMatrix | ColourMatrixIndex () const
| Return the colour matrix index.
TransferFunction | TransferFunctionIndex () const
| Return the transfer function index.
void | SetXl (unsigned int xlen)
| Sets the picture width.
void | SetYl (unsigned int ylen)
| Sets the picture height.
void | SetCFormat (ChromaFormat cf)
| Sets the chroma format (Y only, 420, 422 etc)
void | SetSourceSampling (unsigned int source_sampling)
| Set if the source sampling field of the scan format.
void | SetTopFieldFirst (bool tff)
| Set Topfield first. True if top field comes first in time.
void | SetVideoFormat (VideoFormat vf)
| Sets the video format.
void | SetFrameRate (const Rational &frate)
| Set the frame rate.
void | SetFrameRate (unsigned int fr_num, unsigned int fr_denom)
| Set the frame rate.
void | SetFrameRate (FrameRateType fr)
| Set the frame rate.
void | SetPixelAspectRatio (const Rational &pix_asr)
| Set the pixel aspect ratio.
void | SetPixelAspectRatio (unsigned int pix_as_num, unsigned int pix_as_denom)
| Set the pixel aspect ratio.
void | SetPixelAspectRatio (PixelAspectRatioType pixel_aspect_ratio)
| Set the Pixel Aspect Ratio.
void | SetCleanWidth (unsigned int clean_width)
| Set the Clean area width.
void | SetCleanHeight (unsigned int clean_height)
| Set the Clean area height.
void | SetLeftOffset (unsigned int left_offset)
| Set the Clean area left offset.
void | SetTopOffset (unsigned int top_offset)
| Set the Clean area top offset.
void | SetSignalRange (SignalRangeType sr)
| Set the Signal Range parameters.
void | SetLumaOffset (unsigned int luma_offset)
| Set the luma offset.
void | SetLumaExcursion (unsigned int luma_exc)
| Set the luma excursion.
void | SetChromaOffset (unsigned int chroma_off)
| Set the chroma offset.
void | SetChromaExcursion (unsigned int chroma_exc)
| Set the chroma excursion.
void | SetColourSpecification (unsigned int cs_idx)
| Set the Colour specification.
void | SetColourPrimariesIndex (unsigned int cp)
| Set the colour primaries index.
void | SetColourMatrixIndex (unsigned int cm)
| Set the colour matrix index.
void | SetTransferFunctionIndex (unsigned int tf)
| Set the transfer function index.

## Private Attributes
VideoFormat | m_video_format
| Video-format.
unsigned int | m_xl
| Width of video.
unsigned int | m_yl
| Height of video.
ChromaFormat | m_cformat
| Presence of chroma and/or chroma sampling structure.
unsigned int | m_source_sampling
| Source sampling field : 0 - progressive, 1 - interlaced.
bool | m_topfieldfirst
| If m_source_sampling=1, true if the top field is first in temporal order.
FrameRateType | m_fr_idx
| Index into frame rate table.
Rational | m_framerate
| Frame Rate i.e number of frames per second.
PixelAspectRatioType | m_pix_asr_idx
| Index into pixel aspect ratio table.
Rational | m_pixel_aspect_ratio
| Pixel Aspect Ratio.
unsigned int | m_clean_width
| Clean area width.
unsigned int | m_clean_height
| Clean area height.
unsigned int | m_left_offset
| Clean area left offset.
unsigned int | m_top_offset
| Clean area top offset.
SignalRangeType | m_sr_idx
| Index into signal range table.
unsigned int | m_luma_offset
| Luma offset.
unsigned int | m_luma_excursion
| Luma excursion.
unsigned int | m_chroma_offset
| Chroma offset.
unsigned int | m_chroma_excursion
| Chroma excursion.
unsigned int | m_cs_idx
| Index into colour spec table.
ColourPrimaries | m_col_primary
| Colour Primaries Index.
ColourMatrix | m_col_matrix
TransferFunction | m_transfer_func

## Constructor & Destructor Documentation

dirac::SourceParams::SourceParams | ( | const VideoFormat & | vf = `VIDEO_FORMAT_CUSTOM`,
|  | bool | set_defaults = `true`
| ) |  |

## Member Function Documentation

ChromaFormat dirac::SourceParams::CFormat | ( |  | ) | const
| inline

References m_cformat.

unsigned int dirac::SourceParams::ChromaExcursion | ( |  | ) | const
| inline

References m_chroma_excursion.

int dirac::SourceParams::ChromaHeight | ( |  | ) | const

unsigned int dirac::SourceParams::ChromaOffset | ( |  | ) | const
| inline

References m_chroma_offset.

int dirac::SourceParams::ChromaWidth | ( |  | ) | const

unsigned int dirac::SourceParams::CleanHeight | ( |  | ) | const
| inline

References m_clean_height.

unsigned int dirac::SourceParams::CleanWidth | ( |  | ) | const
| inline

References m_clean_width.

ColourMatrix dirac::SourceParams::ColourMatrixIndex | ( |  | ) | const
| inline

References m_col_matrix.

ColourPrimaries dirac::SourceParams::ColourPrimariesIndex | ( |  | ) | const
| inline

References m_col_primary.

unsigned int dirac::SourceParams::ColourSpecificationIndex | ( |  | ) | const
| inline

References m_cs_idx.

Rational dirac::SourceParams::FrameRate | ( |  | ) | const
| inline

References m_framerate.

FrameRateType dirac::SourceParams::FrameRateIndex | ( |  | ) | const
| inline

References m_fr_idx.

VideoFormat dirac::SourceParams::GetVideoFormat | ( |  | ) | const
| inline

References m_video_format.

unsigned int dirac::SourceParams::LeftOffset | ( |  | ) | const
| inline

References m_left_offset.

unsigned int dirac::SourceParams::LumaExcursion | ( |  | ) | const
| inline

References m_luma_excursion.

unsigned int dirac::SourceParams::LumaOffset | ( |  | ) | const
| inline

References m_luma_offset.

Rational dirac::SourceParams::PixelAspectRatio | ( |  | ) | const
| inline

References m_pixel_aspect_ratio.

PixelAspectRatioType dirac::SourceParams::PixelAspectRatioIndex | ( |  | ) | const
| inline

References m_pix_asr_idx.

void dirac::SourceParams::SetCFormat | ( | ChromaFormat | cf | ) |
| inline

References m_cformat.

void dirac::SourceParams::SetChromaExcursion | ( | unsigned int | chroma_exc | ) |
| inline

References m_chroma_excursion, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

void dirac::SourceParams::SetChromaOffset | ( | unsigned int | chroma_off | ) |
| inline

References m_chroma_offset, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

void dirac::SourceParams::SetCleanHeight | ( | unsigned int | clean_height | ) |
| inline

References m_clean_height.

void dirac::SourceParams::SetCleanWidth | ( | unsigned int | clean_width | ) |
| inline

References m_clean_width.

void dirac::SourceParams::SetColourMatrixIndex | ( | unsigned int | cm | ) |

void dirac::SourceParams::SetColourPrimariesIndex | ( | unsigned int | cp | ) |

void dirac::SourceParams::SetColourSpecification | ( | unsigned int | cs_idx | ) |

void dirac::SourceParams::SetFrameRate | ( | const Rational & | frate | ) |
| inline

References FRAMERATE_CUSTOM, m_fr_idx, and m_framerate.

void dirac::SourceParams::SetFrameRate | ( | unsigned int | fr_num,
|  | unsigned int | fr_denom
| ) |  |
| inline

References FRAMERATE_CUSTOM, dirac::Rational::m_denom, m_fr_idx, m_framerate, and dirac::Rational::m_num.

void dirac::SourceParams::SetFrameRate | ( | FrameRateType | fr | ) |

void dirac::SourceParams::SetLeftOffset | ( | unsigned int | left_offset | ) |
| inline

References m_left_offset.

void dirac::SourceParams::SetLumaExcursion | ( | unsigned int | luma_exc | ) |
| inline

References m_luma_excursion, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

void dirac::SourceParams::SetLumaOffset | ( | unsigned int | luma_offset | ) |
| inline

References m_luma_offset, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

void dirac::SourceParams::SetPixelAspectRatio | ( | const Rational & | pix_asr | ) |
| inline

References m_pix_asr_idx, m_pixel_aspect_ratio, and PIXEL_ASPECT_RATIO_CUSTOM.

void dirac::SourceParams::SetPixelAspectRatio | ( | unsigned int | pix_as_num,
|  | unsigned int | pix_as_denom
| ) |  |
| inline

References dirac::Rational::m_denom, dirac::Rational::m_num, m_pix_asr_idx, m_pixel_aspect_ratio, and PIXEL_ASPECT_RATIO_CUSTOM.

void dirac::SourceParams::SetPixelAspectRatio | ( | PixelAspectRatioType | pixel_aspect_ratio | ) |

void dirac::SourceParams::SetSignalRange | ( | SignalRangeType | sr | ) |

void dirac::SourceParams::SetSourceSampling | ( | unsigned int | source_sampling | ) |
| inline

References m_source_sampling.

void dirac::SourceParams::SetTopFieldFirst | ( | bool | tff | ) |
| inline

References m_topfieldfirst.

void dirac::SourceParams::SetTopOffset | ( | unsigned int | top_offset | ) |
| inline

References m_top_offset.

void dirac::SourceParams::SetTransferFunctionIndex | ( | unsigned int | tf | ) |

void dirac::SourceParams::SetVideoFormat | ( | VideoFormat | vf | ) |
| inline

References m_video_format.

void dirac::SourceParams::SetXl | ( | unsigned int | xlen | ) |
| inline

References m_xl.

void dirac::SourceParams::SetYl | ( | unsigned int | ylen | ) |
| inline

References m_yl.

SignalRangeType dirac::SourceParams::SignalRangeIndex | ( |  | ) | const
| inline

References m_sr_idx.

unsigned int dirac::SourceParams::SourceSampling | ( |  | ) | const
| inline

References m_source_sampling.

bool dirac::SourceParams::TopFieldFirst | ( |  | ) | const
| inline

References m_topfieldfirst.

unsigned int dirac::SourceParams::TopOffset | ( |  | ) | const
| inline

References m_top_offset.

TransferFunction dirac::SourceParams::TransferFunctionIndex | ( |  | ) | const
| inline

References m_transfer_func.

unsigned int dirac::SourceParams::Xl | ( |  | ) | const
| inline

References m_xl.

unsigned int dirac::SourceParams::Yl | ( |  | ) | const
| inline

References m_yl.

## Member Data Documentation

ChromaFormat dirac::SourceParams::m_cformat
| private

Referenced by CFormat(), and SetCFormat().

unsigned int dirac::SourceParams::m_chroma_excursion
| private

Referenced by ChromaExcursion(), and SetChromaExcursion().

unsigned int dirac::SourceParams::m_chroma_offset
| private

Referenced by ChromaOffset(), and SetChromaOffset().

unsigned int dirac::SourceParams::m_clean_height
| private

Referenced by CleanHeight(), and SetCleanHeight().

unsigned int dirac::SourceParams::m_clean_width
| private

Referenced by CleanWidth(), and SetCleanWidth().

ColourMatrix dirac::SourceParams::m_col_matrix
| private

Referenced by ColourMatrixIndex().

ColourPrimaries dirac::SourceParams::m_col_primary
| private

Referenced by ColourPrimariesIndex().

unsigned int dirac::SourceParams::m_cs_idx
| private

Referenced by ColourSpecificationIndex().

FrameRateType dirac::SourceParams::m_fr_idx
| private

Referenced by FrameRateIndex(), and SetFrameRate().

Rational dirac::SourceParams::m_framerate
| private

Referenced by FrameRate(), and SetFrameRate().

unsigned int dirac::SourceParams::m_left_offset
| private

Referenced by LeftOffset(), and SetLeftOffset().

unsigned int dirac::SourceParams::m_luma_excursion
| private

Referenced by LumaExcursion(), and SetLumaExcursion().

unsigned int dirac::SourceParams::m_luma_offset
| private

Referenced by LumaOffset(), and SetLumaOffset().

PixelAspectRatioType dirac::SourceParams::m_pix_asr_idx
| private

Referenced by PixelAspectRatioIndex(), and SetPixelAspectRatio().

Rational dirac::SourceParams::m_pixel_aspect_ratio
| private

Referenced by PixelAspectRatio(), and SetPixelAspectRatio().

unsigned int dirac::SourceParams::m_source_sampling
| private

Referenced by SetSourceSampling(), and SourceSampling().

SignalRangeType dirac::SourceParams::m_sr_idx
| private

Referenced by SetChromaExcursion(), SetChromaOffset(), SetLumaExcursion(), SetLumaOffset(), and SignalRangeIndex().

unsigned int dirac::SourceParams::m_top_offset
| private

Referenced by SetTopOffset(), and TopOffset().

bool dirac::SourceParams::m_topfieldfirst
| private

Referenced by SetTopFieldFirst(), and TopFieldFirst().

TransferFunction dirac::SourceParams::m_transfer_func
| private

Referenced by TransferFunctionIndex().

VideoFormat dirac::SourceParams::m_video_format
| private

Referenced by GetVideoFormat(), and SetVideoFormat().

unsigned int dirac::SourceParams::m_xl
| private

Referenced by SetXl(), and Xl().

unsigned int dirac::SourceParams::m_yl
| private

Referenced by SetYl(), and Yl().

The documentation for this class was generated from the following file:

- common.h

© 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.