List Info

Thread: compress/libdirac_common wavelet_utils.cpp, 1.33, 1.34 wavelet_utils.h, 1.22, 1.23 w




compress/libdirac_common wavelet_utils.cpp, 1.33, 1.34 wavelet_utils.h, 1.22, 1.23 w
user name
2007-07-26 07:46:37
Update of /cvsroot/dirac/compress/libdirac_common
In directory
sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv11655/libdirac_com
mon

Modified Files:
	wavelet_utils.cpp wavelet_utils.h wavelet_utils_mmx.cpp 
	band_codec.cpp band_codec.h common.cpp common.h arrays.h 
Log Message:
Added CoeffType and CoeffArray types for wavelet
coefficients and arrays of
coefficients. For MMX optimisation, CoeffType will be short,
but otherwise
it will be int. In this way large wavelet depths can be
supported.


Index: band_codec.h
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/band_codec.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** band_codec.h	1 May 2007 14:51:14 -0000	1.25
--- band_codec.h	26 Jul 2007 12:46:35 -0000	1.26
***************
*** 58,62 ****
          A general class for coding and decoding wavelet
subband data, deriving from the abstract ArithCodec class.
       */
!     class BandCodec: public ArithCodec<PicArray>
      {
      public:
--- 58,62 ----
          A general class for coding and decoding wavelet
subband data, deriving from the abstract ArithCodec class.
       */
!     class BandCodec: public ArithCodec<CoeffArray>
      {
      public:
***************
*** 79,86 ****
      protected:
          //! Code an individual quantised value and perform
inverse-quantisation
!         inline void CodeVal( PicArray& in_data , const
int xpos , const int ypos , const ValueType val);
  
          //! Decode an individual quantised value and
perform inverse-quantisation
!         inline void DecodeVal(PicArray& out_data ,
const int xpos , const int ypos );
  
          //! Encode the offset for a code block quantiser
--- 79,86 ----
      protected:
          //! Code an individual quantised value and perform
inverse-quantisation
!         inline void CodeVal( CoeffArray& in_data ,
const int xpos , const int ypos , const CoeffType val);
  
          //! Decode an individual quantised value and
perform inverse-quantisation
!         inline void DecodeVal(CoeffArray& out_data ,
const int xpos , const int ypos );
  
          //! Encode the offset for a code block quantiser
***************
*** 91,108 ****
  
          //! Set a code block area to a given value
!         inline void SetToVal( const CodeBlock&
code_block , PicArray& pic_data , const ValueType val);
  
          //! Set all block values to 0
!         inline void ClearBlock( const CodeBlock&
code_block , PicArray& pic_data);
  
      private:
          //functions
          // Overridden from the base class
!         virtual void DoWorkCode(PicArray& in_data);
          // Ditto
!         virtual void DoWorkDecode(PicArray&
out_data);
  
!         virtual void CodeCoeffBlock(const CodeBlock&
code_block , PicArray& in_data);
!         virtual void DecodeCoeffBlock(const CodeBlock&
code_block , PicArray& out_data);
  
          //! A function for choosing the context for
"follow bits"
--- 91,108 ----
  
          //! Set a code block area to a given value
!         inline void SetToVal( const CodeBlock&
code_block , CoeffArray& coeff_data , const CoeffType
val);
  
          //! Set all block values to 0
!         inline void ClearBlock( const CodeBlock&
code_block , CoeffArray& coeff_data);
  
      private:
          //functions
          // Overridden from the base class
!         virtual void DoWorkCode(CoeffArray& in_data);
          // Ditto
!         virtual void DoWorkDecode(CoeffArray&
out_data);
  
!         virtual void CodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& in_data);
!         virtual void DecodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& out_data);
  
          //! A function for choosing the context for
"follow bits"
***************
*** 113,117 ****
  
          //! A function for choosing the context for sign
bits
!         inline int ChooseSignContext(const PicArray&
data , const int xpos , const int ypos ) const;
  
          //! Private, bodyless copy constructor: class
