📄 encinternal.h
字号:
/*------------------------------------------------------------------------------
-- --
-- This software is confidential and proprietary and may be used --
-- only as expressly authorized by a licensing agreement from --
-- --
-- Hantro Products Oy. --
-- --
-- In the event of publication, the following notice is applicable: --
-- --
-- (C) COPYRIGHT 2003 HANTRO PRODUCTS OY --
-- ALL RIGHTS RESERVED --
-- --
-- The entire notice above must be reproduced on all copies. --
-- --
--------------------------------------------------------------------------------
--
-- Abstract : VGA MPEG4 Encoder API
--
-------------------------------------------------------------------------------*/
#ifndef __ENCINTERNAL_H__
#define __ENCINTERNAL_H__
#include "basetype.h"
#include "mp4encapi.h"
/* ASIC endianess mode */
#define ASIC_LITTLE_ENDIAN 0
#define ASIC_BIG_ENDIAN 1
/* The system's endianess mode: ASIC_LITTLE_ENDIAN or ASIC_BIG_ENDIAN
* The stream and VOP headers are generated by SW and are always in
* system endianess. This define is used to determine whether the headers
* endianess needs to be swapped to stream endianess.
*/
#define MP4ENC_SYSTEM_ENDIAN ASIC_LITTLE_ENDIAN
/* The stream's endianess mode: ASIC_LITTLE_ENDIAN or ASIC_BIG_ENDIAN
* This defines the endianess of the stream generated by the ASIC.
*/
#define MP4ENC_STREAM_ENDIAN ASIC_LITTLE_ENDIAN
/* The input image's endianess mode: ASIC_LITTLE_ENDIAN or ASIC_BIG_ENDIAN
* This defines the endianess of the ASIC input YUV 4:2:0
*/
#define MP4ENC_INPUT_ENDIAN ASIC_LITTLE_ENDIAN
/* ASIC interrupt enable, separately for error response and VOP functions.
* This enables/disables the ASIC to generate interrupts
* If this is disabled, the SW must poll the registers to find out
* when the HW is ready. Currently the software doesn't support polling.
*/
#define MP4ENC_ERR_IRQ_ENABLE 1
#define MP4ENC_VOP_IRQ_ENABLE 1
/* Maximum amount of video packets reported by ASIC
* ASIC stops incrementing the VP counter if this value is reached
*/
#define MP4ENC_MAX_VP_NUMBER 1023
/* Stream buffer field 2 for MB cbpy-codes in data partitioned stream.
* The value is allocated buffer size in bits/macroblock.
*/
#define MP4ENC_MB_BUF_2_SIZE 116
/* Stream buffer field 3 for VLC coded DCT in data partitioned stream.
* The whole VOP is lost if overflow occurs in this buffer.
* When stream type is VP+DP or VP+DP+RVLC only one VP VLC's are stored
* in this buffer. Maximum VP size is defined by profile and level,
* advanced simple level 5 allows 16384 bits. After limit is reached
* maximum of two macroblocks is still encoded, thus adding 23040 bits.
* The value is allocated buffer size in bytes.
*/
#define MP4ENC_DCT_BUF_3_SIZE_VP 4928
/* Limits for output stream buffer and stream buffer field 3.
* This value (bytes) is added to the limit in register to get the last
* possible address that ASIC can write.
* The stream buffer limit includes the maximum burst length.
* One burst length (16 addresses) is added for safety.
*/
#define MP4ENC_BUF_LIMIT ((7 + 16*3 + 1)*4)
#define MP4ENC_BUF_3_LIMIT ((2*8 + 16)*4)
enum EncStatus
{
ENCSTAT_INIT,
ENCSTAT_STRM_START,
ENCSTAT_START_VOP,
ENCSTAT_GOV_INSERTED,
ENCSTAT_NEW_REF_IMG,
ENCSTAT_MID_VOP
};
i32 CheckInitCfg(const MP4EncCfg * pEncCfg);
void GetStrmSizeData(EncContainer_t * pEncCont, MP4EncOut * pEncOut,
MP4EncIn * pEncIn);
void GetTimeCode(const timeCode_s *timeCode, MP4EncOut * pEncOut);
MP4EncRet SetVopParameters(EncContainer_t * EncCont,
MP4EncIn * pEncIn, MP4EncOut * pEncOut);
MP4EncRet GetVopStatus(EncContainer_t * pEncCont,
MP4EncIn * pEncIn, MP4EncOut * pEncOut);
/* stream handling */
i32 EncStrmInit(EncContainer_t * pEncCont, MP4EncCfg * pCfg);
void EncStrmRelease(EncContainer_t * pEncCont);
i32 EncStrmStart(EncContainer_t * pEncCont, u32 * pBuf, u32 * size);
i32 EncStrmEnd(EncContainer_t * pEncCont, u32 * pBuf, u32 * size);
#endif /*__ENCINTERNAL_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -