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

📄 sim.h

📁 H.263的压缩算法
💻 H
📖 第 1 页 / 共 3 页
字号:
/************************************************************************ * *  sim.h, part of (TMN encoder) * *  Copyright (C) 1997  University of BC, Canada * *  Contacts:  *  Michael Gallant                   <mikeg@ee.ubc.ca> *  Guy Cote                          <guyc@ee.ubc.ca> *  Berna Erol                        <bernae@ee.ubc.ca> * *  UBC Image Processing Laboratory   http://www.ee.ubc.ca/image *  2356 Main Mall                    tel.: +1 604 822 4051 *  Vancouver BC Canada V6T1Z4        fax.: +1 604 822 5949 * *  Copyright (C) 1995, 1996  Telenor R&D, Norway *   *  Contacts:  *  Robert Danielsen                  <Robert.Danielsen@nta.no> * *  Telenor Research and Development  http://www.nta.no/brukere/DVC/ *  P.O.Box 83                        tel.:   +47 63 84 84 00 *  N-2007 Kjeller, Norway            fax.:   +47 63 81 00 76 * ************************************************************************//* * Disclaimer of Warranty * * These software programs are available to the user without any * license fee or royalty on an "as is" basis. The University of * British Columbia disclaims any and all warranties, whether * express, implied, or statuary, including any implied warranties * or merchantability or of fitness for a particular purpose.  In no * event shall the copyright-holder be liable for any incidental, * punitive, or consequential damages of any kind whatsoever arising * from the use of these programs. * * This disclaimer of warranty extends to the user of these programs * and user's customers, employees, agents, transferees, successors, * and assigns. * * The University of British Columbia does not represent or warrant * that the programs furnished hereunder are free of infringement of * any third-party patents. * * Commercial implementations of H.263, including shareware, are * subject to royalty fees to patent holders.  Many of these patents * are general enough such that they are unavoidable regardless of * implementation design. **//********************************************************************** * * Headerfile for TMN coder * Type definitions and declaration of functions  * Date last modified: every now and then * **********************************************************************//* If you are not using the included Makefile, or want to override   the Makefile, you can uncomment one or more of the defines    below instead *//* #define PRINTMV *//* to print MVs to stdout while coding. *//* #define PRINTQ *//* #define PRINTBLOCKS *//* to print Blocks in advanced intra coding while coding *//* to print the quantizer used during coding *//* #define FASTIDCT *//* for a fast single precision IDCT. *//* #define QCIF *//* to change the coding format uncommment the above line and change to   SQCIF, QCIF, CIF, CIF4, or CIF16 *//* #define RESTRICTED_MQ */ /* restrict dquant so that when the modified quantization mode is on, quant only uses 2 bits*/#define FULLSEARCH/* to use the full search motion estimation */#include<stdio.h>#include<stdlib.h>#include<string.h>#include<limits.h>#include "config.h"#include"macros.h"/* This should not be changed */#define MB_SIZE 16#define BLOCK_SIZE 8#define BLOCKS_MB 6/* If someone forgets to define a coding format, QCIF is default *//*#if (!defined SQCIF && !defined QCIF && !defined CIF && !defined CIF4 && !defined CIF16)#define QCIF#endif*//* The coding format is decided here. *//*$#ifdef SQCIF#define DEF_PELS 128#define DEF_LINES 96#endif#ifdef QCIF#define DEF_PELS 176#define DEF_LINES 144#endif#ifdef CIF#define DEF_PELS 352#define DEF_LINES 288#endif#ifdef CIF4#define DEF_PELS 704#define DEF_LINES 576#endif#ifdef CIF16#define DEF_PELS 1408#define DEF_LINES 1152#endif$*//*$#define MBC   DEF_PELS/MB_SIZE#define MBR   DEF_LINES/MB_SIZE$*/#define MBC   88#define MBR   72/* Parameters from TMN */#define PREF_NULL_VEC 100#define PREF_16_VEC 200#define PREF_PBDELTA_NULL_VEC 50int headerlength; /* Global variables */int pels, enhancement_pels, base_pels;int cpels;int lines, enhancement_lines, base_lines;int trace;int adv_pred;int use_4mv;int overlapping_MC;int syntax_arith_coding;int pb_frames;int improved_pb_frames;int mv_outside_frame;int long_vectors;float target_framerate;FILE *tf;int force_intra;/* new variables for H.263+ modes */int advanced_intra_coding;int deblocking_filter;int slice_structure;/* Reference Picture Selection mode variables */int number_of_threads;int frames_per_thread;int sync_gobs_per_frame;int independent_segment_decoding;int alternative_inter_vlc;int modified_quantization;int scalability_mode;int i_picture_quant;int p_picture_quant;int b_picture_quant;int enhancement_layer_quant;int reference_picture_resampling;int reduced_resolution_update;int successive_B_frames;int b_picture_quant;int TRP;int rate_control_method;int coded_map[MBR+1][MBC+1];/* coded_map = 0 -> not coded   * * coded_map = 1 -> inter coded * * coded_map = 2 -> intra coded */int quant_map[MBR+1][MBC+1];int intra_refresh[MBR+1][MBC+1];int intra_mb_refresh;/* intra_refresh keeps a counter of the  * intra refresh for every macroblocks */int unlimited_unrestricted_motion_vectors;int EPTYPE;int CommBacklog;  /* Rate control buffer */#define PSC        1#define PSC_LENGTH        17#define ESCAPE                          7167#define PCT_INTRA                       0#define PCT_INTER                       1#define PCT_IPB                         2#define PCT_B                           3#define PCT_EI                          4#define PCT_EP                          5#define PCT_PB                          6#define ON                              1#define OFF                             0/* estimation types. */#define P_PICTURE_ESTIMATION            0#define PB_PICTURE_ESTIMATION           1#define B_PICTURE_ESTIMATION            2#define EI_EP_PICTURE_ESTIMATION        3#define SF_SQCIF                        1  /* 001 */#define SF_QCIF                         2  /* 010 */#define SF_CIF                          3  /* 011 */#define SF_4CIF                         4  /* 100 */#define SF_16CIF                        5  /* 101 */#define SF_CUSTOM                       6  /* 110 */#define SF_EPTYPE                       7  /* 111 Extended PTYPE *//* PB frames modes */#define PB_FRAMES                       1#define IM_PB_FRAMES                    2/* Prediction modes for PB-frames */#define FORWARD_PREDICTION              0#define BACKWARD_PREDICTION             1#define BIDIRECTIONAL_PREDICTION        2#define DIRECT_PREDICTION               3#define UPWARD_PREDICTION               4#define INTRA_PREDICTION                5/* Prediction modes for True B-pictures. */#define B_DIRECT_PREDICTION               0#define B_FORWARD_PREDICTION              1#define B_BACKWARD_PREDICTION             2#define B_BIDIRECTIONAL_PREDICTION        3#define B_INTRA_PREDICTION                4#define EP_FORWARD_PREDICTION             0#define EP_UPWARD_PREDICTION              1#define EP_BIDIRECTIONAL_PREDICTION       2#define EP_INTRA_PREDICTION               3#define EI_UPWARD_PREDICTION              0#define EI_INTRA_PREDICTION               1/* Pixel aspect ration for custom source format */#define PAR_0                           0  /* 0000 */#define PAR_SQUARE                      1  /* 0001 */#define PAR_CIF                         2  /* 0010 */#define PAR_525                         3  /* 0011 */#define PAR_CIF_STRETCHED               4  /* 0100 */#define PAR_525_STRETCHED               5  /* 0101 */#define PAR_EXTENDED                    15 /* 1111 */#define CCC_1000                        0  /* clock conversion code */#define CCC_1001                        1/* Mode flags of reference picture selection */#define NO_ACK_NACK                     4 /* neither ACK nor NACK needed */

⌨️ 快捷键说明

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