?? video.h
字號:
/* * Copyright (c) 1995 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. *//* * Portions of this software Copyright (c) 1995 Brown University. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement * is hereby granted, provided that the above copyright notice and the * following two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */#ifndef MPEG_LIB_VIDEO_HEADER#define MPEG_LIB_VIDEO_HEADER#include <stdio.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#ifdef SH_MEM#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/XShm.h>#endif/* Changes to make the code reentrant: deglobalized: ditherFlags, totNumFrames, realTimeStart, matched_depth, filename, ditherType, curBits, ReconPMBlock statics, stream id variables, Parse_done, swap, seekValue, input, EOF_flag, ReadPacket statics, sys_layer, curVidStream, curVidStream, jmb_buf env (removed) X globals now in xinfo: ditherType, visual, depth (also name), hints, owncmFlag, et al now const: scan film_has_ended instead of FilmState Additional changes: if DISABLE_DITHER defined, don't compile dithering code -lsh@cs.brown.edu (Loring Holden) *//* X11/xmd.h correctly defines INT32, etc */#ifndef XMD_Htypedef int INT32;typedef short INT16;typedef char INT8;#endiftypedef unsigned int UINT32;typedef unsigned short UINT16;typedef unsigned char UINT8; /* Define Parsing error codes. */#define SKIP_PICTURE (-10)#define SKIP_TO_START_CODE (-1)#define PARSE_OK 1/* Define BOOLEAN, TRUE, and FALSE. */#define BOOLEAN int#define TRUE 1#define FALSE 0/* Set ring buffer size. */#define RING_BUF_SIZE 5/* Macros for picture code type. */#define I_TYPE 1#define P_TYPE 2#define B_TYPE 3#define D_TYPE 4/* Start codes. */#define SEQ_END_CODE 0x000001b7#define SEQ_START_CODE 0x000001b3#define GOP_START_CODE 0x000001b8#define PICTURE_START_CODE 0x00000100#define SLICE_MIN_START_CODE 0x00000101#define SLICE_MAX_START_CODE 0x000001af#define EXT_START_CODE 0x000001b5#define USER_START_CODE 0x000001b2#define SEQUENCE_ERROR_CODE 0x000001b4/* Number of macroblocks to process in one call to mpegVidRsrc. */#define MB_QUANTUM 100/* Macros used with macroblock address decoding. */#define MB_STUFFING 34#define MB_ESCAPE 35/* Lock flags for pict images. */#define DISPLAY_LOCK 0x01#define PAST_LOCK 0x02#define FUTURE_LOCK 0x04#define HYBRID_DITHER 0#define HYBRID2_DITHER 1#define FS4_DITHER 2#define FS2_DITHER 3#define FS2FAST_DITHER 4#define Twox2_DITHER 5#define GRAY_DITHER 6#define FULL_COLOR_DITHER 7#define NO_DITHER 8#define ORDERED_DITHER 9#define MONO_DITHER 10#define MONO_THRESHOLD 11#define ORDERED2_DITHER 12#define MBORDERED_DITHER 13#define GRAY256_DITHER 14#define PPM_DITHER 15#define FULL_COLOR2_DITHER 16#define GRAY2_DITHER 17#define GRAY2562_DITHER 18#ifdef DISABLE_DITHER#define IS_2x2_DITHER(a) (0)#else#define IS_2x2_DITHER(a) ((a) == Twox2_DITHER || (a) == FULL_COLOR2_DITHER || (a) == GRAY2_DITHER || (a) == (GRAY2562_DITHER))#endif/* External declaration of row,col to zig zag conversion matrix. *//* Brown - changed to const int because it is a help variable */extern const int scan[][8];/* Temporary definition of time stamp structure. */typedef int TimeStamp;/* Structure with reconstructed pixel values. */typedef struct pict_image { unsigned char *luminance; /* Luminance plane. */ unsigned char *Cr; /* Cr plane. */ unsigned char *Cb; /* Cb plane. */ unsigned char *display; /* Display plane. */ int locked; /* Lock flag. */ TimeStamp show_time; /* Presentation time. */#ifdef SH_MEM XShmSegmentInfo shminfo; /* Segment info. */ XImage *ximage; /* Ximage struct. */#endif} PictImage;/* Group of pictures structure. */typedef struct GoP { BOOLEAN drop_flag; /* Flag indicating dropped frame. */ unsigned int tc_hours; /* Hour component of time code. */ unsigned int tc_minutes; /* Minute component of time code. */ unsigned int tc_seconds; /* Second component of time code. */ unsigned int tc_pictures; /* Picture counter of time code. */ BOOLEAN closed_gop; /* Indicates no pred. vectors to previous group of pictures. */ BOOLEAN broken_link; /* B frame unable to be decoded. */ char *ext_data; /* Extension data. */ char *user_data; /* User data. */} GoP;/* Picture structure. */typedef struct pict { unsigned int temp_ref; /* Temporal reference. */ unsigned int code_type; /* Frame type: P, B, I */ unsigned int vbv_delay; /* Buffer delay. */ BOOLEAN full_pel_forw_vector; /* Forw. vectors specified in full pixel values flag. */ unsigned int forw_r_size; /* Used for vector decoding. */ unsigned int forw_f; /* Used for vector decoding. */ BOOLEAN full_pel_back_vector; /* Back vectors specified in full pixel values flag. */ unsigned int back_r_size; /* Used in decoding. */ unsigned int back_f; /* Used in decoding. */ char *extra_info; /* Extra bit picture info. */ char *ext_data; /* Extension data. */ char *user_data; /* User data. */} Pict;/* Slice structure. */typedef struct slice { unsigned int vert_pos; /* Vertical position of slice. */ unsigned int quant_scale; /* Quantization scale. */ char *extra_info; /* Extra bit slice info. */} Slice;/* Macroblock structure. */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -