~ubuntu-branches/ubuntu/natty/digikam/natty

« back to all changes in this revision

Viewing changes to libs/3rdparty/libpgf/Encoder.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-07-26 22:11:35 UTC
  • mfrom: (1.2.22 upstream) (3.2.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090726221135-890tb3z3dqr2lkr6
Tags: 2:1.0.0~beta3-1ubuntu1
* Merge with debian unstable, remaining changes:
  - Export .pot name and copy to plugins in debian/rules
  - Remove liblqr-1-0-dev from build-deps, not in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
//                   subband
42
42
//                      |
43
43
//                   m_value    [BufferSize]
44
 
/*                /     |     \                                               */
 
44
//                |     |     |
45
45
//           m_sign  sigBits  refBits   [BufferSize, BufferLen, BufferLen]
46
 
/*               \      |     /                                               */
 
46
//                |     |     |
47
47
//                m_codeBuffer  (for each plane: RLcodeLength (16 bit), RLcoded sigBits + m_sign, refBits)
48
48
//                      |
49
49
//                    file      (for each buffer: packedLength (16 bit), packed bits)
66
66
{
67
67
        ASSERT(m_stream);
68
68
 
69
 
        long count;
 
69
        int count;
70
70
 
71
71
        // save file position
72
72
        m_startPosition = m_stream->GetPos();
341
341
                m_stream->SetPos(FSFromStart, m_levelLengthPos);
342
342
#ifdef __BIGENDIAN__
343
343
                UINT32 levelLength;
344
 
                long count = WordBytes;
 
344
                int count = WordBytes;
345
345
                
346
346
                for (int i=0; i < m_currLevelIndex; i++) {
347
347
                        levelLength = __VAL(UINT32(m_levelLength[i]));
348
348
                        m_stream->Write(&count, &levelLength);
349
349
                }
350
350
#else
351
 
                long count = m_currLevelIndex*WordBytes;
 
351
                int count = m_currLevelIndex*WordBytes;
352
352
                
353
353
                m_stream->Write(&count, m_levelLength);
354
354
#endif //__BIGENDIAN__
364
364
// Stores band value from given position bandPos into buffer m_value at position m_valuePos
365
365
// If buffer is full encode it to file
366
366
// Throws IOException
367
 
void CEncoder::WriteValue(CSubband* band, long bandPos) THROW_ {
 
367
void CEncoder::WriteValue(CSubband* band, int bandPos) THROW_ {
368
368
        if (m_valuePos == BufferSize) {
369
369
                EncodeBuffer(ROIBlockHeader(BufferSize, false));
370
370
        }
391
391
        UINT16 wordLen = UINT16(AlignWordPos(codeLen)/WordWidth);
392
392
        ASSERT(wordLen <= BufferSize);
393
393
        
394
 
        long count = sizeof(UINT16);
 
394
        int count = sizeof(UINT16);
395
395
 
396
396
#ifdef __BIGENDIAN__
397
397
        // write wordLen
829
829
// Stores band value from given position bandPos into buffer m_value at position m_valuePos
830
830
// If buffer is full encode it to file
831
831
// Throws IOException
832
 
void CEncoder::WriteTileValue(CSubband* band, long bandPos) THROW_ {
 
832
void CEncoder::WriteTileValue(CSubband* band, int bandPos) THROW_ {
833
833
        // check if buffer is full
834
834
        if (m_valuePos == BufferSize) {
835
835
                // encode buffer
924
924
#endif
925
925
 
926
926
        // write block header into file
927
 
        long count = sizeof(BlockHeader);
 
927
        int count = sizeof(BlockHeader);
928
928
        m_stream->Write(&count, &h);
929
929
 
930
930
        // write coded buffer into file