📄 ssbsipvideodivxmp4_vars.h
字号:
/**
** Copyright (C) 2002 DivXNetworks, all rights reserved.
**
** DivXNetworks, Inc. Proprietary & Confidential
**
** This source code and the algorithms implemented therein constitute
** confidential information and may comprise trade secrets of DivXNetworks
** or its associates, and any use thereof is subject to the terms and
** conditions of the Non-Disclosure Agreement pursuant to which this
** source code was originally received.
**
**/
/** $Id: SsbSipVideoDivXmp4_vars.h,v 1.1.1.1 2003/04/23 23:24:25 c0redumb Exp $
**
**/
/*************************************************************************/
/**
* Copyright (C) 2001 - DivXNetworks
*
* Andrea Graziani (Ag)
*
* DivX Advanced Research Center <darc@projectmayo.com>
*
**/
// SsbSipVideoDivXmp4_vars.h //
/*******************************************************************************
Samsung India Software Operations Pvt. Ltd. (SISO)
Copyright 2006
;*******************************************************************************/
#ifndef ___SSBSIPMP4_VARS_H__
#define ___SSBSIPMP4_VARS_H__
/*
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
*/
#include <stdio.h>
#include "SsbSipVideoDivXdecore.h"
#include "SsbSipVideoDivXportab.h"
#include "SsbSipVideoDivXbasic_prediction.h" // mc proc definition
#include "SsbSipVideoDivXnoise_adder.h"
#include "SsbSipVideoDivXlogo_adder.h"
#ifdef __cplusplus
extern "C"
{
#endif
/*
// -----------------------------------------------------------------------------
// Struct/Union Types and define
// -----------------------------------------------------------------------------
*/
#define mmax(a, b) (a)-(((a)-(b))&(((a)-(b))>>31))
#define mmin(a, b) (b)+(((a)-(b))&(((a)-(b))>>31))
#define sign(a) ( ((a)>>31) | 1)
#define mnint(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5))
#define abs(a) ((a)>0 ? (a) : -(a))
#ifdef WIN32
#pragma warning ( disable : 4244 ) // conversion from 'x' to 'y'
#pragma warning ( disable : 4100 ) // unreferenced formal parameter
#endif
/**
* definitions
**/
#define VO_START_CODE 0x8
#define VO_START_CODE_MIN 0x100
#define VO_START_CODE_MAX 0x11f
#define VOL_START_CODE 0x12
#define VOL_START_CODE_MIN 0x120
#define VOL_START_CODE_MAX 0x12f
#define VOS_START_CODE 0x1b0
#define USR_START_CODE 0x1b2
#define GOP_START_CODE 0x1b3
#define VSO_START_CODE 0x1b5
#define VOP_START_CODE 0x1b6
#define STF_START_CODE 0x1c3 // stuffing_start_code
#define SHV_START_CODE 0x020
#define SHV_END_MARKER 0x03f
#define I_VOP 0
#define P_VOP 1
#define B_VOP 2
#define S_VOP 3
#ifdef OPT_IDCT
#define DC 0
#define AC 1
#define VL 2
#define HL 3
#define SQ 4
#endif
#define RECTANGULAR 0
#define BINARY 1
#define BINARY_SHAPE_ONLY 2
#define GRAY_SCALE 3
#define NOTUSE_SPRITE 0
#define STATIC_SPRITE 1
#define GMC_SPRITE 2
#define RESERVED_SPRITE 3
#define RESYNC_MARKER 1
#define NOT_VALID 1<<31
#define NOT_CODED -1
#define INTER 0
#define INTER_Q 1
#define INTER4V 2
#define INTRA 3
#define INTRA_Q 4
#define STUFFING 7
#define B_MBLOCK 8 // used as a shortcut (overload) in mp4_recon_qpel
#define B_MBLOCK_DEST 9 // in this case, the destination is an array (mb)
#define B_BLOCK_DEST_4V 10
// b frames
#define MODB_1 0
#define MODB_00 1
#define MODB_01 2
#define MB_TYPE_1 0 // direct mode
#define MB_TYPE_01 1 // bi-directional mode
#define MB_TYPE_001 2 // backward mode
#define MB_TYPE_0001 3 // forward mode
#define DIRECT_MODE MB_TYPE_1
#define BIDIR_MODE MB_TYPE_01
#define BACKWARD_MODE MB_TYPE_001
#define FORWARD_MODE MB_TYPE_0001
#define FOUND_P_VOP_RET2MFC_NC 0x8000
#define FOUND_I_VOP_RET2MFC 0x8001
#define FOUND_P_VOP_RET2MFC 0x8002
#define FOUND_B_VOP_SWDCD 0x8003
#define FOUND_PB_CHUNK 0x8004
#define FOUND_VOP_SWDCD 0x8005
#define RET_DIVX_SW_DECODE 0x8006
#define FRSTKEYFRMCRPTED 0x8007
#ifdef _PLD_OPT_
#ifdef LINUX
#define PLD_LINUX(pld_s) __asm__ __volatile__( "PLD [ %0 ,#0]" : "=r"(pld_s) : "r"(pld_s) );
#endif
#endif
// video packet structure size
#define MAX_MB_PACKET 2560 // [Review] what is the maximum allowed?
#define DEC_MBC 120
#define DEC_MBR 80
/**
* decoder struct
**/
typedef struct {
int val, len;
} tab_type;
typedef struct {
int last;
int run;
int level;
} event_t;
/**
ATTENTION
The block[] MUST be aligned on 16byte boundaries. Vector processors
will otherwise access improperly. For example the PowerPC doesn't even use the
lower address lines! So It'll actually load the wrong memory if not properly
aligned!
( J.Leiterman )
**/
typedef struct
{
// block data
#ifdef OPT_MEM
short *block;
#else
short block[64];
#endif
// bit input
#ifndef _DECORE
FILE * infile;
unsigned char rdbfr[2051];
#endif
const unsigned char *startptr;
const unsigned char *rdptr;
#ifndef _DECORE
unsigned char inbfr[16];
#endif
int incnt;
int bitcnt;
// this int are supposed to be always aligned, I'm going to use always these two
// mini-buffers to access to the stream. It's faster! (thanks to Lionel Ulmer)
unsigned int bit_a, bit_b;
unsigned int length;
}
MP4_STREAM;
typedef struct _ac_dc
{
int *prev_ac_lum;
int prev_dc_lum[2];
int *prev_ac_lum_left;
int *prev_ac_chr[2];
int *prev_ac_chr_left[2];
int prev_dc_chr[2];
int ac_top_lum_stride;
int predict_dir;
} ac_dc;
typedef struct _mp4_header {
int dc_scaler;
int ac_pred_flag;
int quant_type;
int intra_dc_vlc_thr;
int use_intra_dc_vlc;
int quantizer;
// svh
int short_video_header;
int mcsel;
int quarter_pixel;
int old_prediction_type;
int rounding_type;
int fcode_for;
int fcode_back;
// extra/derived
#ifndef OPT_MEM
int mba_size; //Lobo 31/01/2008 To be removed from MB loop
int mba; //Lobo 31/01/2008 To be removed from MB loop
#endif
// MPEG-2 quant matrices
unsigned int SsbSipVideoDivXintra_quant_matrix[64];
unsigned int SsbSipVideoDivXnonintra_quant_matrix[64];
int shape;
int time_increment_resolution;
int sprite_usage;
int complexity_estimation_disable;
int resync_marker_disable;
int data_partitioning;
int reversible_vlc;
int scalability;
// complexity estimation
int estimation_method;
int opaque;
int transparent;
int intra_cae;
int inter_cae;
int no_update;
int upsampling;
int intra_blocks;
int inter_blocks;
int inter4v_blocks;
int not_coded_blocks;
int dct_coefs;
int dct_lines;
int vlc_symbols;
int vlc_bits;
int motion_compensation_complexity_disable;
int apm;
int npm;
int interpolate_mc_q;
int forw_back_mc_q;
int halfpel2;
int halfpel4;
int version2_complexity_estimation_disable;
int sadct;
int quarterpel;
int newpred_enable;
// vop
int last_coded_prediction_type;
// Lobo. 31/01/2008 prediction_type Used rarely although in svh it's used within MB.
// SVH MB processing is not optimized like non SVH
int prediction_type;
int old_time_base;
int time_base;
int time_inc;
int vop_coded;
// int rounding_type;
int display_time_next;
int display_time_prev;
int tframe; // see paragraph 7.7.2.2
// video packet
int macroblock_number;
// SsbSipVideoDivXmacroblock
int picnum;
int packetnum; // if ~0 indicates the presece of at least 1 video packet
int gobnum; // needed for short header decoding
int num_mb_in_gob; // shv
int num_gobs_in_vop; // shv
int mb_in_vop_length;
int resync_length;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -