# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

Public Member Functions | Private Member Functions | Private Attributes | List of all members
dirac::QuantChooser Class Reference

Choose a quantiser. More...

`#include <quant_chooser.h>`

Collaboration diagram for dirac::QuantChooser:
[legend]

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

## Private Member Functions
| QuantChooser (const QuantChooser &cpy)
| Copy constructor is private and body-less. This class should not be copied. More...
QuantChooser & | operator= (const QuantChooser &rhs)
| Assignment = is private and body-less. This class should not be assigned. More...
void | IntegralErrorCalc (Subband &node, const int xratio, const int yratio)
| Calculate errors and entropies for integral-bit quantisers. More...
void | NonIntegralErrorCalc (Subband &node, const int xratio, const int yratio)
| Calculate errors and entropies for non-integral-bit quantisers. More...
void | LagrangianCalc ()
| Having got statistics, calculate the Lagrangian costs. More...
void | SelectBestQuant ()
| Select the best quantisation index on the basis of the Lagrangian calculations. More...
CoeffType | BlockAbsMax (const Subband &node)
void | SetSkip (CodeBlock &cblock, const int qidx)
| Set the skip flag for a codeblock. More...

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

## Detailed Description

This class chooses a quantiser or quantisers for a subband

## Constructor & Destructor Documentation

## ◆ QuantChooser() [1/2]

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

## ◆ QuantChooser() [2/2]

dirac::QuantChooser::QuantChooser | ( | const QuantChooser & | cpy | ) |
| private

## Member Function Documentation

## ◆ BlockAbsMax()

CoeffType dirac::QuantChooser::BlockAbsMax | ( | const Subband & | node | ) |
| private

## ◆ GetBestQuant()

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

## ◆ IntegralErrorCalc()

void dirac::QuantChooser::IntegralErrorCalc | ( | Subband & | node,
|  | const int | xratio,
|  | const int | yratio
| ) |  |
| private

## ◆ LagrangianCalc()

void dirac::QuantChooser::LagrangianCalc | ( |  | ) |
| private

## ◆ NonIntegralErrorCalc()

void dirac::QuantChooser::NonIntegralErrorCalc | ( | Subband & | node,
|  | const int | xratio,
|  | const int | yratio
| ) |  |
| private

## ◆ operator=()

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

## ◆ SelectBestQuant()

void dirac::QuantChooser::SelectBestQuant | ( |  | ) |
| private

## ◆ SetEntropyCorrection()

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

References m_entropy_correctionfactor.

## ◆ SetSkip()

void dirac::QuantChooser::SetSkip | ( | CodeBlock & | cblock,
|  | const int | qidx
| ) |  |
| private

## Member Data Documentation

## ◆ m_bottom_idx

int dirac::QuantChooser::m_bottom_idx
| private

## ◆ m_coeff_data

const CoeffArray& dirac::QuantChooser::m_coeff_data
| private

## ◆ m_costs

OneDArray<CostType> dirac::QuantChooser::m_costs
| private

## ◆ m_count0

OneDArray<int> dirac::QuantChooser::m_count0
| private

## ◆ m_count1

int dirac::QuantChooser::m_count1
| private

## ◆ m_countNEG

OneDArray<int> dirac::QuantChooser::m_countNEG
| private

## ◆ m_countPOS

OneDArray<int> dirac::QuantChooser::m_countPOS
| private

## ◆ m_entropy_correctionfactor

float dirac::QuantChooser::m_entropy_correctionfactor
| private

Referenced by SetEntropyCorrection().

## ◆ m_error_total

OneDArray<double> dirac::QuantChooser::m_error_total
| private

## ◆ m_index_step

int dirac::QuantChooser::m_index_step
| private

## ◆ m_lambda

const float dirac::QuantChooser::m_lambda
| private

## ◆ m_min_idx

int dirac::QuantChooser::m_min_idx
| private

## ◆ m_subband_wt

float dirac::QuantChooser::m_subband_wt
| private

## ◆ m_top_idx

int dirac::QuantChooser::m_top_idx
| 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.