Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Embedded Zerotree Image Codec with Bior97 SSE Optimized Wavelet-transform

, 20 Oct 2007 GPL3
This article demonstrates the use of Embedded zero tree still image codec with JPEG 2000 wavelet-filter.
ezw_demo.zip
bin
ezwconsole.exe
ezw_demo_update_1_.zip
ezwconsole.exe
ezw_src.zip
src
Lib
Release
ezw_src_update_1_.zip

#ifndef Vec1D_h
#define Vec1D_h


/*
  arrange -3 -2 -1 0 +1 +2  indeces array

    vec1D v(6,-3);
     v(-3) = val1;
     v(-2) = val2;
     ...
     v[2] = val6

*/


class vec1D          //16 bit MMX aligned array
{
public:
        vec1D(unsigned int size = 1, int offset = 0, const float* data = 0);
        vec1D(const vec1D& v);
        ~vec1D();

        inline int first() const;                       //return first index into array  m_data[0]
        inline int last() const;                        //return last index into array   m_data[size-1]
        inline unsigned int size() const;               //total size of array
        inline const float* data() const;               //return m_data pointer    
        inline const float* data(int i) const;          //return m_data pointer    
        inline float& operator()(int x);                //operator m_data[x]
        inline float operator()(int x) const;           //const operator m_data[x] for funcs( const vec1D& v )
        inline float& operator[](int x);                //operator m_data[x]
        inline float operator[](int x) const;           //const operator m_data[x] for funcs( const vec1D& v )
        inline const vec1D& operator=(const vec1D& v);  //operator =

private:
        int m_offset;
        int m_last;
        unsigned int m_size;
        float* m_data;

        void init(const vec1D& v);
        void close();

};


inline int vec1D::first() const
{ 
        return m_offset; 
}

inline int vec1D::last() const
{ 
        return m_last; 
}

inline unsigned int vec1D::size() const
{ 
        return m_size; 
}

inline float& vec1D::operator()(int x)
{ 
        return m_data[x];
}

inline float vec1D::operator()(int x) const
{
        return m_data[x];
}

inline float& vec1D::operator[](int x)
{ 
        return m_data[x];
}

inline float vec1D::operator[](int x) const
{
        return m_data[x];
}

inline const vec1D& vec1D::operator=(const vec1D& v)
{
        if (this != &v)
                init(v);
        
        return *this;    
}

inline const float* vec1D::data() const
{ 
        return &m_data[first()]; 
}

inline const float* vec1D::data(int i) const
{
        return &m_data[i]; 
}


#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Chesnokov Yuriy
Engineer
Russian Federation Russian Federation
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 20 Oct 2007
Article Copyright 2007 by Chesnokov Yuriy
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid