Dirac - A Video Codec

Created by the British Broadcasting Corporation.


enc_picture.h
Go to the documentation of this file.
1/* ***** BEGIN LICENSE BLOCK *****
2*
3* $Id: enc_picture.h,v 1.6 2008/10/01 01:26:47 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) 2008.
21* All Rights Reserved.
22*
23* Contributor(s): Thomas Davies (Original Author),
24*
25* Alternatively, the contents of this file may be used under the terms of
26* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
27* Public License Version 2.1 (the "LGPL"), in which case the provisions of
28* the GPL or the LGPL are applicable instead of those above. If you wish to
29* allow use of your version of this file only under the terms of the either
30* the GPL or LGPL and not to allow others to use your version of this file
31* under the MPL, indicate your decision by deleting the provisions above
32* and replace them with the notice and other provisions required by the GPL
33* or LGPL. If you do not delete the provisions above, a recipient may use
34* your version of this file under the terms of any one of the MPL, the GPL
35* or the LGPL.
36* ***** END LICENSE BLOCK ***** */
37
38#ifndef _ENC_PICTURE_H_
39#define _ENC_PICTURE_H_
40
43
44
45namespace dirac
46{
47static const unsigned int DONE_ME_INIT = 0x1;
48static const unsigned int DONE_PEL_ME = 0x2;
49static const unsigned int DONE_SUBPEL_ME = 0x4;
50static const unsigned int DONE_ME_MODE_DECN = 0x8;
51static const unsigned int DONE_MV_CODING = 0x10;
52static const unsigned int DONE_MC = 0x20;
53static const unsigned int DONE_DWT = 0x40;
54static const unsigned int DONE_QUANT_SEL = 0x80;
55static const unsigned int DONE_RES_CODING = 0x100;
56static const unsigned int DONE_IDWT = 0x200;
57static const unsigned int DONE_MC_BACK = 0x400;
58static const unsigned int DONE_SET_PTYPE = 0x800;
59static const unsigned int DONE_PIC_COMPLEXITY = 0x1000;
60
61static const unsigned int ALL_ENC = 0xFFFFFFFF;
62static const unsigned int NO_ENC = 0;
63
64class EncPicture : public Picture
65{
66public:
68
69 virtual ~EncPicture();
70
72 void InitMEData( const PicturePredParams& predparams, const int num_refs);
73
76
78 const MEData& GetMEData() const { return *m_me_data;}
79
81 void DropRef( int rindex );
82
83
85 const PicArray& OrigData(CompSort c) const { return *m_orig_data[(int) c];}
86
88 const PicArray& UpOrigData(CompSort cs) const;
89
92
94 const PicArray& DataForME(bool combined_me) const;
95
97 const PicArray& UpDataForME(bool combined_me) const;
98
99
100 void UpdateStatus( const unsigned int mask ){ m_status |= mask; }
101
102 void FlipStatus( const unsigned int mask){ m_status ^= mask; }
103
104 void SetStatus( const int status ){ m_status = status; }
105
106 unsigned int GetStatus() const{ return m_status; }
107
108
109 double GetComplexity() const {return m_complexity; }
110
111 void SetComplexity(double c){ m_complexity = c; }
112
113 double GetNormComplexity() const { return m_norm_complexity; }
114
115 void SetNormComplexity( double c ){ m_norm_complexity = c; }
116
117 double GetPredBias() const { return m_pred_bias; }
118
119 void SetPredBias( double b ){ m_pred_bias = b; }
120
121
122private:
123
124 virtual void ClearData();
125
127 void AntiAliasFilter( PicArray& out_data, const PicArray& in_data ) const;
128
130 const PicArray& FiltData(CompSort c) const;
131
132 const PicArray& CombinedData() const;
133 const PicArray& UpCombinedData() const;
134 void Combine( PicArray& comb_data, const PicArray& y_data,
135 const PicArray& u_data, const PicArray& v_data ) const;
136
138 const PicArray& UpFiltData(CompSort c) const;
139
140
141 void SetOrigData(const int c);
142
143private:
144
149
151
152 unsigned int m_status;
153
156
158};
159
160
161}
162
163#endif
Definition of class SequenceHeaderByteIO.
Definition accessunit_byteio.h:52
CompSort
Types of picture component.
Definition common.h:87
Parameters for initialising picture class objects.
Definition common.h:533
A class for picture component data.
Definition common.h:719
Structure to hold motion parameters when motion comp is used.
Definition common.h:968
Class for all the motion estimation data.
Definition motion.h:314
Picture(const PictureParams &pp)
Constructor.
double GetComplexity() const
Definition enc_picture.h:109
void DropRef(int rindex)
Drops a reference from the motion vector data.
PicArray * m_orig_up_data[3]
Definition enc_picture.h:146
double m_norm_complexity
Definition enc_picture.h:155
void InitMEData(const PicturePredParams &predparams, const int num_refs)
Initialise the motion estimation data arrays.
const PicArray & OrigData(CompSort c) const
Returns a given component of the original data.
Definition enc_picture.h:85
PicArray * m_filt_data[3]
Definition enc_picture.h:147
void SetOrigData(const int c)
const PicArray & UpCombinedData() const
MEData & GetMEData()
Returns the motion data.
Definition enc_picture.h:75
void UpdateStatus(const unsigned int mask)
Definition enc_picture.h:100
const PicArray & UpOrigData(CompSort cs) const
Returns a given upconverted component of the original data.
unsigned int GetStatus() const
Definition enc_picture.h:106
void SetComplexity(double c)
Definition enc_picture.h:111
virtual void ClearData()
Delete all the data.
unsigned int m_status
Definition enc_picture.h:152
double GetNormComplexity() const
Definition enc_picture.h:113
const PicArray & DataForME(bool combined_me) const
Returns a version of the picture data suitable for motion estimation.
void SetPredBias(double b)
Definition enc_picture.h:119
void SetNormComplexity(double c)
Definition enc_picture.h:115
double m_pred_bias
Definition enc_picture.h:157
void FlipStatus(const unsigned int mask)
Definition enc_picture.h:102
MEData * m_me_data
Definition enc_picture.h:150
void SetOrigData()
Initialises a copy of the data arrays into the original data.
const MEData & GetMEData() const
Returns the motion data.
Definition enc_picture.h:78
const PicArray & UpDataForME(bool combined_me) const
Returns a version of the picture data suitable for subpel motion estimation.
const PicArray & FiltData(CompSort c) const
Returns an anti-aliased version of the original data.
PicArray * m_orig_data[3]
Definition enc_picture.h:145
void SetStatus(const int status)
Definition enc_picture.h:104
const PicArray & UpFiltData(CompSort c) const
Returns an upconverted anti-aliased version of the original data.
double m_complexity
Definition enc_picture.h:154
PicArray * m_filt_up_data[3]
Definition enc_picture.h:148
EncPicture(const PictureParams &pp)
virtual ~EncPicture()
const PicArray & CombinedData() const
void Combine(PicArray &comb_data, const PicArray &y_data, const PicArray &u_data, const PicArray &v_data) const
double GetPredBias() const
Definition enc_picture.h:117
void AntiAliasFilter(PicArray &out_data, const PicArray &in_data) const
Filters a (field) picture vertically to reduce aliasing for motion estimation purposes.

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