⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 encoder_context.h

📁 deblocking 在SPI DSP平台优化好的代码,超级强
💻 H
字号:
// -------------------------------------------------------------------// ?2005 Stream Processors, Inc.  All rights reserved.  This Software// is the property of Stream Processors, Inc. (SPI) and is Proprietary// and Confidential.  It has been provided under license for solely// use in evaluating and/or developing code for a stream processor// device.  Any use of the Software to develop code for a// semiconductor device not manufactured by or for SPI is prohibited.// Unauthorized use of this Software is strictly prohibited.//// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES ARE GIVEN,// WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING WARRANTIES OR// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,// NONINFRINGEMENT AND TITLE.  RECIPIENT SHALL HAVE THE SOLE// RESPONSIBILITY FOR THE ADEQUATE PROTECTION AND BACK-UP OF ITS DATA// USED IN CONNECTION WITH THIS SOFTWARE. IN NO EVENT WILL SPI BE// LIABLE FOR ANY CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING LOSS OF// DATA OR USE, LOST PROFITS OR ANY INCIDENTAL OR SPECIAL DAMAGES,// ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS// SOFTWARE, WHETHER IN ACTION OF CONTRACT OR TORT, INCLUDING// NEGLIGENCE.  SPI FURTHER DISCLAIMS ANY LIABILITY WHATSOEVER FOR// INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD// PARTY.// -------------------------------------------------------------------//--------------------------------------------------------------------//  File:              $File: //depot/main/software/demo/deblock/src/encoder_context.h $//  Revision:          $Revision: #1 $//  Last Modified:     $DateTime: 2007/12/10 16:59:57 $////  Description://     Structures and functions used in encoder.//--------------------------------------------------------------------#ifndef _ENCODER_CONTEXT_H#define _ENCODER_CONTEXT_H#include "spi_common.h"#include "mb_info.h"/// YUV pixel domain image arrays for uncompressed video frametypedef struct{        int     width;          // frame (allocated) buffer width in bytes, always dividible by 16;        int     height;         // frame (allocated) buffer height in bytes;        int     image_width;    // actual image width in pixels, less or equal to buffer width;        int     image_height;   // actual image height in pixels, less or equal to buffer height;        unsigned char *y;       // pointer to Y component data        unsigned char *u;       // pointer to U component data        unsigned char *v;       // pointer to V component data        int     buffer_owner;   // whether the y, u, v buffers are owned by this frame} yuv_frame_t;typedef struct LOOPFILTER_PARAMS{    int disable_flag;    int disable_cross_slice_flag;    int alpha_c0_offset;    int beta_offset;} LOOPFILTER_PARAMS;// Context maintained by deblocking between frames// Primarily used for index streams etc to avoid index// streams being inited for every frame.typedef struct DEBLOCK_CONTEXT_T{    int *p_deblk_tbls; //3*NUM_QP/4    int *p_y_idx; //[32*2]    int *p_uv_idx; //[32*2]    int *p_lf_mb_info_idx; //[16]    int *p_mb_info_idx; //[ROUND_UPTO_NEXT2nX(4*MAX_STRIP_SIZE+4, 4)]    int *p_mb_info_idx_bot; //[ROUND_UPTO_NEXT2nX(4*MAX_STRIP_SIZE+4, 4)]    int *p_colf_y_idx; //[ROUND_UPTO_NEXT2nX(8*MAX_STRIP_SIZE+24, 4)]    int *p_colf_uv_idx; //[ROUND_UPTO_NEXT2nX(MAX_STRIP_SIZE+3, 4)]    int *p_col_flat_frm_topuv_idx; //[128]}DEBLOCK_CONTEXT;typedef struct{	unsigned char			*luma_component;	unsigned char			*cb_component;	unsigned char			*cr_component;}VIDEO_FRAME_CREF_T;//All encoder context data ---typedef struct encoder_context_t {    int pic_width;      // Desired coding width luma    int pic_height;     // Desired coding height luma    int width;          // pic_width padded to multiple of macroblocks    int height;         // pic_height padded to multiple of macroblocks    int frames_cnt;     // Number of encoded or decoded frames    int last_IDR_frame; // Number of the most recent IDR frame    int slice_in_frame;	// Proceeded slice No in frame    int last_assigned_id;    int intra_period;        int desired_bitrate;    int desired_framerate;    int force_iframe;        int generate_sps_pps_nalus;       // If set to non zero, encoder has changed size.    int constrained_intra_flag;     // If 0, non-constrained intra. If 1, constrained intra        LOOPFILTER_PARAMS loopfilter_params;        // Frames    yuv_frame_t ref_frames[2];    // frames for reference and reconstucted    yuv_frame_t padded_ref_frame;    unsigned char *p_recon_flat_luma;    unsigned char *p_recon_flat_chroma;    yuv_frame_t inter_pred_frame; // frame for storing prediction    yuv_frame_t input_frame;    // pointer to input frame    yuv_frame_t *pRecFrame;      // Pointer to reconstructed frame    yuv_frame_t *pRefFrame;      // Pointer to reference frame    int own_input_frame;         // whether the encoder owns it's own buffers for the input frame        struct S_BLK_MB_INFO *pBlkMBInfo;    struct S_BLK_MB_INFO_COMPRESSED *p_blk_mb_info;    struct S_QP_DATA *p_qp_data;    // Output bitstream buffer    int enable_bitstream_generation;    int estimated_output_buffer_size;    int own_output_buffer;       // whether the encoder owns it's own buffer for output bitstream    // miscellaneous    int avg_mb_sad;    int intra_prediction_selection;        // Deblock context between frames    DEBLOCK_CONTEXT deblock_ctxt;} encoder_context_t;#endif //__ENCODER_CONTEXT_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -