📄 umc_avs_dec_processing_unit_dec.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) 2007 Intel Corporation. All Rights Reserved.
//
//
*/
#include "umc_defs.h"
#if defined(UMC_ENABLE_AVS_VIDEO_DECODER)
#include "umc_avs_dec_processing_unit_dec.h"
#include "umc_automatic_mutex.h"
#include "umc_mutex.h"
namespace UMC
{
AVSDecProcessingUnit::AVSDecProcessingUnit(void)
{
} // AVSDecProcessingUnit::AVSDecProcessingUnit(void)
AVSDecProcessingUnit::~AVSDecProcessingUnit(void)
{
} // AVSDecProcessingUnit::~AVSDecProcessingUnit(void)
bool AVSDecProcessingUnit::LoadJob(AVSListElement<AVSFrame> *pFrameList)
{
// run over frame list and find an unparsed slice
while (pFrameList)
{
AVSListElement<AVSSlice> *pSlice = pFrameList->m_Slices.GetHead();
// run over slice list and find an unparsed slice
while (pSlice)
{
if ((false == pSlice->m_bError) &&
(pSlice->m_bDecVacant) &&
(pSlice->m_decCtx.MbIndex < pSlice->m_decCtx.MbLast))
{
Ipp16s *pCoeffsBuffer = pSlice->GetFree();
// this slice is uncomplete,
// wrap it around and go work.
if (pCoeffsBuffer)
{
pSlice->m_decCtx.m_pCoeffs = pCoeffsBuffer;
m_decompressor.SetDecodingContext(pSlice->m_decCtx);
pSlice->m_bDecVacant = false;
return true;
}
}
pSlice = pSlice->GetNext();
}
pFrameList = pFrameList->GetNext();
}
return false;
} // bool AVSDecProcessingUnit::LoadJob(AVSListElement<AVSFrame> *pFrameList)
void AVSDecProcessingUnit::DoJob(void)
{
// do decoding
switch (m_decompressor.GetDecodingContext().m_pPicHeader->PictureType)
{
case AVS_I_PICTURE:
m_decompressor.DecodeIMacroBlocksRow();
break;
case AVS_P_PICTURE:
m_decompressor.DecodePMacroBlocksRow();
break;
default:
m_decompressor.DecodeBMacroBlocksRow();
break;
};
// finalize processed task
UnloadJob();
} // void AVSDecProcessingUnit::DoJob(void)
void AVSDecProcessingUnit::HandleError(void)
{
AutomaticMutex guard(m_pGuard->ExtractHandle());
AVSSlice *pSlice;
pSlice = m_decompressor.GetDecodingContext().m_pSlice;
// drop the slice's flags
pSlice->m_bDecVacant = true;
pSlice->m_bError = true;
} // void AVSDecProcessingUnit::HandleError(void)
AVSTaskID AVSDecProcessingUnit::GetTaskID(void)
{
return AVS_TASK_DECODING;
} // AVSTaskID AVSDecProcessingUnit::GetTaskID(void)
void AVSDecProcessingUnit::UnloadJob(void)
{
AVS_DECODING_CONTEXT &decCtx = m_decompressor.GetDecodingContext();
AVSSlice *pSlice;
pSlice = decCtx.m_pSlice;
// reflect changes to the slice
{
AutomaticMutex guard(m_pGuard->ExtractHandle());
pSlice->AdvanceFree(decCtx.m_pCoeffs - pSlice->m_decCtx.m_pCoeffs);
pSlice->m_decCtx = decCtx;
pSlice->m_bDecVacant = true;
}
} // void AVSDecProcessingUnit::UnloadJob(void)
} // namespace UMC
#endif // #if defined(UMC_ENABLE_AVS_VIDEO_DECODER)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -