# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::QuantChooser Class Reference

Choose a quantiser. More...

`#include <quant_chooser.h>`

Collaboration diagram for dirac::QuantChooser:

[legend]

List of all members.

## Public Member Functions

- QuantChooser (const PicArray &pic_data, const float lambda)
    Constructor.
- int GetBestQuant (Subband &node)
    Finds the best quantisers for the subband, returning the predicted number of bits needed.
- void SetEntropyCorrection (const float ecfac)
    Sets the factor used for correcting the entropy calculation.

## Private Member Functions

- QuantChooser (const QuantChooser &cpy)
    Copy constructor is private and body-less. This class should not be copied.
- QuantChooser & operator= (const QuantChooser &rhs)
    Assignment = is private and body-less. This class should not be assigned.
- void IntegralErrorCalc (const CodeBlock &code_block, const int block_idx, const int xratio, const int yratio)
    Calculate errors and entropies for integral-bit quantisers on a block of coeffs.
- void NonIntegralErrorCalc (const CodeBlock &code_block, const int block_idx, const int xratio, const int yratio)
    Calculate errors and entropies for non-integral-bit quantisers on a block of coeffs.
- void LagrangianCalc (const CodeBlock &code_block, const int block_idx)
    Having got statistics, calculate the Lagrangian costs.
- void SelectBestQuant ()
    Select the best quantisation index for a whole subband on the basis of the Lagrangian calculations.
- void SelectBestQuant (const int block_idx)
    Select the best quantisation index for a code block on the basis of the Lagrangian calculations.
- ValueType BlockAbsMax (const CodeBlock &code_block)
    Find the absolute max value in the block under consideration.

## Private Attributes

- int m_bottom_idx
    The smallest quantisation index being tested.
- int m_top_idx
    The largest quantisation index being tested.
- int m_index_step
    The step we use in jumping through the list of quantisers.
- int m_min_idx
    The index of the quantiser with the lowest cost.
- const PicArray & m_pic_data
    A local reference to the data under consideration.
- const float m_lambda
    The lambda value to be used in the Lagrangian calculation.
- float m_entropy_correctionfactor
    A value for correcting the crude calculation of the entropy.
- TwoDArray< int > m_count0
    An array used to count the number of zeroes.
- OneDArray< int > m_count1
    An array used to count the number of ones.
- TwoDArray< int > m_countPOS
    An array used to count the number of positive values.
- TwoDArray< int > m_countNEG
    An array used to count the number of negative values.
- TwoDArray< double > m_error_total
    An array used to collate the sum of the perceptually-weighted errors.
- TwoDArray< CostType > m_costs
    An array used to collate the computed costs.

## Detailed Description

This class chooses a quantiser or quantisers for a subband

## Constructor & Destructor Documentation

dirac::QuantChooser::QuantChooser | ( | const PicArray & | pic_data,
|  | const float | lambda |
| ) |  |  |

dirac::QuantChooser::QuantChooser | ( | const QuantChooser & | cpy | ) | `[private]`

## Member Function Documentation

int dirac::QuantChooser::GetBestQuant | ( | Subband & | node | ) |

void dirac::QuantChooser::SetEntropyCorrection | ( | const float | ecfac | ) | `[inline]`

References m_entropy_correctionfactor.

QuantChooser& dirac::QuantChooser::operator= | ( | const QuantChooser & | rhs | ) | `[private]`

void dirac::QuantChooser::IntegralErrorCalc | ( | const CodeBlock & | code_block,
|  | const int | block_idx,
|  | const int | xratio,
|  | const int | yratio |
| ) |  |  | `[private]`

void dirac::QuantChooser::NonIntegralErrorCalc | ( | const CodeBlock & | code_block,
|  | const int | block_idx,
|  | const int | xratio,
|  | const int | yratio |
| ) |  |  | `[private]`

void dirac::QuantChooser::LagrangianCalc | ( | const CodeBlock & | code_block,
|  | const int | block_idx |
| ) |  |  | `[private]`

void dirac::QuantChooser::SelectBestQuant | ( |  | ) | `[private]`

void dirac::QuantChooser::SelectBestQuant | ( | const int | block_idx | ) | `[private]`

ValueType dirac::QuantChooser::BlockAbsMax | ( | const CodeBlock & | code_block | ) | `[private]`

## Member Data Documentation

int dirac::QuantChooser::m_bottom_idx `[private]`

int dirac::QuantChooser::m_top_idx `[private]`

int dirac::QuantChooser::m_index_step `[private]`

int dirac::QuantChooser::m_min_idx `[private]`

const PicArray& dirac::QuantChooser::m_pic_data `[private]`

const float dirac::QuantChooser::m_lambda `[private]`

float dirac::QuantChooser::m_entropy_correctionfactor `[private]`

Referenced by SetEntropyCorrection().

TwoDArray<int> dirac::QuantChooser::m_count0 `[private]`

OneDArray<int> dirac::QuantChooser::m_count1 `[private]`

TwoDArray<int> dirac::QuantChooser::m_countPOS `[private]`

TwoDArray<int> dirac::QuantChooser::m_countNEG `[private]`

TwoDArray<double> dirac::QuantChooser::m_error_total `[private]`

TwoDArray<CostType> dirac::QuantChooser::m_costs `[private]`

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

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