/* * Copyright (c) 2010, Texas Instruments Incorporated * 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. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * 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 OWNER 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:Omx_ti_video.h * This header defines the structures specific to the param or config indices of Openmax Video Component. * * @path: * \WTSD_DucatiMMSW\ omx\omx_il_1_x\omx_core\ * -------------------------------------------------------------------------- */ /* ========================================================================= *! *! Revision History *! ===================================================================== *! 24-Dec-2008 Navneet navneet@ti.com Initial Version *! 14-Jul-2009 Radha Purnima radhapurnima@ti.com *! 25-Aug-2009 Radha Purnima radhapurnima@ti.com * =========================================================================*/ #ifndef OMX_TI_VIDEO_H #define OMX_TI_VIDEO_H #define H264ENC_MAXNUMSLCGPS 2 #include /** * @brief mode selection for the data that is given to the Codec */ typedef enum OMX_VIDEO_DATASYNCMODETYPE { OMX_Video_FixedLength, //!< Interms of multiples of 4K OMX_Video_SliceMode, //!< Slice mode OMX_Video_NumMBRows, //!< Number of rows, each row is 16 lines of video OMX_Video_EntireFrame //!< Processing of entire frame data } OMX_VIDEO_DATASYNCMODETYPE; /* ========================================================================== */ /*! @brief OMX_TI_VIDEO_PARAM_DATAMODE :to configure how the input and output data is fed to the Codec @param nPortIndex to specify the index of the port @param eDataMode to specify the data mode @sa OMX_VIDEO_DATASYNCMODETYPE @param nNumDataUnits to specify the number of data units (where units are of type defined by eDataMode) */ /* ==========================================================================*/ typedef struct OMX_VIDEO_PARAM_DATASYNCMODETYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_DATASYNCMODETYPE eDataMode; OMX_U32 nNumDataUnits; } OMX_VIDEO_PARAM_DATASYNCMODETYPE; /** * @brief Aspect Ratio type selection for the encoded bit stream */ typedef enum OMX_VIDEO_ASPECTRATIOTYPE{ OMX_Video_AR_Unspecified, //!< Unspecified aspect ratio OMX_Video_AR_Square , //!< 1:1 (square) aspect ratio OMX_Video_AR_12_11 , //!< 12:11 aspect ratio OMX_Video_AR_10_11 , //!< 10:11 aspect ratio OMX_Video_AR_16_11 , //!< 16:11 aspect ratio OMX_Video_AR_40_33 , //!< 40:33 aspect ratio OMX_Video_AR_24_11 , //!< 24:11 aspect ratio OMX_Video_AR_20_11 , //!< 20:11 aspect ratio OMX_Video_AR_32_11 , //!< 32:11 aspect ratio OMX_Video_AR_80_33 , //!< 80:33 aspect ratio OMX_Video_AR_18_11 , //!< 18:11 aspect ratio OMX_Video_AR_15_15 , //!< 15:15 aspect ratio OMX_Video_AR_64_33 , //!< 64:33 aspect ratio OMX_Video_AR_160_99 , //!< 160:99 aspect ratio OMX_Video_AR_4_3 , //!< 4:3 aspect ratio OMX_Video_AR_3_2 , //!< 3:2 aspect ratio OMX_Video_AR_2_1 , //!< 2:1 aspect ratio OMX_Video_AR_Extended = 255, //!< Extended aspect ratio OMX_Video_AR_Extended_MAX = 0X7FFFFFFF }OMX_VIDEO_ASPECTRATIOTYPE; /* ========================================================================== */ /*! @brief OMX_TI_VIDEO_PARAM_VUI_SELECT :to select the VUI Settings @param bAspectRatioPresent flag to indicate the insertion of aspect ratio information in VUI part of bit-stream @param ePixelAspectRatio to specify the Aspect Ratio @param bFullRange to indicate whether pixel value range is specified as full range or not (0 to 255) */ /* ==========================================================================*/ typedef struct OMX_VIDEO_PARAM_VUIINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bAspectRatioPresent; OMX_VIDEO_ASPECTRATIOTYPE ePixelAspectRatio; OMX_BOOL bFullRange; }OMX_VIDEO_PARAM_VUIINFOTYPE; /* ========================================================================== */ /*! @brief OMX_VIDEO_CONFIG_PIXELINFOTYPE :to specify the information related to the input pixel data (aspect ratio & range) to the Codec so that codec can incorporate this info in the coded bit stream @param nWidth to specify the Aspect ratio: width of the pixel @param nHeight to specify the Aspect ratio: height of the pixel */ /* ==========================================================================*/ typedef struct OMX_VIDEO_CONFIG_PIXELINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_VIDEO_CONFIG_PIXELINFOTYPE; /* ========================================================================== */ /*! @brief OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE : to configure what NALU need to send along the frames of different types (Intra,IDR...etc) @param nStartofSequence to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Start of sequence frame @param nEndofSequence to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the End of sequence frame @param nIDR to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the IDR frame @param nIntraPicture to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Intra frame @param nNonIntraPicture to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Non Intra frame Bit Position: 13| 12| 11| 10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0 NALU TYPE: SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n */ /* ==========================================================================*/ typedef struct OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nStartofSequence; OMX_U32 nEndofSequence; OMX_U32 nIDR; OMX_U32 nIntraPicture; OMX_U32 nNonIntraPicture; }OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE; /* ========================================================================== */ /*! @brief OMX_VIDEO_CONFIG_MESEARCHRANGETYPE : to configure Motion Estimation Parameters @param eMVAccuracy to specify the Motion Vector Accuracy @sa OMX_VIDEO_MOTIONVECTORTYPE @param sHorSearchRangeP to Specify the Horizontal Search range for P Frame @param sVerSearchRangeP to Specify the Vertical Search range for P Frame @param sHorSearchRangeB to Specify the Horizontal Search range for B Frame @param sVerSearchRangeB to Specify the Vertical Search range for B Frame */ /* ==========================================================================*/ typedef struct OMX_VIDEO_CONFIG_MESEARCHRANGETYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_MOTIONVECTORTYPE eMVAccuracy; OMX_U32 nHorSearchRangeP; OMX_U32 nVerSearchRangeP; OMX_U32 nHorSearchRangeB; OMX_U32 nVerSearchRangeB; }OMX_VIDEO_CONFIG_MESEARCHRANGETYPE; /** * @brief Block size specification */ typedef enum OMX_VIDEO_BLOCKSIZETYPE { OMX_Video_Block_Size_16x16=0, OMX_Video_Block_Size_8x8, OMX_Video_Block_Size_8x4, OMX_Video_Block_Size_4x8, OMX_Video_Block_Size_4x4, OMX_Video_Block_Size_MAX = 0X7FFFFFFF }OMX_VIDEO_BLOCKSIZETYPE; /* ========================================================================== */ /*! @brief OMX_VIDEO_PARAM_MEBLOCKSIZETYPE : to configure the Min Motion Estimation block size for P and B frames @param eMinBlockSizeP to specify the Min Block size used for Motion Estimation incase of P Frames @sa OMX_VIDEO_BLOCKSIZETYPE @param eMinBlockSizeB to specify the Min Block size used for Motion Estimation incase of B Frames */ /* ==========================================================================*/ typedef struct OMX_VIDEO_PARAM_MEBLOCKSIZETYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_BLOCKSIZETYPE eMinBlockSizeP; OMX_VIDEO_BLOCKSIZETYPE eMinBlockSizeB; }OMX_VIDEO_PARAM_MEBLOCKSIZETYPE; /** * @brief to select the chroma component used for Intra Prediction */ typedef enum OMX_VIDEO_CHROMACOMPONENTTYPE { OMX_Video_Chroma_Component_Cr_Only=0, //!< consider only Cr chroma component for Intra prediction OMX_Video_Chroma_Component_Cb_Cr_Both, //!< consider both (Cb & Cr) chroma components for Intra prediction OMX_Video_Chroma_Component_MAX = 0X7FFFFFFF }OMX_VIDEO_CHROMACOMPONENTTYPE; /* ========================================================================== */ /*! @brief OMX_VIDEO_PARAM_INTRAPREDTYPE : to configure the Modes for the different block sizes during Intra Prediction @param nLumaIntra4x4Enable to configure the Modes for 4x4 block size during luma intra prediction: bit position specifies the modes that are enabled/disabled HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER @param nLumaIntra8x8Enable to configure the Modes for 4x4 block size during luma intra prediction HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER @param nLumaIntra16x16Enable to configure the Modes for 4x4 block size during luma intra prediction PLANE|DC|HOR|VER @param nChromaIntra8x8Enable to configure the Modes for 4x4 block size during luma intra prediction PLANE|DC|HOR|VER @param eChromaComponentEnable to select the chroma components used for the intra prediction @sa OMX_VIDEO_CHROMACOMPONENTTYPE */ /* ==========================================================================*/ typedef struct OMX_VIDEO_PARAM_INTRAPREDTYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nLumaIntra4x4Enable; OMX_U32 nLumaIntra8x8Enable; OMX_U32 nLumaIntra16x16Enable; OMX_U32 nChromaIntra8x8Enable; OMX_VIDEO_CHROMACOMPONENTTYPE eChromaComponentEnable; }OMX_VIDEO_PARAM_INTRAPREDTYPE; /** * @brief Encoding Mode Preset */ typedef enum OMX_VIDEO_ENCODING_MODE_PRESETTYPE { OMX_Video_Enc_Default=0, //!< for all the params default values are taken OMX_Video_Enc_High_Quality, //!< todo: mention the parameters that takes specific values depending on this selection OMX_Video_Enc_User_Defined, OMX_Video_Enc_High_Speed_Med_Quality, OMX_Video_Enc_Med_Speed_Med_Quality, OMX_Video_Enc_Med_Speed_High_Quality, OMX_Video_Enc_High_Speed, OMX_Video_Enc_Preset_MAX = 0X7FFFFFFF }OMX_VIDEO_ENCODING_MODE_PRESETTYPE; /** * @brief Rate Control Preset */ typedef enum OMX_VIDEO_RATECONTROL_PRESETTYPE { OMX_Video_RC_Low_Delay, //!