📄 h263_enc.hpp
字号:
/* /////////////////////////////////////////////////////////////////////////// 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) 2005 Intel Corporation. All Rights Reserved.//// Description: class ippVideoEncoderH263//*/#include "h263_enc_bitstream.hpp"#include "ippdefs.h"#include "ipps.h"#include "ippi.h"#include "ippvc.h"#include "vm_debug.h"#pragma warning(disable : 4514) // unreferenced inline function has been removed/* H.263++ code values *//* ITU-T Recommendation H.263, Table 5 */enum { H263_ASPECT_RATIO_FORBIDDEN = 0, H263_ASPECT_RATIO_1_1 = 1, H263_ASPECT_RATIO_12_11 = 2, H263_ASPECT_RATIO_10_11 = 3, H263_ASPECT_RATIO_16_11 = 4, H263_ASPECT_RATIO_40_33 = 5, H263_ASPECT_RATIO_EXTPAR = 15};enum { H263_PIC_TYPE_I = 0, H263_PIC_TYPE_P = 1, H263_PIC_TYPE_iPB = 2, H263_PIC_TYPE_B = 3, H263_PIC_TYPE_EI = 4, H263_PIC_TYPE_EP = 5, H263_PIC_TYPE_PB = 6};// ISO/IEC 14496-2:2004 table 6-24enum { H263_VOP_TYPE_I = 0, H263_VOP_TYPE_P = 1, H263_VOP_TYPE_B = 2,};/* Block Info */struct h263_Block { h263_Block *predA; h263_Block *predC; Ipp16s dct_acA[8]; Ipp16s dct_acC[8]; Ipp8u quant; Ipp8u validPredIntra; // original (not reconstructed) DCT coeffs, used to decide on Intra prediction mode Ipp16s dctOr_acA[8]; Ipp16s dctOr_acC[8];};/* MacroBlock Info */struct h263_MacroBlock { IppMotionVector mv[4]; Ipp32s lumaErr; h263_Block block[6]; Ipp8u type; Ipp8u not_coded; Ipp8u validPredInter; Ipp8u mcsel;};/* Video Object Plane Info */struct h263_VideoObjectPlane { int modulo_time_base; int vop_time_increment;// int vop_id; // verid != 1 (newpred)// int vop_id_for_prediction_indication; // verid != 1 (newpred)// int vop_id_for_prediction; // verid != 1 (newpred) int vop_rounding_type; int vop_reduced_resolution; // verid != 1 int vop_width; int vop_height; int vop_quant; int temporal_reference; int temporal_reference_increment; int split_screen_indicator; int document_camera_indicator; int full_picture_freeze_release; int source_format; int picture_coding_type; int gob_number; int num_gobs_in_vop; int num_macroblocks_in_gob; int gob_header_empty; int gob_frame_id; int quant_scale; int UMV; int SAC; int advPred; int PBframes; int temporal_reference_B; int dbquant; /* plusptype fields */ int plusptype; int ufep; int advIntra; int deblockFilt; int sliceStruct; int RPS; int ISD; int altInterVLC; int modQuant; int resample; int redResUp; int PCF; int CPM; int PSBI; int PAR_code; int PAR_width; int PAR_height; int clock_conversion_code; int clock_divisor; int unlimited_UMV; int sliceSubmodes; /* bit 1 - Rectangular slices; bit 2 - Arbitrary slice ordering */ int enh_layer_num; int ref_layer_num; int RPSflags; int pred_temp_ref; int wda; IppMotionVector warpParams[4]; int fillMode; int fillColor[3]; int scalability;};/* Video Object Info */struct h263_VideoObjectLayer {// iso part int aspect_ratio_info; int chroma_format; int vop_time_increment_resolution; int vop_time_increment_resolution_bits; int fixed_vop_rate; int fixed_vop_time_increment; int data_partitioned;/* int newpred_enable; // verid != 1 int requested_upstream_message_type;// verid != 1 int newpred_segment_type; // verid != 1 int reduced_resolution_vop_enable; // verid != 1 int scalability;*/};struct h263_Param{ int Width; int Height; int NumOfFrames; int TimeResolution; int TimeIncrement; int load_intra_quant_mat; int load_intra_quant_mat_len; Ipp8u intra_quant_mat[64]; int load_nonintra_quant_mat; int load_nonintra_quant_mat_len; Ipp8u nonintra_quant_mat[64]; int quantIVOP, quantPVOP, quantBVOP; int IVOPdist, PVOPdist; int PVOPsearchWidth, PVOPsearchHeight;// int BVOPsearchWidthForw, BVOPsearchHeightForw;// int BVOPsearchWidthBack, BVOPsearchHeightBack; int MEalgorithm; int MEaccuracy; int advPred; int deblockFilt; int calcPSNR; int VideoPacketLength; int advIntra; int UMV;// int data_partitioned; Ipp8u *bsBuffer; int bsBuffSize; int RateControl; int BitRate; int SceneChangeThreshold;};struct h263_VLC { int code; int len;};#define YUV_CHROMA_420 0#define YUV_CHROMA_422 1#define YUV_CHROMA_444 2#define H263_STS_NODATA -2#define H263_STS_BUFFERED -1#define H263_STS_NOERR 0#define H263_STS_ERR_NOTINIT 1#define H263_STS_ERR_PARAM 2#define H263_STS_ERR_NOMEM 3#define H263_STS_ERR_BUFOVER 4class ippVideoEncoderH263{public : Ipp8u *mCurrPtrY, *mCurrPtrU, *mCurrPtrV; Ipp8u *mForwPtrY, *mForwPtrU, *mForwPtrV; Ipp8u *mBackPtrY, *mBackPtrU, *mBackPtrV; int mSourceFormat; // 4:2:0 only supported int mSourceWidth; // width int mSourceHeight; // height int mStepLuma; int mStepChroma; int mNumOfFrames; int mFrameCount; Ipp64s mQuantAvg; Ipp64s mPSNR_Y, mPSNR_U, mPSNR_V; H263BitStream cBS;protected : bool mIsInit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -