# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# enc_picture.h

Go to the documentation of this file.

    00001 /* ***** BEGIN LICENSE BLOCK *****
    00002 *
    00003 * $Id: enc_picture.h,v 1.6 2008/10/01 01:26:47 asuraparaju Exp $ $Name: Dirac_1_0_2 $
    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) 2008.
    00021 * All Rights Reserved.
    00022 *
    00023 * Contributor(s): Thomas Davies (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 _ENC_PICTURE_H_
    00039 #define _ENC_PICTURE_H_
    00040
    00041 #include <libdirac_common/picture.h>
    00042 #include <libdirac_common/motion.h>
    00043
    00044
    00045 namespace dirac
    00046 {
    00047 static const unsigned int DONE_ME_INIT = 0x1;
    00048 static const unsigned int DONE_PEL_ME = 0x2;
    00049 static const unsigned int DONE_SUBPEL_ME = 0x4;
    00050 static const unsigned int DONE_ME_MODE_DECN = 0x8;
    00051 static const unsigned int DONE_MV_CODING = 0x10;
    00052 static const unsigned int DONE_MC = 0x20;
    00053 static const unsigned int DONE_DWT = 0x40;
    00054 static const unsigned int DONE_QUANT_SEL = 0x80;
    00055 static const unsigned int DONE_RES_CODING = 0x100;
    00056 static const unsigned int DONE_IDWT = 0x200;
    00057 static const unsigned int DONE_MC_BACK = 0x400;
    00058 static const unsigned int DONE_SET_PTYPE = 0x800;
    00059 static const unsigned int DONE_PIC_COMPLEXITY = 0x1000;
    00060
    00061 static const unsigned int ALL_ENC = 0xFFFFFFFF;
    00062 static const unsigned int NO_ENC = 0;
    00063
    00064 class EncPicture : public Picture
    00065 {
    00066 public:
    00067     EncPicture( const PictureParams& pp );
    00068
    00069     virtual ~EncPicture();
    00070
    00072     void InitMEData( const PicturePredParams& predparams, const int num_refs);
    00073
    00075     MEData& GetMEData(){ return *m_me_data;}
    00076
    00078     const MEData& GetMEData() const { return *m_me_data;}
    00079
    00081     void DropRef( int rindex );
    00082
    00083
    00085     const PicArray& OrigData(CompSort c) const { return *m_orig_data[(int) c];}
    00086
    00088     const PicArray& UpOrigData(CompSort cs) const;
    00089
    00091     void SetOrigData();
    00092
    00094     const PicArray& DataForME(bool combined_me) const;
    00095
    00097     const PicArray& UpDataForME(bool combined_me) const;
    00098
    00099
    00100     void UpdateStatus( const unsigned int mask ){ m_status |= mask; }
    00101
    00102     void FlipStatus( const unsigned int mask){ m_status ^= mask; }
    00103
    00104     void SetStatus( const int status ){ m_status = status; }
    00105
    00106     unsigned int GetStatus() const{ return m_status; }
    00107
    00108
    00109     double GetComplexity() const {return m_complexity; }
    00110
    00111     void SetComplexity(double c){ m_complexity = c; }
    00112
    00113     double GetNormComplexity() const { return m_norm_complexity; }
    00114
    00115     void SetNormComplexity( double c ){ m_norm_complexity = c; }
    00116
    00117     double GetPredBias() const { return m_pred_bias; }
    00118
    00119     void SetPredBias( double b ){ m_pred_bias = b; }
    00120
    00121
    00122 private:
    00123
    00124     virtual void ClearData();
    00125
    00127     void AntiAliasFilter( PicArray& out_data, const PicArray& in_data ) const;
    00128
    00130     const PicArray& FiltData(CompSort c) const;
    00131
    00132     const PicArray& CombinedData() const;
    00133     const PicArray& UpCombinedData() const;
    00134     void Combine( PicArray& comb_data, const PicArray& y_data,
    00135                           const PicArray& u_data, const PicArray& v_data ) const;
    00136
    00138     const PicArray& UpFiltData(CompSort c) const;
    00139
    00140
    00141     void SetOrigData(const int c);
    00142
    00143 private:
    00144
    00145     PicArray* m_orig_data[3];
    00146     mutable PicArray* m_orig_up_data[3];
    00147     mutable PicArray* m_filt_data[3];
    00148     mutable PicArray* m_filt_up_data[3];
    00149
    00150     MEData* m_me_data;
    00151
    00152     unsigned int m_status;
    00153
    00154     double m_complexity;
    00155     double m_norm_complexity;
    00156
    00157     double m_pred_bias;
    00158 };
    00159
    00160
    00161 }
    00162
    00163 #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.