www.pudn.com > wm2.5.zip > define.h
/*
***********************************************************************
* COPYRIGHT AND WARRANTY INFORMATION
*
* Copyright 2004, Advanced Audio Video Coding Standard, Part II
*
* DISCLAIMER OF WARRANTY
*
* These software programs are available to the users without any
* license fee or royalty on an "as is" basis. The AVS disclaims
* any and all warranties, whether express, implied, or statutory,
* including any implied warranties of merchantability or of fitness
* for a particular purpose. In no event shall the contributors or
* the AVS be liable for any incidental, punitive, or consequential
* damages of any kind whatsoever arising from the use of this program.
*
* This disclaimer of warranty extends to the user of this program
* and user's customers, employees, agents, transferees, successors,
* and assigns.
*
* The AVS does not represent or warrant that the program furnished
* hereunder are free of infringement of any third-party patents.
* Commercial implementations of AVS, including shareware, may be
* subject to royalty fees to patent holders. Information regarding
* the AVS patent policy is available from the AVS Web site at
* http://www.avs.org.cn
*
* THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE AVS PATENT POLICY.
************************************************************************
*/
#ifndef _DEFINE_H_
#define _DEFINE_H_
#define _FULL_SEARCH_
#define _PSNR_YUV_
///////////////////////////////////////////////////////
//aspect_ratio cbzhu 041219
#define ASPECT_RATIO_SAR1 1
#define ASPECT_RATIO_DAR_4_3 2
#define ASPECT_RATIO_DAR_16_9 3
#define ASPECT_RATIO_DAR_221 4
//0-forbidden 5..15-reserved
///////////////////////////////////////////////////////
#define _ISOLATED_REGION_ //cbzhu 12-15
///////////////////////////////////////////////////////
// Stream Info
#define DEFAULTCONFIGFILENAME "encoder.cfg"
#define MAX_ITEMS_TO_PARSE 10000
#define IMG_WIDTH 720
#define IMG_HEIGHT 576
#define PAD_SIZE 4
///////////////////////////////////////////////////////
// MB type definition
#define SKIP_MB 0
#define P16x16 1
#define P16x8 2
#define P8x16 3
#define P8x8 4
// #define P8x8_Zero_Ref 5
// #define I4MB 6 //zhangnan
#define I4MB 5 //JX 05-4-1
///////////////////////////////////////////////////////
// intra prediction
#define BLOCK_SIZE 4 //zhangnan
#define MB_BLOCK_SIZE 16 //zhangnan
//#define NO_INTRA_PMODE_LUMA 5 //qwang 2004-3-5
#define NO_INTRA_PMODE_LUMA 9 // jx 0408
#define NO_INTRA_PMODE_CHROMA 4 //qwang 2004-3-5
#define INTRA_LINE_BUF_LEN_LUMA IMG_WIDTH
#define INTRA_LINE_BUF_LEN_CHROMA (IMG_WIDTH/2)
#define INTRA_LINE_BUF_LEN_MODE (IMG_WIDTH/4) //qwang 2004-3-6
//added by MAZHAN
//!< 4x4 intra prediction modes
#define DOWN_LEFT_PRED 0
#define VERT_LEFT_PRED 1
#define VERT_PRED 2
#define VERT_RIGHT_PRED 3
#define DOWN_RIGHT_PRED 4
#define HOR_DOWN_PRED 5
#define HOR_PRED 6
#define HOR_UP_PRED 7
#define DC_PRED 8
// 8x8 chroma intra prediction modes
#define DC_PRED_8 0
#define HOR_PRED_8 1
#define VERT_PRED_8 2
//#define PLANE_8 3 //zhangnan
//////////////////////////////////////////////////////////
//Fast Motion Estimation
extern int search_range;
#define SEARCHRANGE (search_range)////// 16, 32
#define SUBSEARANGE 3 //4 jhzheng 0216
#define RANGE_FULL ((SEARCHRANGE*2)+1) //33, 65
#define RANGE_SUB ((SUBSEARANGE*2)+1) //7 9
#define SEABUF_FULL (RANGE_FULL+15) //48, 80
#define SEABUF_SUB (RANGE_SUB +15*4) //67 69
#ifdef _FULL_SEARCH_
#define SPIRALRANGE (RANGE_FULL * RANGE_FULL)// 6400
#else
#define SPIRALRANGE 25 // 5 x 5
#endif
#define absm(A) ((A)<(0) ? (-(A)):(A)) //!< abs macro, faster than procedure, used in block.c
#ifndef WIN32
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
//////////////////////////////////////////////////////////////////////////
#define CODE2D_ESCAPE_SYMBOL 39
#define ABTCODE2D_ESCAPE_SYMBOL 59
#define MAX_VALUE 999999 //!< used for start value for some variables
//////////////////////////////////////////////////////////////////////////
#define IS_INTRA(MB) ((MB)->mb_type==I4MB)
#define IS_INTERMV(MB) ((MB)->mb_type!=I4MB && (MB)->mb_type!=0)
#define IS_P8x8(MB) ((MB)->mb_type==P8x8)
#define IS_INTER(MB) ((MB)->mb_type!=I4MB)
// Picture types
#define INTRA_IMG 0 //!< I frame
#define INTER_IMG 1 //!< P frame
// Quantization parameter range
#define MIN_QP 0
//zig-zag scan mode
#define SINGLE_SCAN 0
#define DOUBLE_SCAN 1
#define LUMACOEFFCOST 4 //!< threshold for luma coeffs
#define CHROMACOEFFCOST 4 //!< threshold for chroma coeffs, used to be 7
#define LUMACOEFFCOST4x4 1 //!< dongjie
#define CHROMACOEFFCOST4x4 1 //!< dongjie
#endif //_DEFINE_H_