⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umc_dv100_dec_720_60p_system_store.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
字号:
/*
//              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) 2006 Intel Corporation. All Rights Reserved.
//
//
*/

#include "umc_dv100_decoder.h"
#include <ippvc.h>

namespace UMC
{

static const Ipp32s MacroBlockWidth = 16;
static const Ipp32s MacroBlockHeight = 16;
static const Ipp32s MacroBlockHalfHeight = 8;
static const Ipp32s SuperBlockWidth = 6 * MacroBlockWidth;

static
inline
Ipp32s GetMacroBlockOffsetInADevidedBlock(Ipp32s i, Ipp32s k, Ipp32s Pitch, Ipp32s BytesPerPixel)
{
    Ipp32s Row, Col;
    if(i%2 == 0)
    {
        Row = k / 6;
        Col = k % 6;
        return (i/2) * 9 * MacroBlockHeight * Pitch +
                Row * MacroBlockHeight * Pitch +
                Col * MacroBlockWidth * BytesPerPixel;
    }
    else
    {
        Row = (k + 3) / 6;
        Col = (k + 3) % 6;
        return ( (i/2) * 9 * MacroBlockHeight + MacroBlockHeight * 4 ) * Pitch +
                Row * MacroBlockHeight * Pitch  +
                Col * MacroBlockWidth * BytesPerPixel;
    }
}

static
void InitializeOffsets(Ipp8u **pDestinations, Ipp8u *pDestImage, size_t nDestPitch, Ipp32s nChannelNum, Ipp32s nDIFSeqNum, Ipp32s nVideoSegmentNum)
{
    Ipp32s MBNum;
    Ipp32s s = nDIFSeqNum / 5;
    Ipp32s x = nDIFSeqNum % 5;
    Ipp32s t = (nVideoSegmentNum + 27*x) % 5;
    Ipp32s k = (nVideoSegmentNum + 27*x) / 5;
    Ipp32s h = nChannelNum;
    Ipp32s SuperBlockVertOrder[]=
    {
        (4*h + s + 2*t + 2) % 10, // a
        (4*h + s + 2*t + 6) % 10, // b
        (4*h + s + 2*t + 8) % 10, // c
        (4*h + s + 2*t + 0) % 10, // d
        (4*h + s + 2*t + 4) % 10  // e
    };
    Ipp32s SuperBlockHorzOrder[] = {2, 1, 3, 0, 4};
    Ipp32s BytesPerPixel = 2;

    if(h>=2) h-=2;

    for(MBNum = 0; MBNum<5; MBNum++)
    {
        pDestinations[2*MBNum] = pDestImage +
                         (SuperBlockHorzOrder[MBNum]*2 + h) * SuperBlockWidth * BytesPerPixel +
                         GetMacroBlockOffsetInADevidedBlock(SuperBlockVertOrder[MBNum], k, nDestPitch, BytesPerPixel);

        pDestinations[2*MBNum+1] = pDestinations[2*MBNum] + MacroBlockHalfHeight * nDestPitch;
    }
}


void DV100VideoDecoder::Store_System720_60p_Segment(Ipp16s* pDecodedVideoSegment, Ipp32s nChannelNum, Ipp32s nDIFSeqNum, Ipp32s nVideoSegmentNum)
{
    Ipp8u *pDestinations[10];
    // reset pointers
    InitializeOffsets(pDestinations, m_pDestination, m_nDestPitch, nChannelNum, nDIFSeqNum, nVideoSegmentNum);
    ippiYCrCb422ToYCbCr422_10HalvesMB16x8_DV100_16s8u_P3C2R(pDecodedVideoSegment, pDestinations, m_nDestPitch);
 }


}//namespace UMC

⌨️ 快捷键说明

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