dcodeblock.cpp

来自「这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数」· C++ 代码 · 共 82 行

CPP
82
字号
/* ////////////////////////////////////////////////////////////////////////////                  INTEL CORPORATION PROPRIETARY INFORMATION//     This software is supplied under the terms of a license agreement or//     nondisclosure agreement with Intel Corporation and may not be copied//     or disclosed except in accordance with the terms of that agreement.//          Copyright(c) 2002-2005 Intel Corporation. All Rights Reserved.//////*/#include "dcodeblock.h"DCodeBlock::DCodeBlock() : m_Lblock(3) {}void DCodeBlock::Init(    const ImageCore32sC1        &cbImage,    const RectSize              &size,    unsigned int                 nOfLayers,    IppiWTSubband                subband,    unsigned int                 cmpGuardBits,    unsigned int                 sbDynRange,    unsigned int                 sbLowestBitOffset,    const CBCodingStyle         &codingStyle){    int stateSize;    ippiDecodeCBProgrGetStateSize_JPEG2K(size, &stateSize);    m_state.ReAlloc(stateSize);    ippiDecodeCBProgrInit_JPEG2K(State());    m_layer.ReAlloc(nOfLayers);    m_cbImage           = cbImage          ;    m_size              = size             ;    m_subband           = subband          ;    m_cmpGuardBits      = cmpGuardBits     ;    m_sbDynRange        = sbDynRange       ;    m_sbLowestBitOffset = sbLowestBitOffset;    m_codingStyle       = codingStyle      ;    m_Lblock = 3;    Zero(m_cbImage, m_size);}void DCodeBlock::SetNextSegmentSize(unsigned int layer, unsigned int size, unsigned int nOfPasses){    m_layer[layer].SetNextSegmentSize(size);    m_layer[layer].AddNOfPasses(nOfPasses);    m_nOfPasses += nOfPasses;}void DCodeBlock::SetNOfZeroBits(unsigned int nOfZeroBits){    m_nOfZeroBits = nOfZeroBits;    int sfBits = (int)m_sbDynRange - 1 + (int)m_cmpGuardBits + m_sbLowestBitOffset - nOfZeroBits;    if(sfBits > 31)    {        m_diagnOutputPtr->Warning(DiagnDescrCT<DEBCOTWarning, CodeBlockNOfSignificantBitsExceedImplementationLimit>());        sfBits = 31;    }    if(sfBits <  0)    {        m_diagnOutputPtr->Warning(DiagnDescrCT<DEBCOTWarning, CodeBlockNOfSignificantBitsBelowZero>());        sfBits =  0;    }    ippiDecodeCBProgrAttach_JPEG2K_32s_C1R(        m_cbImage.Data(),        m_cbImage.LineStep(),        m_size,        State(),        m_subband,        sfBits,        m_codingStyle.IPPFlags() | IPP_JPEG2K_DEC_DO_NOT_CLEAR_CB);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?