Dirac - A Video Codec

Created by the British Broadcasting Corporation.


mot_comp.h

Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK ***** 00002 * 00003 * $Id: mot_comp.h,v 1.9 2004/09/17 15:43:50 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): Richard Felton (Original Author), Thomas Davies 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 // Motion Compensation routines. 00039 // Supports different sizes of blocks as long as the parameters 00040 // describing them are 'legal'. Blocks overlap the edge of the image 00041 // being written to but blocks in the reference image are forced to 00042 // lie completely within the image bounds. 00043 00044 #ifndef _INCLUDED_MOT_COMP 00045 #define _INCLUDED_MOT_COMP 00046 00047 #include <cstdlib> 00048 #include <ctime> 00049 #include <iostream> 00050 #include <libdirac_common/common.h> 00051 #include <libdirac_common/upconvert.h> 00052 #include <libdirac_common/motion.h> 00053 00054 class FrameBuffer; 00055 class Frame; 00056 00058 00062 class MotionCompensator 00063 { 00064 00065 public: 00067 00070 MotionCompensator( const CodecParams &cp ); 00072 ~MotionCompensator(); 00073 00075 void SetCompensationMode( AddOrSub a_or_s ) { add_or_sub = a_or_s; } 00076 00078 00084 void CompensateFrame( FrameBuffer& my_buffer , int fnum , const MvData& mv_data ); 00085 00086 private: 00087 //private, body-less copy constructor: this class should not be copied 00088 MotionCompensator( const MotionCompensator& cpy ); 00089 //private, body-less assignment=: this class should not be assigned 00090 MotionCompensator& operator=( const MotionCompensator& rhs ); 00091 00092 //functions 00093 00095 void CompensateComponent( Frame& picframe , const Frame& ref1frame , const Frame& ref2frame , 00096 const MvData& mv_data , const CompSort cs); 00097 00099 void CompensateBlock( PicArray& pic_data , const PicArray& refup_data , const MVector& Vec , 00100 const ImageCoords& Pos , const TwoDArray<CalcValueType>& Weights , const ArithObj& arith ); 00101 00103 void DCBlock( PicArray &pic_data , const ValueType dc , const ImageCoords& Pos , 00104 const TwoDArray<CalcValueType>& Weights ,const ArithObj& arith); 00105 00107 void ReConfig(); 00108 00109 private: 00110 //variables 00111 00113 CodecParams m_cparams; 00114 00116 ChromaFormat m_cformat; 00117 bool luma_or_chroma; //true if we're doing luma, false if we're coding chroma 00118 00119 // Particular arithmetic objects 00120 const ArithAddObj m_add; 00121 const ArithSubtractObj m_subtract; 00122 const ArithHalfSubtractObj m_subtracthalf; 00123 const ArithHalfAddObj m_addhalf; 00124 00125 AddOrSub add_or_sub; 00126 00127 //Image and block information 00128 OLBParams m_bparams; 00129 TwoDArray<CalcValueType>* m_block_weights; 00130 00131 }; 00132 00133 #endif

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