2013-12-09 13:51:09 +01:00
|
|
|
/*!
|
|
|
|
* \copy
|
|
|
|
* Copyright (c) 2009-2013, Cisco Systems
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \file decoder.h
|
|
|
|
*
|
|
|
|
* \brief Interfaces introduced in decoder system architecture
|
|
|
|
*
|
|
|
|
* \date 03/10/2009 Created
|
|
|
|
*
|
|
|
|
*************************************************************************************
|
|
|
|
*/
|
|
|
|
#ifndef WELS_DECODER_SYSTEM_ARCHITECTURE_H__
|
|
|
|
#define WELS_DECODER_SYSTEM_ARCHITECTURE_H__
|
|
|
|
|
|
|
|
#include "typedefs.h"
|
|
|
|
#include "decoder_context.h"
|
|
|
|
|
|
|
|
namespace WelsDec {
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif//__cplusplus
|
|
|
|
|
|
|
|
/*!
|
2013-12-12 23:21:12 +01:00
|
|
|
* \brief configure decoder parameters
|
2013-12-09 13:51:09 +01:00
|
|
|
*/
|
2014-02-18 11:59:14 +01:00
|
|
|
int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2013-12-12 23:21:12 +01:00
|
|
|
/*!
|
2013-12-09 13:51:09 +01:00
|
|
|
*************************************************************************************
|
|
|
|
* \brief Initialize Wels decoder parameters and memory
|
|
|
|
*
|
2013-12-12 23:21:12 +01:00
|
|
|
* \param pCtx input context to be initialized at first stage
|
2013-12-09 13:51:09 +01:00
|
|
|
* \param pTraceHandle handle for trace
|
|
|
|
* \param pLo log info pointer
|
|
|
|
*
|
|
|
|
* \return 0 - successed
|
|
|
|
* \return 1 - failed
|
|
|
|
*
|
|
|
|
* \note N/A
|
|
|
|
*************************************************************************************
|
|
|
|
*/
|
2014-02-08 22:26:33 +01:00
|
|
|
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, void* pTraceHandle, PWelsLogCallbackFunc pLog);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2013-12-12 23:21:12 +01:00
|
|
|
/*!
|
2013-12-09 13:51:09 +01:00
|
|
|
*************************************************************************************
|
|
|
|
* \brief Uninitialize Wels decoder parameters and memory
|
|
|
|
*
|
2013-12-12 23:21:12 +01:00
|
|
|
* \param pCtx input context to be uninitialized at release stage
|
2013-12-09 13:51:09 +01:00
|
|
|
*
|
|
|
|
* \return NONE
|
|
|
|
*
|
|
|
|
* \note N/A
|
|
|
|
*************************************************************************************
|
|
|
|
*/
|
2014-02-08 22:26:33 +01:00
|
|
|
void WelsEndDecoder (PWelsDecoderContext pCtx);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2013-12-12 23:21:12 +01:00
|
|
|
/*!
|
2013-12-09 13:51:09 +01:00
|
|
|
*************************************************************************************
|
|
|
|
* \brief First entrance to decoding core interface.
|
|
|
|
*
|
|
|
|
* \param pCtx decoder context
|
|
|
|
* \param pBufBs bit streaming buffer
|
|
|
|
* \param kBsLen size in bytes length of bit streaming buffer input
|
|
|
|
* \param ppDst picture payload data to be output
|
|
|
|
* \param pDstBufInfo buf information of ouput data
|
|
|
|
*
|
|
|
|
* \return 0 - successed
|
|
|
|
* \return 1 - failed
|
|
|
|
*
|
|
|
|
* \note N/A
|
|
|
|
*************************************************************************************
|
|
|
|
*/
|
|
|
|
|
2013-12-12 23:21:12 +01:00
|
|
|
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
|
|
|
uint8_t** ppDst, SBufferInfo* pDstBufInfo);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* request memory blocks for decoder avc part
|
|
|
|
*/
|
2013-12-12 23:21:12 +01:00
|
|
|
int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* free memory blocks in avc
|
|
|
|
*/
|
2014-02-08 22:26:33 +01:00
|
|
|
void WelsFreeMem (PWelsDecoderContext pCtx);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* set colorspace format in decoder
|
|
|
|
*/
|
2013-12-12 23:21:12 +01:00
|
|
|
int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on)
|
|
|
|
* over decoder internal
|
|
|
|
* ( MB coordinate and parts of data within decoder context structure )
|
|
|
|
* \param pCtx Wels decoder context
|
|
|
|
* \param iMbWidth MB width
|
2013-12-12 23:21:12 +01:00
|
|
|
* \pram iMbHeight MB height
|
2013-12-09 13:51:09 +01:00
|
|
|
* \return 0 - successful; none 0 - something wrong
|
|
|
|
*/
|
2013-12-12 23:21:12 +01:00
|
|
|
int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
void AssignFuncPointerForRec (PWelsDecoderContext pCtx);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
void ResetParameterSetsState (PWelsDecoderContext pCtx);
|
2013-12-09 13:51:09 +01:00
|
|
|
|
2014-02-08 22:26:33 +01:00
|
|
|
void GetVclNalTemporalId (PWelsDecoderContext pCtx); //get the info that whether or not have VCL NAL in current AU,
|
2013-12-12 23:21:12 +01:00
|
|
|
//and if YES, get the temporal ID
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif//__cplusplus
|
|
|
|
|
|
|
|
} // namespace WelsDec
|
|
|
|
|
|
|
|
#endif//WELS_DECODER_SYSTEM_ARCHITECTURE_H__
|