# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::SourceParams Class Reference

Parameters relating to the source material being encoded/decoded.

`#include <common.h>`

Collaboration diagram for dirac::SourceParams:

[legend]

List of all members.

## Public Member Functions

- SourceParams (const VideoFormat &vf=VIDEO_FORMAT_CUSTOM, bool set_defaults=true)
    default constructor
- bool Interlace () const
    Returns true if the source material is interlaced.
- bool TopFieldFirst () const
    Returns true if top field comes first in time.
- bool SequentialFields () const
    Returns true if fields are sequential i.e. not interleaved.
- Rational FrameRate () const
    Return the number for frames per second.
- FrameRateType FrameRateIndex () const
    Return the type from the frame rate table.
- Rational AspectRatio () const
    Return the pixel aspect ratio.
- AspectRatioType AspectRatioIndex () const
    Return the type from the 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 SetInterlace (bool interlace)
    Set if the source material is interlaced.
- void SetTopFieldFirst (bool tff)
    Set Topfield first. True if top field comes first in time.
- void SetSequentialFields (bool seq_flds)
    Set 'sequential fields flag. true if fields are sequential i.e. not interleaved.
- 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 SetAspectRatio (const Rational &asr)
    Set the pixel aspect ratio.
- void SetAspectRatio (unsigned int as_num, unsigned int as_denom)
    Set the pixel aspect ratio.
