📄 global.h
字号:
/* global.h, global variables *//* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. *//* * Disclaimer of Warranty * * These software programs are available to the user without any license fee or * royalty on an "as is" basis. The MPEG Software Simulation Group 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 MPEG Software Simulation Group does not represent or warrant that the * programs furnished hereunder are free of infringement of any third-party * patents. * * Commercial implementations of MPEG-1 and MPEG-2 video, 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. * */#include "windows.h"
#include <stdio.h>
#include <io.h>
#include "inttypes.h"
//#include "mpeg2dec.h"/* choose between declaration (GLOBAL undefined) * and definition (GLOBAL defined) * GLOBAL is defined in exactly one file mpeg2dec.c) */
// added by djhuang
/* code definition */
#define PICTURE_START_CODE 0x100
#define SLICE_START_CODE_MIN 0x101
#define SLICE_START_CODE_MAX 0x1AF
#define USER_DATA_START_CODE 0x1B2
#define SEQUENCE_HEADER_CODE 0x1B3
#define EXTENSION_START_CODE 0x1B5
#define SEQUENCE_END_CODE 0x1B7
#define GROUP_START_CODE 0x1B8
#define BUFFER_SIZE 2048
#define PRIVATE_STREAM_2 0x1BF
#define STORE_RGB24 1
#define STORE_YUY2 2
//#define BUFFER_SIZE 2048
#define PACK_START_CODE 0x1BA
#define CHROMA420 1
#define CHROMA422 2
#define CHROMA444 3
#define IDCT_MMX 1
#define IDCT_FPU 2
#define IDCT_REF 3
#define FO_NONE 0
#define FO_FILM 1
#define I_TYPE 1
#define P_TYPE 2
#define B_TYPE 3
unsigned short VOB_ID, CELL_ID;
/* ISO/IEC 13818-2 section 6.2.2.3: sequence_extension() */
int progressive_sequence;
int chroma_format;
/* ISO/IEC 13818-2 section 6.2.3: picture_header() */
int picture_coding_type;
int temporal_reference;
unsigned char *backward_reference_frame[3], *forward_reference_frame[3];
unsigned char *auxframe[3], *current_frame[3];
unsigned char *u422, *v422, *u444, *v444, *rgb24, *yuy2, *lum;
__int64 YUVRGB_Scale, YUVRGB_Offset, LumOffsetMask, LumGainMask;
int Coded_Picture_Width, Coded_Picture_Height, Chroma_Width, Chroma_Height;
float frame_rate, Frame_Rate;
int block_count, Second_Field;
/* decoder operation control flags */
int Check_Flag;
int Fault_Flag;
int Rip_Flag;
int Stop_Flag;
int FO_Flag;
int iDCT_Flag;
int Luminance_Flag;
int Scale_Flag;
int Store_Flag; // Store RGB24 or YUY2
int SystemStream_Flag;
BOOL gIsPictureDecoding;
BITMAPINFOHEADER birgb;
BITMAPINFOHEADER biyuv;
//unsigned char *u422, *v422, *u444, *v444, *rgb24, *yuy2, *lum;
int VideoPTS, AudioPTS;
//__int64 YUVRGB_Scale, YUVRGB_Offset, LumOffsetMask, LumGainMask;
int horizontal_size, vertical_size, mb_width, mb_height;
unsigned int hwidth, hwidthd8, dwidth, qwidth, hheightd2, qheightd2, nwidth;
int Bitrate_Meter;
#define ERROR_FLUSH 200
//BOOL gIsPictureDecoding;
BOOL gIsEOS; // Indicating no more data will be received
short *block[8]
#ifdef GLOBAL
=
{
0, 0, 0, 0, 0, 0, 0, 0
}
#endif
;
short *p_block[8]
#ifdef GLOBAL
=
{
0, 0, 0, 0, 0, 0, 0, 0
}
#endif
;
/* gethdr.c */
//int Get_Hdr(void);
//void next_start_code(void);
void sequence_header(void);
// int slice_header(void);
void Initialize_Reference_IDCT();
/* getpic.c */
// int Decode_Picture(void);
// int picture_coding_type;
unsigned int Frame_Number;
/*
void InitialDecoder (void);
int Decode_Bitstream (void);
void CheckSequenceHeader (void);
void InitSystem (void);
void UninitSystem (void);
*/void decode_mpeg2 (uint8_t * start, uint8_t * end);
BOOL My_decode_mpeg2 (uint8_t * start, uint8_t * end);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -