Dirac - A Video Codec

Created by the British Broadcasting Corporation.


overlay.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2 *
3 * $Id: overlay.h,v 1.7 2008/03/14 08:17:37 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): Chris Bowley (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 __OVERLAY_H__
39 #define __OVERLAY_H__
40 
41 
42 #include <libdirac_common/common.h>
43 #include <libdirac_common/motion.h>
52 
53 using dirac::MEData;
54 using dirac::OLBParams;
55 
56 namespace dirac_instr
57 {
58 #define NO_REF -1
59 
62  {
67  };
68 
71  {
72  public:
73 
75  // //
76  // Assumes default constructor, copy constructor //
77  // and assignment = //
78  // //
80 
83  OverlayOption Option() const {return m_option;}
84 
86  int Reference() const {return m_ref;}
87 
89  int Background() const {return m_bg;}
90 
92  int Legend() const {return m_legend;}
93 
95  int MvClip() const {return m_mv_clip;}
96 
98  int SADClip() const {return m_sad_clip;}
99 
103 
105  void SetReference(int r) {m_ref=r;}
106 
108  void SetBackground(bool b) {m_bg=b;}
109 
111  void SetLegend(bool l) {m_legend=l;}
112 
114  void SetMvClip(int c) {m_mv_clip=c;}
115 
117  void SetSADClip(int c) {m_sad_clip=c;}
118 
119  private:
122 
124  int m_ref;
125 
127  bool m_bg;
128 
130  bool m_legend;
131 
134 
137  };
138 
140  class Overlay
141  {
142  public:
145 
148 
150  // //
151  // Assumes default copy constructor and assignment = //
152  // //
154 
155  void ProcessPicture(const MEData &, const OLBParams &);
156 
158 
159  private:
160 
162  /*
163  Main overlay is carried out on a motion vector block by block basis
164  */
165  void DoOverlay(const MEData &);
166 
168  /*
169  Difference picture formats use different chroma resolutions with
170  respect to luma
171  */
173 
175  /*
176  Pictures must have an integer number of macroblocks, more
177  macroblocks may have been used during encoding and hence the picture
178  must be padded now in order for the correct macroblock (and motion
179  vector block) size to be calculated
180  */
181  void PadPicture(const MEData &);
182 
185 
188 
190  int m_ref;
191 
194 
197 
200  };
201 
202 } // namespace dirac_instr
203 
204 #endif
205 
ChromaFormat
Definition: common_types.h:58
TwoDArray< MVector > MvArray
MvArray is a two-D array of MVectors.
Definition: motion.h:186
Definition: draw_overlay.h:51
OverlayOption
Enumeration of options for instrumentation overlay.
Definition: overlay.h:62
@ motion_colour
Definition: overlay.h:63
@ gm_diff_colour
Definition: overlay.h:65
@ gm_colour_arrows
Definition: overlay.h:64
@ motion_colour_arrows
Definition: overlay.h:63
@ gm_arrows
Definition: overlay.h:64
@ split_mode
Definition: overlay.h:66
@ gm_inliers
Definition: overlay.h:66
@ pred_mode
Definition: overlay.h:66
@ gm_diff_colour_arrows
Definition: overlay.h:65
@ motion_arrows
Definition: overlay.h:63
@ gm_colour
Definition: overlay.h:64
@ gm_diff_arrows
Definition: overlay.h:65
@ SAD
Definition: overlay.h:66
Parameters for overlapped block motion compensation.
Definition: common.h:818
Class for all the motion estimation data.
Definition: motion.h:314
A class for encapsulating all the data relating to a picture.
Definition: picture.h:52
Class encapsulating parameters for drawing the picture.
Definition: draw_overlay.h:56
Class holding instrumentation overlay information.
Definition: overlay.h:71
int m_sad_clip
SAD clip value.
Definition: overlay.h:136
void SetSADClip(int c)
Set clip for sad.
Definition: overlay.h:117
bool m_bg
Background - original luma or mid-grey.
Definition: overlay.h:127
int MvClip() const
Returns clip value for motion vectors.
Definition: overlay.h:95
int m_ref
Reference picture.
Definition: overlay.h:124
int m_mv_clip
Motion vector clip value.
Definition: overlay.h:133
int SADClip() const
Returns clip value for sad.
Definition: overlay.h:98
OverlayOption m_option
Instrumentation command line option.
Definition: overlay.h:121
void SetLegend(bool l)
Set display of colour legend.
Definition: overlay.h:111
OverlayOption Option() const
Get functions...
Definition: overlay.h:83
bool m_legend
Instrumentation legend off.
Definition: overlay.h:130
int Background() const
Returns true if input picture background is used, false if grey.
Definition: overlay.h:89
void SetReference(int r)
Set which reference picture is to be used.
Definition: overlay.h:105
int Legend() const
Returns true if colour legend is displayed.
Definition: overlay.h:92
int Reference() const
Returns which reference is to be used.
Definition: overlay.h:86
void SetOption(OverlayOption o)
Set functions...
Definition: overlay.h:102
void SetBackground(bool b)
Set whether input picture or grey is used as background.
Definition: overlay.h:108
void SetMvClip(int c)
Set clip for motion vectors.
Definition: overlay.h:114
Class managing instrumentation overlay.
Definition: overlay.h:141
void PadPicture(const MEData &)
Calculates if picture requires padding.
int m_mv_scale
Temporal scaling factor for motion vectors.
Definition: overlay.h:187
void ProcessPicture(const MEData &, const OLBParams &)
void CalculateFactors(const ChromaFormat &)
Calculates chroma sample factors.
~Overlay()
Destructor.
Overlay(const OverlayParams &, Picture &)
constructor
Picture & m_picture
Local reference to picture.
Definition: overlay.h:196
DrawPictureMotionParams m_draw_params
Parameters for drawing picture overlays.
Definition: overlay.h:199
void DoOverlay(const MEData &)
Manages overlay based on command-line option.
void GlobalMotionDifference(const MEData &, MvArray &)
Remove global motion from block motion.
int m_ref
Local copy of reference offset.
Definition: overlay.h:190
const OverlayParams m_oparams
Overlay parameters.
Definition: overlay.h:193

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