Dirac - A Video Codec

Created by the British Broadcasting Corporation.


picture_compress.h
Go to the documentation of this file.
1/* ***** BEGIN LICENSE BLOCK *****
2*
3* $Id: picture_compress.h,v 1.7 2008/08/14 02:30:50 asuraparaju Exp $ $Name: Dirac_1_0_2 $
4*
5* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6*
7* The contents of this file are subject to the Mozilla Public License
8* Version 1.1 (the "License"); you may not use this file except in compliance
9* with the License. You may obtain a copy of the License at
10* http://www.mozilla.org/MPL/
11*
12* Software distributed under the License is distributed on an "AS IS" basis,
13* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14* the specific language governing rights and limitations under the License.
15*
16* The Original Code is BBC Research and Development code.
17*
18* The Initial Developer of the Original Code is the British Broadcasting
19* Corporation.
20* Portions created by the Initial Developer are Copyright (C) 2004.
21* All Rights Reserved.
22*
23* Contributor(s): Thomas Davies (Original Author),
24* Scott R Ladd,
25* Anuradha Suraparaju
26* Andrew Kennedy
27*
28* Alternatively, the contents of this file may be used under the terms of
29* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
30* Public License Version 2.1 (the "LGPL"), in which case the provisions of
31* the GPL or the LGPL are applicable instead of those above. If you wish to
32* allow use of your version of this file only under the terms of the either
33* the GPL or LGPL and not to allow others to use your version of this file
34* under the MPL, indicate your decision by deleting the provisions above
35* and replace them with the notice and other provisions required by the GPL
36* or LGPL. If you do not delete the provisions above, a recipient may use
37* your version of this file under the terms of any one of the MPL, the GPL
38* or the LGPL.
39* ***** END LICENSE BLOCK ***** */
40
41
42#ifndef _PICTURE_COMPRESS_H_
43#define _PICTURE_COMPRESS_H_
44
49
50namespace dirac
51{
52
53 class MvData;
54
56
62 {
63 public:
65
72
75
77 void PixelME( EncQueue& my_buffer , int pnum );
78
80 void CalcComplexity( EncQueue& my_buffer, int pnum , const OLBParams& olbparams );
81 void CalcComplexity2( EncQueue& my_buffer, int pnum );
82
84 void NormaliseComplexity( EncQueue& my_buffer, int pnum );
85
87 void SubPixelME( EncQueue& my_buffer , int pnum );
88
90 void ModeDecisionME( EncQueue& my_buffer, int pnum );
91
93 void IntraModeAnalyse( EncQueue& my_buffer, int pnum );
94
96 void MotionCompensate( EncQueue& my_buffer, int pnum, AddOrSub dirn );
97
99 void Prefilter( EncQueue& my_buffer, int pnum );
100
102 void DoDWT( EncQueue& my_buffer , int pnum, Direction dirn );
103
105
111 void CodeResidue( EncQueue& my_pbuffer , int pnum , PictureByteIO* pic_byteio);
112
114 void CodeMVData( EncQueue& my_buffer, int pnum, PictureByteIO* pic_byteio);
115
117 bool IsSkipped(){ return m_skipped; }
118
120 bool IsMEDataAvail() const { return m_medata_avail; }
121
123 const MEData* GetMEData() const;
124
125 private:
127
132
134
139
141 void InitCoeffData( CoeffArray& coeff_data, const int xl, const int yl );
142
144 float GetCompLambda( const EncPicture& my_picture,
145 const CompSort csort );
146
147 void SelectQuantisers( CoeffArray& coeff_data ,
148 SubbandList& bands ,
149 const float lambda,
150 OneDArray<unsigned int>& est_counts,
151 const CodeBlockMode cb_mode,
152 const PictureParams& pp,
153 const CompSort csort );
154
155 int SelectMultiQuants( CoeffArray& coeff_data ,
156 SubbandList& bands ,
157 const int band_num,
158 const float lambda,
159 const PictureParams& pp,
160 const CompSort csort );
161
163
164
165 void AddSubAverage(CoeffArray& coeff_data,int xl,int yl,AddOrSub dirn);
166
167 private:
168
169 //member variables
170 // a local copy of the encoder params
172
173 // True if the picture has been skipped, false otherwise
175
176 // True if we use global motion vectors, false otherwise
178
179 // True if we use block motion vectors, false otherwise
181
182 // Prediction mode to use if we only have global motion vectors
184
185 // A pointer to the current picture motion vector data
187
188 // True if motion estimation data is available
190
191 // True if we have detected a cut
193
194 // The original MV precision type
196
197 };
198
199} // namespace dirac
200
201#endif
MVPrecisionType
Definition: common_types.h:189
CodeBlockMode
Definition: common_types.h:199
Definition of class SequenceHeaderByteIO.
Definition: accessunit_byteio.h:52
CompSort
Types of picture component.
Definition: common.h:87
AddOrSub
Addition or subtraction.
Definition: common.h:90
PredMode
Prediction modes for blocks.
Definition: common.h:84
Direction
Forward or backward.
Definition: common.h:93
A compressed picture in Dirac bytestream format.
Definition: picture_byteio.h:61
A template class for one-dimensional arrays.
Definition: arrays.h:90
Parameters for initialising picture class objects.
Definition: common.h:533
Parameters for overlapped block motion compensation.
Definition: common.h:818
Parameters for the encoding process.
Definition: common.h:1280
Class for all the motion estimation data.
Definition: motion.h:314
A class encapulating all the subbands produced by a transform.
Definition: wavelet_utils.h:280
A class for wavelet coefficient data.
Definition: wavelet_utils.h:623
Definition: enc_picture.h:65
Holds pictures both for reference and to overcome reordering delay.
Definition: enc_queue.h:59
Compress a single image picture.
Definition: picture_compress.h:62
PredMode m_global_pred_mode
Definition: picture_compress.h:183
bool IsMEDataAvail() const
Returns true if Motion estimation data is available.
Definition: picture_compress.h:120
bool IsSkipped()
Returns true if the picture has been skipped rather than coded normally.
Definition: picture_compress.h:117
bool m_skipped
Definition: picture_compress.h:174
~PictureCompressor()
Destructor.
int SelectMultiQuants(CoeffArray &coeff_data, SubbandList &bands, const int band_num, const float lambda, const PictureParams &pp, const CompSort csort)
bool m_use_global
Definition: picture_compress.h:177
void DoDWT(EncQueue &my_buffer, int pnum, Direction dirn)
Do the DWT on a given picture.
float GetCompLambda(const EncPicture &my_picture, const CompSort csort)
Returns the value lambda according to picture and component type.
void NormaliseComplexity(EncQueue &my_buffer, int pnum)
Normalise picture complexity with respect to others in the queue.
const MEData * GetMEData() const
Returns the motion estimation data.
void SubPixelME(EncQueue &my_buffer, int pnum)
Do subpixel accurate motion vector refinement.
void CalcComplexity2(EncQueue &my_buffer, int pnum)
void InitCoeffData(CoeffArray &coeff_data, const int xl, const int yl)
Initialise the coefficient data array for holding wavelet coefficients.
MEData * m_me_data
Definition: picture_compress.h:186
EncoderParams & m_encparams
Definition: picture_compress.h:171
void ModeDecisionME(EncQueue &my_buffer, int pnum)
Do mode decision based on sub-pel vectors.
PictureCompressor(EncoderParams &encp)
Constructor.
void SetupCodeBlocks(SubbandList &bands)
void CodeResidue(EncQueue &my_pbuffer, int pnum, PictureByteIO *pic_byteio)
Compress a specific picture within a group of pictures (GOP)
void IntraModeAnalyse(EncQueue &my_buffer, int pnum)
Detect cuts in the current picture.
bool m_is_a_cut
Definition: picture_compress.h:192
PictureCompressor & operator=(const PictureCompressor &rhs)
Assignment = is private and body-less.
PictureCompressor(const PictureCompressor &cpy)
Copy constructor is private and body-less.
void PixelME(EncQueue &my_buffer, int pnum)
Do pixel accurate motion estimate.
void CodeMVData(EncQueue &my_buffer, int pnum, PictureByteIO *pic_byteio)
Compresses the motion vector data.
bool m_use_block_mv
Definition: picture_compress.h:180
void CalcComplexity(EncQueue &my_buffer, int pnum, const OLBParams &olbparams)
Calculate the complexity of a picture.
void MotionCompensate(EncQueue &my_buffer, int pnum, AddOrSub dirn)
Does motion compensation on picture pnum (forward or backward)
bool m_medata_avail
Definition: picture_compress.h:189
void Prefilter(EncQueue &my_buffer, int pnum)
Prefilter if required.
MVPrecisionType m_orig_prec
Definition: picture_compress.h:195
void SelectQuantisers(CoeffArray &coeff_data, SubbandList &bands, const float lambda, OneDArray< unsigned int > &est_counts, const CodeBlockMode cb_mode, const PictureParams &pp, const CompSort csort)
void AddSubAverage(CoeffArray &coeff_data, int xl, int yl, AddOrSub dirn)

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