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:
144  Overlay(const OverlayParams &, Picture &);
145 
147  ~Overlay();
148 
150  // //
151  // Assumes default copy constructor and assignment = //
152  // //
154 
155  void ProcessPicture(const MEData &, const OLBParams &);
156 
157  void ProcessPicture();
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  */
172  void CalculateFactors(const ChromaFormat &);
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 
184  void GlobalMotionDifference(const MEData &, MvArray &);
185 
188 
190  int m_ref;
191 
194 
197 
200  };
201 
202 } // namespace dirac_instr
203 
204 #endif
205 

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