- void SetAspectRatio (AspectRatioType 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

- bool m_interlace
    True if interlaced.
- bool m_topfieldfirst
    If interlaced, true if the top field is first in temporal order.
- bool m_seq_fields
    If interlaced, true if the fields are sequential and not interleaved.
- FrameRateType m_fr_idx
    Index into frame rate table.
- Rational m_framerate
    Frame Rate i.e number of frames per second.
- AspectRatioType m_asr_idx
    Index into pixel aspect ratio table.
- Rational m_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

bool dirac::SourceParams::Interlace | ( |  | ) | const`[inline]`

References m_interlace.

bool dirac::SourceParams::TopFieldFirst | ( |  | ) | const`[inline]`

References m_topfieldfirst.

bool dirac::SourceParams::SequentialFields | ( |  | ) | const`[inline]`

References m_seq_fields.

Rational dirac::SourceParams::FrameRate | ( |  | ) | const`[inline]`

References m_framerate.

FrameRateType dirac::SourceParams::FrameRateIndex | ( |  | ) | const`[inline]`

References m_fr_idx.

Rational dirac::SourceParams::AspectRatio | ( |  | ) | const`[inline]`

References m_aspect_ratio.

AspectRatioType dirac::SourceParams::AspectRatioIndex | ( |  | ) | const`[inline]`

References m_asr_idx.

unsigned int dirac::SourceParams::CleanWidth | ( |  | ) | const`[inline]`

References m_clean_width.

unsigned int dirac::SourceParams::CleanHeight | ( |  | ) | const`[inline]`

References m_clean_height.

unsigned int dirac::SourceParams::LeftOffset | ( |  | ) | const`[inline]`

References m_left_offset.

unsigned int dirac::SourceParams::TopOffset | ( |  | ) | const`[inline]`

References m_top_offset.

SignalRangeType dirac::SourceParams::SignalRangeIndex | ( |  | ) | const`[inline]`

References m_sr_idx.

unsigned int dirac::SourceParams::LumaOffset | ( |  | ) | const`[inline]`

References m_luma_offset.

unsigned int dirac::SourceParams::LumaExcursion | ( |  | ) | const`[inline]`

References m_luma_excursion.

unsigned int dirac::SourceParams::ChromaOffset | ( |  | ) | const`[inline]`

References m_chroma_offset.

unsigned int dirac::SourceParams::ChromaExcursion | ( |  | ) | const`[inline]`

References m_chroma_excursion.

unsigned int dirac::SourceParams::ColourSpecificationIndex | ( |  | ) | const`[inline]`

References m_cs_idx.

ColourPrimaries dirac::SourceParams::ColourPrimariesIndex | ( |  | ) | const`[inline]`

References m_col_primary.

ColourMatrix dirac::SourceParams::ColourMatrixIndex | ( |  | ) | const`[inline]`

References m_col_matrix.

TransferFunction dirac::SourceParams::TransferFunctionIndex | ( |  | ) | const`[inline]`

References m_transfer_func.

void dirac::SourceParams::SetInterlace | ( | bool | interlace | ) | `[inline]`

References m_interlace.

void dirac::SourceParams::SetTopFieldFirst | ( | bool | tff | ) | `[inline]`

References m_topfieldfirst.

void dirac::SourceParams::SetSequentialFields | ( | bool | seq_flds | ) | `[inline]`

References m_seq_fields.

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::SetAspectRatio | ( | const Rational & | asr | ) | `[inline]`

References ASPECT_RATIO_CUSTOM, m_aspect_ratio, and m_asr_idx.

void dirac::SourceParams::SetAspectRatio | ( | unsigned int | as_num,
|  | unsigned int | as_denom |
| ) |  |  | `[inline]`

References ASPECT_RATIO_CUSTOM, m_aspect_ratio, m_asr_idx, dirac::Rational::m_denom, and dirac::Rational::m_num.

void dirac::SourceParams::SetAspectRatio | ( | AspectRatioType | aspect_ratio | ) |

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

References m_clean_width.

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

References m_clean_height.

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

References m_left_offset.

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

References m_top_offset.

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

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

References m_luma_offset, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

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

References m_luma_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::SetChromaExcursion | ( | unsigned int | chroma_exc | ) | `[inline]`

References m_chroma_excursion, m_sr_idx, and SIGNAL_RANGE_CUSTOM.

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

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

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

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

## Member Data Documentation

bool dirac::SourceParams::m_interlace`[private]`

Referenced by Interlace(), and SetInterlace().

bool dirac::SourceParams::m_topfieldfirst`[private]`

Referenced by SetTopFieldFirst(), and TopFieldFirst().

bool dirac::SourceParams::m_seq_fields`[private]`

Referenced by SequentialFields(), and SetSequentialFields().

FrameRateType dirac::SourceParams::m_fr_idx`[private]`

Referenced by FrameRateIndex(), and SetFrameRate().

Rational dirac::SourceParams::m_framerate`[private]`

Referenced by FrameRate(), and SetFrameRate().

AspectRatioType dirac::SourceParams::m_asr_idx`[private]`

Referenced by AspectRatioIndex(), and SetAspectRatio().

Rational dirac::SourceParams::m_aspect_ratio`[private]`

Referenced by AspectRatio(), and SetAspectRatio().

unsigned int dirac::SourceParams::m_clean_width`[private]`

Referenced by CleanWidth(), and SetCleanWidth().

unsigned int dirac::SourceParams::m_clean_height`[private]`

Referenced by CleanHeight(), and SetCleanHeight().

unsigned int dirac::SourceParams::m_left_offset`[private]`

Referenced by LeftOffset(), and SetLeftOffset().

unsigned int dirac::SourceParams::m_top_offset`[private]`

Referenced by SetTopOffset(), and TopOffset().

SignalRangeType dirac::SourceParams::m_sr_idx`[private]`

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

unsigned int dirac::SourceParams::m_luma_offset`[private]`

Referenced by LumaOffset(), and SetLumaOffset().

unsigned int dirac::SourceParams::m_luma_excursion`[private]`

Referenced by LumaExcursion(), and SetLumaExcursion().

unsigned int dirac::SourceParams::m_chroma_offset`[private]`

Referenced by ChromaOffset(), and SetChromaOffset().

unsigned int dirac::SourceParams::m_chroma_excursion`[private]`

Referenced by ChromaExcursion(), and SetChromaExcursion().

unsigned int dirac::SourceParams::m_cs_idx`[private]`

Referenced by ColourSpecificationIndex().

ColourPrimaries dirac::SourceParams::m_col_primary`[private]`

Referenced by ColourPrimariesIndex().

ColourMatrix dirac::SourceParams::m_col_matrix`[private]`

Referenced by ColourMatrixIndex().

TransferFunction dirac::SourceParams::m_transfer_func`[private]`

Referenced by TransferFunctionIndex().

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.