should not be copied
--- 113,117 ----
  
          //! A function for choosing the context for sign
bits
!         inline int ChooseSignContext(const CoeffArray&
data , const int xpos , const int ypos ) const;
  
          //! Private, bodyless copy constructor: class
should not be copied
***************
*** 138,142 ****
      
          //! reconstruction point
!         ValueType m_offset;
  
          //! True if neighbours non-zero
--- 138,142 ----
      
          //! reconstruction point
!         CoeffType m_offset;
  
          //! True if neighbours non-zero
***************
*** 184,193 ****
      private:
          // Overridden from the base class
!         void DoWorkCode(PicArray& in_data);
          // Ditto
!         void DoWorkDecode(PicArray& out_data);
  
!         void CodeCoeffBlock(const CodeBlock&
code_block , PicArray& in_data);
!         void DecodeCoeffBlock(const CodeBlock&
code_block , PicArray& out_data);
  
          //! Private, bodyless copy constructor: class
should not be copied
--- 184,193 ----
      private:
          // Overridden from the base class
!         void DoWorkCode(CoeffArray& in_data);
          // Ditto
!         void DoWorkDecode(CoeffArray& out_data);
  
!         void CodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& in_data);
!         void DecodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& out_data);
  
          //! Private, bodyless copy constructor: class
should not be copied
***************
*** 226,234 ****
      
      private:
!         void DoWorkCode(PicArray& in_data);           
        //overridden from the base class
!         void DoWorkDecode(PicArray& out_data);
//ditto
  
!         void CodeCoeffBlock(const CodeBlock&
code_block , PicArray& in_data);
!         void DecodeCoeffBlock(const CodeBlock&
code_block , PicArray& out_data);
  
          //! Private, bodyless copy constructor: class
should not be copied
--- 226,234 ----
      
      private:
!         void DoWorkCode(CoeffArray& in_data);         
          //overridden from the base class
!         void DoWorkDecode(CoeffArray& out_data);
//ditto
  
!         void CodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& in_data);
!         void DecodeCoeffBlock(const CodeBlock&
code_block , CoeffArray& out_data);
  
          //! Private, bodyless copy constructor: class
should not be copied
***************
*** 239,246 ****
  
          //! Prediction of a DC value from its previously
coded neighbours
!         ValueType GetPrediction(const PicArray& data ,
const int xpos , const int ypos ) const;
  
      private:
!         PicArray m_dc_pred_res;
      };
  
--- 239,246 ----
  
          //! Prediction of a DC value from its previously
coded neighbours
!         CoeffType GetPrediction(const CoeffArray& data
, const int xpos , const int ypos ) const;
  
      private:
!         CoeffArray m_dc_pred_res;
      };
  

Index: wavelet_utils_mmx.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/wavelet_utils_mmx.cp
p,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** wavelet_utils_mmx.cpp	18 Jun 2007 16:05:49 -0000	1.9
--- wavelet_utils_mmx.cpp	26 Jul 2007 12:46:35 -0000	1.10
***************
*** 37,40 ****
--- 37,48 ----
  * ***** END LICENSE BLOCK ***** */
  
+ /*! 
+  * MMX version of wavelet transform routines. Note that
these routines
+  * assume that wavelet coefficients, of type CoeffType,
are in fact
+  * shorts. This is set in libdirac_common/common.h.
Turning MMX on
+  * reduces the supported wavelet depth to a maximum of 4
or 5
+  * (depending on the filter) by the use of only 16 bits
for coefficients.
+  */
[...1390 lines suppressed...]
          *(__m64 *)in_val = _mm_sub_pi16 (*(__m64 *)in_val,
m1);
         
!        //update.Filter( coeff_data[yp+yl2-1][i] ,
coeff_data[yend-2][i] , coeff_data[yend-1][i] );
          m1 = _mm_add_pi16 (*(__m64 *)in_val2, *(__m64
*)in_val);
          m1 = _mm_add_pi16 (m1, update_round);
