Dirac - A Video Codec

Created by the British Broadcasting Corporation.


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

A clas for allocation the bits to each and every types of frames in a GOP.

#include <rate_control.h>

Collaboration diagram for dirac::RateController:
Collaboration graph
[legend]

Public Member Functions

 RateController (int trate, SourceParams &srcp, EncoderParams &encp)
 Default constructor. More...
 
void CalcNextQualFactor (const PictureParams &fparams, int num_bits)
 Calculate the Quality factor of the next frame to encode. More...
 
void CalcNextIntraQualFactor ()
 Calculate the Quality factor of the next I frame to encode. More...
 
void SetCutPictureQualFactor ()
 Use the long-term average intra quality factor. More...
 
double IntraQualFactor ()
 Return I frame qf. More...
 
double QualFactor ()
 Return qf. More...
 
void Report ()
 Report the allocation to picture types. More...
 

Private Member Functions

double TargetSubgroupRate ()
 
double ProjectedSubgroupRate ()
 
void Allocate (const int fnum)
 Allocate the bits to each type of frame in a GOP. More...
 
void CalcTotalBits (const SourceParams &sourceparams)
 Calculate the total number of bits in a GOP. More...
 
void SetIntraQualFactor (double value)
 Set the value of Current IQF. More...
 
void SetFrameDistribution ()
 Set the number of I, L1 and L2 frames in the GOP. More...
 
float ReviewQualityFactor (const float qfac, const long int num_bits)
 Review the quality factor to make sure it's being set sensibly. More...
 
float ClipQualityFactor (const float qfac)
 Clip the quality factor to something sensible. More...
 
void UpdateBuffer (const long int num_bits)
 Update the internal decoder buffer model. More...
 

Private Attributes

double m_qf
 Current Quality Factor. More...
 
double m_I_qf
 I frame Quality Factor. More...
 
double m_I_qf_long_term
 Long-term average of I frame Quality Factor. More...
 
const int m_target_rate
 Target bit rate in kbps. More...
 
long int m_Iframe_bits
 Number of bits for I frame. More...
 
long int m_L1frame_bits
 Number of bits for L1 frame. More...
 
long int m_L2frame_bits
 Number of bits for L2 frame. More...
 
int m_num_Iframe
 Number of I frames. More...
 
int m_num_L1frame
 Number of L1 frames. More...
 
int m_num_L2frame
 Number of L2 frames. More...
 
long int m_total_GOP_bits
 Total Number of bits in a GOP. More...
 
long int m_picture_bits
 Mean number of bits in a picture. More...
 
const long int m_buffer_size
 Size of the decoded bit buffer. More...
 
long int m_buffer_bits
 Number of bits in the buffer. More...
 
long int m_old_buffer_bits
 The old buffer occupancy. More...
 
double m_buffer_rate_of_change
 The rate of change of buffer occupancy. More...
 
long int m_GOP_target
 The target number of bits for the current GOP. More...
 
double m_GOP_duration
 The duration of a GOP. More...
 
EncoderParamsm_encparams
 A reference to the encoder parameters. More...
 
FrameComplexity m_frame_complexity
 A class to hold the frame complexity object. More...
 
int m_fcount
 A frame counter, giving the position within a subgroup. More...
 
bool m_intra_only
 
int m_L2_complexity_sum
 

Constructor & Destructor Documentation

◆ RateController()

dirac::RateController::RateController ( int  trate,
SourceParams srcp,
EncoderParams encp 
)

Member Function Documentation

◆ Allocate()

void dirac::RateController::Allocate ( const int  fnum)
private

◆ CalcNextIntraQualFactor()

void dirac::RateController::CalcNextIntraQualFactor ( )

◆ CalcNextQualFactor()

void dirac::RateController::CalcNextQualFactor ( const PictureParams fparams,
int  num_bits 
)

◆ CalcTotalBits()

void dirac::RateController::CalcTotalBits ( const SourceParams sourceparams)
private

◆ ClipQualityFactor()

float dirac::RateController::ClipQualityFactor ( const float  qfac)
private

◆ IntraQualFactor()

double dirac::RateController::IntraQualFactor ( )
inline

References m_I_qf.

◆ ProjectedSubgroupRate()

double dirac::RateController::ProjectedSubgroupRate ( )
private

◆ QualFactor()

double dirac::RateController::QualFactor ( )
inline

References m_qf.

◆ Report()

void dirac::RateController::Report ( )

◆ ReviewQualityFactor()

float dirac::RateController::ReviewQualityFactor ( const float  qfac,
const long int  num_bits 
)
private

◆ SetCutPictureQualFactor()

void dirac::RateController::SetCutPictureQualFactor ( )

◆ SetFrameDistribution()

void dirac::RateController::SetFrameDistribution ( )
private

◆ SetIntraQualFactor()

void dirac::RateController::SetIntraQualFactor ( double  value)
inlineprivate

References m_I_qf.

◆ TargetSubgroupRate()

double dirac::RateController::TargetSubgroupRate ( )
private

◆ UpdateBuffer()

void dirac::RateController::UpdateBuffer ( const long int  num_bits)
private

Member Data Documentation

◆ m_buffer_bits

long int dirac::RateController::m_buffer_bits
private

◆ m_buffer_rate_of_change

double dirac::RateController::m_buffer_rate_of_change
private

◆ m_buffer_size

const long int dirac::RateController::m_buffer_size
private

◆ m_encparams

EncoderParams& dirac::RateController::m_encparams
private

◆ m_fcount

int dirac::RateController::m_fcount
private

◆ m_frame_complexity

FrameComplexity dirac::RateController::m_frame_complexity
private

◆ m_GOP_duration

double dirac::RateController::m_GOP_duration
private

◆ m_GOP_target

long int dirac::RateController::m_GOP_target
private

◆ m_I_qf

double dirac::RateController::m_I_qf
private

◆ m_I_qf_long_term

double dirac::RateController::m_I_qf_long_term
private

◆ m_Iframe_bits

long int dirac::RateController::m_Iframe_bits
private

◆ m_intra_only

bool dirac::RateController::m_intra_only
private

◆ m_L1frame_bits

long int dirac::RateController::m_L1frame_bits
private

◆ m_L2_complexity_sum

int dirac::RateController::m_L2_complexity_sum
private

◆ m_L2frame_bits

long int dirac::RateController::m_L2frame_bits
private

◆ m_num_Iframe

int dirac::RateController::m_num_Iframe
private

◆ m_num_L1frame

int dirac::RateController::m_num_L1frame
private

◆ m_num_L2frame

int dirac::RateController::m_num_L2frame
private

◆ m_old_buffer_bits

long int dirac::RateController::m_old_buffer_bits
private

◆ m_picture_bits

long int dirac::RateController::m_picture_bits
private

◆ m_qf

double dirac::RateController::m_qf
private

Referenced by QualFactor().

◆ m_target_rate

const int dirac::RateController::m_target_rate
private

◆ m_total_GOP_bits

long int dirac::RateController::m_total_GOP_bits
private

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

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