📄 umc_dv100_dec_1080_50i_system_store.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 = 9 * MacroBlockWidth;
static
void InitializeOffsets(Ipp8u **pDestinations,
Ipp8u *pDestImage,
size_t nDestPitch,
Ipp32s nChannelNum,
Ipp32s nDIFSeqNum,
Ipp32s nVideoSegmentNum)
{
Ipp32s BytesPerPixel = 2;
Ipp32s MBNum;
if(nDIFSeqNum < 11)
{
//Main Unit
Ipp32s i = (nVideoSegmentNum + 27*nDIFSeqNum) % 11;
Ipp32s k = (nVideoSegmentNum + 27*nDIFSeqNum) / 11;
Ipp32s h = nChannelNum;
Ipp32s SuperBlockVertOrder[]=
{
(4*h + i + 2) % 11,
(4*h + i + 6) % 11,
(4*h + i + 8) % 11,
(4*h + i + 0) % 11,
(4*h + i + 4) % 11
};
Ipp32s SuperBlockHorzOrder[] = {2, 1, 3, 0, 4};
Ipp32s Row = k/9;
Ipp32s Col = k%9;
for(MBNum=0; MBNum<5; MBNum++)
{
pDestinations[2*MBNum] = pDestImage +
MacroBlockHeight * nDestPitch + //Skip A0
(h/2 + SuperBlockVertOrder[MBNum]*6 + Row*2) * MacroBlockHeight * nDestPitch +
((h%2 + SuperBlockHorzOrder[MBNum]*2 ) * SuperBlockWidth + Col * MacroBlockWidth )* BytesPerPixel;
pDestinations[2*MBNum+1] = pDestinations[2*MBNum] + MacroBlockHalfHeight * nDestPitch;
}
}
else
{
//Edge unit
for(MBNum=0; MBNum<5; MBNum++)
{
if( (nVideoSegmentNum + MBNum*27) < 90)
{
//Macro block is from A0
pDestinations[2*MBNum] = pDestImage + (nVideoSegmentNum + MBNum*27)*MacroBlockWidth*BytesPerPixel;
pDestinations[2*MBNum+1] = pDestinations[2*MBNum] + MacroBlockHalfHeight * nDestPitch;
}
else
{
//Macro block is from A1
pDestinations[2*MBNum] = pDestImage +
67 * MacroBlockHeight * nDestPitch + //Skip A0 and main unit
((nVideoSegmentNum + MBNum*27) - 90) * 32 * BytesPerPixel;
pDestinations[2*MBNum+1] = pDestinations[2*MBNum] + MacroBlockWidth * BytesPerPixel;
}
}
}
}
void DV100VideoDecoder::Store_System1080_50i_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 + -