Created by the British Broadcasting Corporation.
00001 /* ***** BEGIN LICENSE BLOCK ***** 00002 * 00003 * $Id: overlay.h,v 1.3 2004/09/09 14:48:43 asuraparaju Exp $ $Name: Dirac_0_4_3 $ 00004 * 00005 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 00006 * 00007 * The contents of this file are subject to the Mozilla Public License 00008 * Version 1.1 (the "License"); you may not use this file except in compliance 00009 * with the License. You may obtain a copy of the License at 00010 * http://www.mozilla.org/MPL/ 00011 * 00012 * Software distributed under the License is distributed on an "AS IS" basis, 00013 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 00014 * the specific language governing rights and limitations under the License. 00015 * 00016 * The Original Code is BBC Research and Development code. 00017 * 00018 * The Initial Developer of the Original Code is the British Broadcasting 00019 * Corporation. 00020 * Portions created by the Initial Developer are Copyright (C) 2004. 00021 * All Rights Reserved. 00022 * 00023 * Contributor(s): Chris Bowley (Original Author) 00024 * 00025 * Alternatively, the contents of this file may be used under the terms of 00026 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser 00027 * Public License Version 2.1 (the "LGPL"), in which case the provisions of 00028 * the GPL or the LGPL are applicable instead of those above. If you wish to 00029 * allow use of your version of this file only under the terms of the either 00030 * the GPL or LGPL and not to allow others to use your version of this file 00031 * under the MPL, indicate your decision by deleting the provisions above 00032 * and replace them with the notice and other provisions required by the GPL 00033 * or LGPL. If you do not delete the provisions above, a recipient may use 00034 * your version of this file under the terms of any one of the MPL, the GPL 00035 * or the LGPL. 00036 * ***** END LICENSE BLOCK ***** */ 00037 00038 #ifndef __OVERLAY_H__ 00039 #define __OVERLAY_H__ 00040 00041 #define NO_REF -1 00042 00043 #include <libdirac_common/common.h> 00044 #include <libdirac_common/motion.h> 00045 #include <libdirac_common/frame.h> 00046 #include <util/instrumentation/libdirac_instrument/motion_colour.h> 00047 #include <util/instrumentation/libdirac_instrument/motion_colour_arrows.h> 00048 #include <util/instrumentation/libdirac_instrument/sad.h> 00049 #include <util/instrumentation/libdirac_instrument/split_mode.h> 00050 #include <util/instrumentation/libdirac_instrument/pred_mode.h> 00051 #include <util/instrumentation/libdirac_instrument/overlay_symbols.h> 00052 00054 enum OverlayOption 00055 { 00056 motion_arrows, motion_colour, motion_colour_arrows, split_mode, SAD, pred_mode 00057 //global_motion_arrows, global_motion_colour, global_motion_colour_arrows, global_motion_difference 00058 }; 00059 00061 class OverlayParams 00062 { 00063 public: 00064 00066 // // 00067 // Assumes default constructor, copy constructor // 00068 // and assignment = // 00069 // // 00071 00074 const OverlayOption Option() const {return m_option;} 00075 00077 const int Reference() const {return m_ref;} 00078 00080 const int Background() const {return m_bg;} 00081 00083 const int Legend() const {return m_legend;} 00084 00086 const int MvClip() const {return m_mv_clip;} 00087 00089 const int SADClip() const {return m_sad_clip;} 00090 00093 void SetOption(OverlayOption o) {m_option=o;} 00094 00096 void SetReference(int r) {m_ref=r;} 00097 00099 void SetBackground(bool b) {m_bg=b;} 00100 00102 void SetLegend(bool l) {m_legend=l;} 00103 00105 void SetMvClip(int c) {m_mv_clip=c;} 00106 00108 void SetSADClip(int c) {m_sad_clip=c;} 00109 00110 private: 00112 OverlayOption m_option; 00113 00115 int m_ref; 00116 00118 bool m_bg; 00119 00121 bool m_legend; 00122 00124 int m_mv_clip; 00125 00127 int m_sad_clip; 00128 }; 00129 00131 class Overlay 00132 { 00133 public: 00135 Overlay(const OverlayParams &, Frame &); 00136 00138 ~Overlay(); 00139 00141 // // 00142 // Assumes default copy constructor and assignment = // 00143 // // 00145 00146 void ProcessFrame(const MEData &, const OLBParams &); 00147 00148 void ProcessFrame(); 00149 00150 private: 00151 00153 /* 00154 Main overlay is carried out on a motion vector block by block basis 00155 */ 00156 void DoOverlay(const MEData &); 00157 00159 /* 00160 Difference picture formats use different chroma resolutions with respect to luma 00161 */ 00162 void CalculateFactors(const ChromaFormat &); 00163 00165 /* 00166 Frames must have an integer number of macroblocks, more macroblocks may have been used 00167 during encoding and hence the frame must be padded now in order for the correct 00168 macroblock (and motion vector block) size to be calculated 00169 */ 00170 void PadFrame(const MEData &); 00171 00173 int m_mv_scale; 00174 00176 int m_ref; 00177 00179 const OverlayParams m_oparams; 00180 00182 Frame & m_frame; 00183 00185 DrawFrameMotionParams m_draw_params; 00186 }; 00187 00188 #endif 00189
© 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.