***************
*** 1610,1615 ****
      for ( i = xp+stopX ; i<xend ; ++ i)
      {
!         predict.Filter( pic_data[yend-1][i] ,
pic_data[yp+yl2-1][i] , pic_data[yp+yl2-1][i] );
!         update.Filter( pic_data[yp+yl2-1][i] ,
pic_data[yend-2][i] , pic_data[yend-1][i] );
      }// i
      _mm_empty();
--- 1618,1623 ----
      for ( i = xp+stopX ; i<xend ; ++ i)
      {
!         predict.Filter( coeff_data[yend-1][i] ,
coeff_data[yp+yl2-1][i] , coeff_data[yp+yl2-1][i] );
!         update.Filter( coeff_data[yp+yl2-1][i] ,
coeff_data[yend-2][i] , coeff_data[yend-1][i] );
      }// i
      _mm_empty();

Index: common.h
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/common.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** common.h	25 Jul 2007 13:26:34 -0000	1.56
--- common.h	26 Jul 2007 12:46:35 -0000	1.57
***************
*** 64,70 ****
  
  
!     //Some basic enumeration types used throughout the
codec ...//
     
////////////////////////////////////////////////////////////
//
  
      //! Prediction modes for blocks
      enum PredMode{ INTRA , REF1_ONLY , REF2_ONLY ,
REF1AND2, UNDEFINED };
--- 64,84 ----
  
  
!     //Some basic types used throughout the codec ...//
     
////////////////////////////////////////////////////////////
//
  
+ 	//! Type of picture data (including motion compensated
residuals)
+     typedef short ValueType;
+ 
+ #if !defined(HAVE_MMX)    
+     //! Type of wavelet coefficient data (should be larger
than ValueType)
+     typedef int CoeffType;
+ #else
+     //! Type of wavelet coefficient data (should be larger
than ValueType)
+     typedef short CoeffType;
+ #endif
+ 
+     //! Type for performing calculations on ValueType and
CoeffType. Should be >ValueType, >=CoeffType
+     typedef int CalcValueType;
+ 
      //! Prediction modes for blocks
      enum PredMode{ INTRA , REF1_ONLY , REF2_ONLY ,
REF1AND2, UNDEFINED };
***************
*** 262,269 ****
      //! A class for picture component data.
      /*!
!         A class for encapsulating picture data, derived
from TwoDArray. NB: 
!         in the future there will be separate classes for
input/output picture 
!         data, difference picture data, and wavelet
coefficient data. Currently 
!         PicArray is used for all of these. TJD 13 April
2004.
       */
      class PicArray: public TwoDArray<ValueType>
--- 276,280 ----
      //! A class for picture component data.
      /*!
!         A class for encapsulating picture data, derived
from TwoDArray. 
       */
      class PicArray: public TwoDArray<ValueType>
***************
*** 298,301 ****
--- 309,339 ----
          CompSort m_csort;
      };
+     
+     //! A class for picture component data.
+     /*!
+         A class for encapsulating coefficient data,
derived from TwoDArray..
+      */
+     class CoeffArray: public TwoDArray<CoeffType>
+     {
+     public:
+         //! Default constructor
+         /*!
+             Default constructor creates an empty array.
+         */
+         CoeffArray(): TwoDArray<CoeffType>(){}
+         
+         //! Constructor.
+         /*!
+             Contructor creates a two-D array, with
specified size and colour 
+             format.
+         */
+         CoeffArray(int height, int width):
TwoDArray<CoeffType>(height, width){}
+         
+         //copy constructor and assignment= derived by
inheritance
+         
+         //! Destructor
+         ~CoeffArray(){}
+         
+     };
  
  
***************
*** 544,548 ****
          
          //! Set the major version
!         void SetMajorVersion(unsigned int major_ver) {
m_major_ver = major_ver; }
  
          //! Set the minor version
--- 582,586 ----
          
          //! Set the major version
!         void SetMajorVersion(unsigned int major_ver)
{m_major_ver = major_ver; }
  
          //! Set the minor version

Index: arrays.h
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/arrays.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** arrays.h	19 Mar 2007 16:18:59 -0000	1.17
--- arrays.h	26 Jul 2007 12:46:35 -0000	1.18
***************
*** 52,59 ****
  namespace dirac
  {
-     typedef short ValueType;
- 
-     typedef int CalcValueType;
- 
      //! Range type. 
      /*!
--- 52,55 ----

Index: band_codec.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/band_codec.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** band_codec.cpp	18 Jul 2007 08:14:26 -0000	1.38
--- band_codec.cpp	26 Jul 2007 12:46:35 -0000	1.39
***************
*** 57,61 ****
                       int band_num,
                       const bool is_intra):
!    
ArithCodec<PicArray>(subband_byteio,number_of_contexts
),
      m_is_intra(is_intra),
      m_bnum(band_num),
--- 57,61 ----
                       int band_num,
                       const bool is_intra):
!    
ArithCodec<CoeffArray>(subband_byteio,number_of_contex
ts),
      m_is_intra(is_intra),
      m_bnum(band_num),
***************
*** 69,73 ****
  
  //encoding function
! void BandCodec:oWorkCod
e(PicArray& in_data)
  {
  
--- 69,73 ----
  
  //encoding function
! void BandCodec:oWorkCod
e(CoeffArray& in_data)
  {
  
***************
*** 103,107 ****
  }
  
! void BandCodec::CodeCoeffBlock( const CodeBlock&
code_block , PicArray& in_data )
  {
      //main coding function, using binarisation
--- 103,107 ----
  }
  
! void BandCodec::CodeCoeffBlock( const CodeBlock&
code_block , CoeffArray& in_data )
  {
      //main coding function, using binarisation
***************
*** 168,175 ****
  */
  
! inline void BandCodec::CodeVal( PicArray& in_data , 
                                  const int xpos , 
                                  const int ypos , 
!                                 const ValueType val )
  {
      unsigned int abs_val( std::abs(val) );
--- 168,175 ----
  */
  
! inline void BandCodec::CodeVal( CoeffArray& in_data ,

                                  const int xpos , 
                                  const int ypos , 
!                                 const CoeffType val )
  {
      unsigned int abs_val( std::abs(val) );
***************
*** 191,195 ****
      EncodeSymbol( 1, ChooseFollowContext(
num_follow_zeroes+1 ) );
  
!     in_data[ypos][xpos] = static_cast<ValueType>(
abs_val );
  
      if ( abs_val )
--- 191,195 ----
      EncodeSymbol( 1, ChooseFollowContext(
num_follow_zeroes+1 ) );
  
!     in_data[ypos][xpos] = static_cast<CoeffType>(
abs_val );
  
      if ( abs_val )
***************
*** 240,244 ****
  }
  
! void BandCodec:oWorkDec
ode( PicArray& out_data )
  {
      if (m_node.Parent() != 0)
--- 240,244 ----
  }
  
! void BandCodec:oWorkDec
ode( CoeffArray& out_data )
  {
      if (m_node.Parent() != 0)
***************
*** 274,278 ****
  }
  
! void BandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , PicArray&
out_data )
  {
  
--- 274,278 ----
  }
  
! void BandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , CoeffArray&
out_data )
  {
  
***************
*** 314,322 ****
      {
  	m_pypos=(( ypos-m_node.Yp() )>>1)+m_pnode.Yp();
!         ValueType *p_out_data = out_data[m_pypos];
!         ValueType *c_out_data_1 = NULL;
          if (ypos!=m_node.Yp())
              c_out_data_1 = out_data[ypos-1];
!         ValueType *c_out_data_2 = out_data[ypos];
          for ( int xpos=xbeg; xpos<xend ;++xpos)
          {
--- 314,322 ----
      {
  	m_pypos=(( ypos-m_node.Yp() )>>1)+m_pnode.Yp();
!         CoeffType *p_out_data = out_data[m_pypos];
!         CoeffType *c_out_data_1 = NULL;
          if (ypos!=m_node.Yp())
              c_out_data_1 = out_data[ypos-1];
!         CoeffType *c_out_data_2 = out_data[ypos];
          for ( int xpos=xbeg; xpos<xend ;++xpos)
          {
***************
*** 358,365 ****
  based on position, and have different contexts from the
info bits. 
  */
! inline void BandCodec:ecodeVal
( PicArray& out_data , const int xpos , const int ypos
)
  {
  
!     ValueType& out_pixel = out_data[ypos][xpos];
  
      out_pixel = 1;
--- 358,365 ----
  based on position, and have different contexts from the
info bits. 
  */
! inline void BandCodec:ecodeVal
( CoeffArray& out_data , const int xpos , const int ypos
)
  {
  
!     CoeffType& out_pixel = out_data[ypos][xpos];
  
      out_pixel = 1;
***************
*** 442,446 ****
  }
  
! inline int BandCodec::ChooseSignContext( const
PicArray& data , const int xpos , const int ypos )
const
  {    
      if ( m_node.Yp()==0 && m_node.Xp()!=0 )
--- 442,446 ----
  }
  
! inline int BandCodec::ChooseSignContext( const
CoeffArray& data , const int xpos , const int ypos )
const
  {    
      if ( m_node.Yp()==0 && m_node.Xp()!=0 )
***************
*** 497,501 ****
  }
  
! void BandCodec::SetToVal( const CodeBlock& code_block
, PicArray& pic_data , const ValueType val)
  {
      for (int j=code_block.Ystart() ;
j<code_block.Yend() ; j++)
--- 497,501 ----
  }
  
! void BandCodec::SetToVal( const CodeBlock& code_block
, CoeffArray& pic_data , const CoeffType val)
  {
      for (int j=code_block.Ystart() ;
j<code_block.Yend() ; j++)
***************
*** 508,517 ****
  }
  
! void BandCodec::ClearBlock( const CodeBlock&
code_block , PicArray& pic_data)
  {
      for (int j=code_block.Ystart() ;
j<code_block.Yend() ; j++)
      {
!         ValueType *pic =
&pic_data[j][code_block.Xstart()];
!         memset (pic, 0,
(code_block.Xend()-code_block.Xstart())*sizeof(ValueType));
      }// j
  
--- 508,517 ----
  }
  
! void BandCodec::ClearBlock( const CodeBlock&
code_block , CoeffArray& coeff_data)
  {
      for (int j=code_block.Ystart() ;
j<code_block.Yend() ; j++)
      {
!         CoeffType *pic =
&coeff_data[j][code_block.Xstart()];
!         memset (pic, 0,
(code_block.Xend()-code_block.Xstart())*sizeof(CoeffType));
      }// j
  
***************
*** 521,525 ****
 
////////////////////////////////////////////////////////////
//////////////////////
  
! void LFBandCodec:oWorkCod
e(PicArray& in_data)
  {
  
--- 521,525 ----
 
////////////////////////////////////////////////////////////
//////////////////////
  
! void LFBandCodec:oWorkCod
e(CoeffArray& in_data)
  {
  
***************
*** 545,549 ****
  }
  
! void LFBandCodec::CodeCoeffBlock( const CodeBlock&
code_block , PicArray& in_data )
  {
      //main coding function, using binarisation
--- 545,549 ----
  }
  
! void LFBandCodec::CodeCoeffBlock( const CodeBlock&
code_block , CoeffArray& in_data )
  {
      //main coding function, using binarisation
***************
*** 589,593 ****
  
  
! void LFBandCodec:oWorkDec
ode(PicArray& out_data )
  {
      m_pxp = 0;
--- 589,593 ----
  
  
! void LFBandCodec:oWorkDec
ode(CoeffArray& out_data )
  {
      m_pxp = 0;
***************
*** 613,617 ****
  }
  
! void LFBandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , PicArray&
out_data )
  {
  
--- 613,617 ----
  }
  
! void LFBandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , CoeffArray&
out_data )
  {
  
***************
*** 673,677 ****
 
////////////////////////////////////////////////////////////
//////////////////////
  
! void IntraDCBandCodec:oWorkCod
e(PicArray& in_data)
  {
  
--- 673,677 ----
 
////////////////////////////////////////////////////////////
//////////////////////
  
! void IntraDCBandCodec:oWorkCod
e(CoeffArray& in_data)
  {
  
***************
*** 694,698 ****
  }
  
! void IntraDCBandCodec::CodeCoeffBlock( const
CodeBlock& code_block , PicArray& in_data)
  {
      // Main coding function, using binarisation
--- 694,698 ----
  }
  
! void IntraDCBandCodec::CodeCoeffBlock( const
CodeBlock& code_block , CoeffArray& in_data)
  {
      // Main coding function, using binarisation
***************
*** 704,710 ****
      //set parent to always be zero
      m_parent_notzero = false;
!     ValueType val;
      
!     ValueType prediction;
  
      const int qf_idx = code_block.QIndex();
--- 704,710 ----
      //set parent to always be zero
      m_parent_notzero = false;
!     CoeffType val;
      
!     CoeffType prediction;
  
      const int qf_idx = code_block.QIndex();
***************
*** 742,746 ****
  
  
! void IntraDCBandCodec:oWorkDec
ode(PicArray& out_data)
  {
  
--- 742,746 ----
  
  
! void IntraDCBandCodec:oWorkDec
ode(CoeffArray& out_data)
  {
  
***************
*** 762,766 ****
  }
  
! void IntraDCBandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , PicArray&
out_data)
  {
      const int xbeg = code_block.Xstart();
--- 762,766 ----
  }
  
! void IntraDCBandCodec:ecodeCoe
ffBlock( const CodeBlock& code_block , CoeffArray&
out_data)
  {
      const int xbeg = code_block.Xstart();
***************
*** 806,810 ****
  
  
! ValueType IntraDCBandCodec::GetPrediction( const
PicArray& data , const int xpos , const int ypos )
const
  {
      if (ypos!=0)
--- 806,810 ----
  
  
! CoeffType IntraDCBandCodec::GetPrediction( const
CoeffArray& data , const int xpos , const int ypos )
const
  {
      if (ypos!=0)

Index: wavelet_utils.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/wavelet_utils.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** wavelet_utils.cpp	18 Jul 2007 08:14:26 -0000	1.33
--- wavelet_utils.cpp	26 Jul 2007 12:46:35 -0000	1.34
***************
*** 256,260 ****
  }
  
! void WaveletTransform::Transform(const Direction d,
PicArray& pic_data)
  {
      int xl,yl; 
--- 256,260 ----
  }
  
! void WaveletTransform::Transform(const Direction d,
PicArray& pic_data, CoeffArray& coeff_data)
  {
[...1539 lines suppressed...]
      }
***************
*** 1503,1510 ****
          for (int i = xp+1; i < xend; i+=2)
          {
!             pic_data[j][i-1] -=
((pic_data[j][i]+1)>>1);
!             pic_data[j][i] += pic_data[j][i-1];
          }
!         line_data = &pic_data[j][xp];                

          ShiftRowRight(line_data, xl, 2);
      }
--- 1522,1529 ----
          for (int i = xp+1; i < xend; i+=2)
          {
!             coeff_data[j][i-1] -=
((coeff_data[j][i]+1)>>1);
!             coeff_data[j][i] += coeff_data[j][i-1];
          }
!         line_data = &coeff_data[j][xp];               
 
          ShiftRowRight(line_data, xl, 2);
      }

Index: wavelet_utils.h
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/wavelet_utils.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** wavelet_utils.h	18 Jun 2007 15:24:25 -0000	1.22
--- wavelet_utils.h	26 Jul 2007 12:46:35 -0000	1.23
***************
*** 348,352 ****
              param    pic_data    the data to be
transformed
          */
!         void Transform(const Direction d, PicArray&
pic_data);
      
          //! Returns the set of subbands
--- 348,352 ----
              param    pic_data    the data to be
transformed
          */
!         void Transform(const Direction d, PicArray&
pic_data, CoeffArray& coeff_data);
      
          //! Returns the set of subbands
***************
*** 387,394 ****
  
              //! Split a subband into 4
!             virtual void Split(const int xp, const int yp,
const int xl, const int yl, PicArray&pic_data)=0; 
  
              //! Create a single band from 4 quadrant
bands
!             virtual void Synth(const int xp, const int yp,
const int xl, const int yl, PicArray& pic_data)=0;
  
              //! Return a correction factor to compensate
for non-unity gain of low-pass filter
--- 387,394 ----
  
              //! Split a subband into 4
!             virtual void Split(const int xp, const int yp,
const int xl, const int yl, CoeffArray& coeff_data)=0; 
  
              //! Create a single band from 4 quadrant
bands
!             virtual void Synth(const int xp, const int yp,
const int xl, const int yl, CoeffArray& coeff_data)=0;
  
              //! Return a correction factor to compensate
for non-unity gain of low-pass filter
***************
*** 404,418 ****
              
              //! Interleave data from separate subbands
into even and odd positions for in-place calculation -
called by Synth
!             inline void Interleave( const int xp, const
int yp, const int xl, const int yl, PicArray&pic_data
);
      
  
              //! De-interleave data even and odd positions
into separate subbands - called by Split
!             inline void DeInterleave( const int xp, const
int yp, const int xl, const int yl, PicArray&pic_data
);
          
              //! Shift all vals in Row by 'shift' bits to
the left to increase accuracy by 'shift' bits. Used in
Analysis stage of filter
!             void ShiftRowLeft(ValueType *row, int length,
int shift);
          
          //! Shift all vals in Row by 'shift' bits to the
right to counter the shift in the Analysis stage. This
function is used in the Synthesis stage
!             void ShiftRowRight(ValueType *row, int length,
int shift);
          };
  
--- 404,418 ----
              
              //! Interleave data from separate subbands
into even and odd positions for in-place calculation -
called by Synth
!             inline void Interleave( const int xp, const
int yp, const int xl, const int yl, CoeffArray&
coeff_data );
      
  
              //! De-interleave data even and odd positions
into separate subbands - called by Split
!             inline void DeInterleave( const int xp, const
int yp, const int xl, const int yl, CoeffArray&
coeff_data );
          
              //! Shift all vals in Row by 'shift' bits to
the left to increase accuracy by 'shift' bits. Used in
Analysis stage of filter
!             void ShiftRowLeft(CoeffType *row, int length,
int shift);
          
          //! Shift all vals in Row by 'shift' bits to the
right to counter the shift in the Analysis stage. This
function is used in the Synthesis stage
!             void ShiftRowRight(CoeffType *row, int length,
int shift);
          };
  
***************
*** 424,431 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity gain of low-pass filter
--- 424,431 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity gain of low-pass filter
***************
*** 448,455 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 448,455 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 464,468 ****
  
  #ifdef HAVE_MMX
!             inline void HorizSynth (int xp, int xl, int
ystart, int yend, PicArray &pic_data);
  #endif
  
--- 464,468 ----
  
  #ifdef HAVE_MMX
!             inline void HorizSynth (int xp, int xl, int
ystart, int yend, CoeffArray &coeff_data);
  #endif
  
***************
*** 476,483 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 476,483 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 500,507 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 500,507 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 523,530 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 523,530 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 547,554 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 547,554 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 572,579 ****
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, PicArray&pic_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, PicArray& pic_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
--- 572,579 ----
  
              //! Split a subband into 4
!             void Split(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data); 
  
              //! Create a single band from 4 quadrant
bands
!             void Synth(const int xp, const int yp, const
int xl, const int yl, CoeffArray& coeff_data);
  
              //! Return a correction factor to compensate
for non-unity power gain of low-pass filter
***************
*** 611,615 ****
                  param   val2   the second value being
used for prediction
              */
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2) const
              {
                  in_val -= (( val1 + val2 +
(1<<(shift-1)) ) >>shift );
--- 611,615 ----
                  param   val2   the second value being
used for prediction
              */
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2) const
              {
                  in_val -= (( val1 + val2 +
(1<<(shift-1)) ) >>shift );
***************
*** 634,638 ****
                  param   val2   the second value being
used for updating
              */
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2) const
              {
                  in_val += ( ( val1 + val2 +
(1<<(shift-1)) ) >>shift );
--- 634,638 ----
                  param   val2   the second value being
used for updating
              */
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2) const
              {
                  in_val += ( ( val1 + val2 +
(1<<(shift-1)) ) >>shift );
***************
*** 653,658 ****
  
              //! Do the filtering
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2 ,
!                                                   const
ValueType& val3, const ValueType& val4 ) const
              {
                  in_val -= ( tap1*( val1 + val2 ) + tap2*(
val3 + val4 ) + (1<<(shift-1)))>>shift;
--- 653,658 ----
  
              //! Do the filtering
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2 ,
!                                                   const
CoeffType& val3, const CoeffType& val4 ) const
              {
                  in_val -= ( tap1*( val1 + val2 ) + tap2*(
val3 + val4 ) + (1<<(shift-1)))>>shift;
***************
*** 670,675 ****
  
              //! Do the filtering
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2 ,
!                                                   const
ValueType& val3, const ValueType& val4 ) const
              {
                  in_val += ( tap1*( val1 + val2 ) + tap2*(
val3 + val4 ) + (1<<(shift-1)) )>>shift;
--- 670,675 ----
  
              //! Do the filtering
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2 ,
!                                                   const
CoeffType& val3, const CoeffType& val4 ) const
              {
                  in_val += ( tap1*( val1 + val2 ) + tap2*(
val3 + val4 ) + (1<<(shift-1)) )>>shift;
***************
*** 694,700 ****
                  param   val2   the second value being
used for prediction
              */
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2) const
              {
!                 in_val -= static_cast< ValueType >(
(gain * static_cast< int >( val1 + val2 )) >>12
);
              }
          }; 
--- 694,700 ----
                  param   val2   the second value being
used for prediction
              */
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2) const
              {
!                 in_val -= static_cast< CoeffType >(
(gain * static_cast< int >( val1 + val2 )) >>12
);
              }
          }; 
***************
*** 715,721 ****
                  param   val2   the second value being
used for updating
              */
!             inline void Filter(ValueType& in_val,
const ValueType& val1, const ValueType& val2) const
              {
!                 in_val += static_cast< ValueType >(
(gain * static_cast< int >( val1 + val2 )) >>12
);
              }
          };  
--- 715,721 ----
                  param   val2   the second value being
used for updating
              */
!             inline void Filter(CoeffType& in_val,
const CoeffType& val1, const CoeffType& val2) const
              {
!                 in_val += static_cast< CoeffType >(
(gain * static_cast< int >( val1 + val2 )) >>12
);
              }
          };  

Index: common.cpp
============================================================
=======
RCS file:
/cvsroot/dirac/compress/libdirac_common/common.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** common.cpp	17 Jul 2007 08:46:33 -0000	1.50
--- common.cpp	26 Jul 2007 12:46:35 -0000	1.51
***************
*** 722,726 ****
          m_framerate.m_num = 60;
          m_framerate.m_denom = 1;
! 	break;
      default:
          m_fr_idx = FRAMERATE_CUSTOM;
--- 722,726 ----
          m_framerate.m_num = 60;
          m_framerate.m_denom = 1;
!         break;
      default:
          m_fr_idx = FRAMERATE_CUSTOM;


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Dirac-commits mailing list
Dirac-commitslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dirac-com
mits

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )