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

📄 tmaltm2vdecmpeg.h

📁 用于TM1300/PNX1300系列DSP(主要用于视频处理)的外部设备的源码
💻 H
字号:
/*
 * Copyright (c) 1997,1998 by TriMedia Technologies. 
 *
 * +------------------------------------------------------------------+
 * | This software is furnished under a license and may only be used  |
 * | and copied in accordance with the terms and conditions of  such  |
 * | a license and with the inclusion of this copyright notice. This  |
 * | software or any other copies of this software may not be provided|
 * | or otherwise made available to any other person.  The ownership  |
 * | and title of this software is not transferred.                   |
 * |                                                                  |
 * | The information in this software is subject  to change without   |
 * | any  prior notice and should not be construed as a commitment by |
 * | TriMedia Technologies.                                           |
 * |                                                                  |
 * | this code and information is provided "as is" without any        |
 * | warranty of any kind, either expressed or implied, including but |
 * | not limited to the implied warranties of merchantability and/or  |
 * | fitness for any particular purpose.                              |
 * +------------------------------------------------------------------+
 *
 *  Module name              : tmalTm2VdecMpeg.h    1.5
 *
 *  Last update              : 13:59:53 - 98/12/23
 *
 *  Description              :
 *
 */
/* 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.
 *
 */

#ifndef _TMALTM2VDECMPEG_H_
#define _TMALTM2VDECMPEG_H_

#include <tm1/tmMP.h>

#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 SEQUENCE_ERROR_CODE     0x1B4
#define EXTENSION_START_CODE    0x1B5
#define SEQUENCE_END_CODE       0x1B7
#define GROUP_START_CODE        0x1B8

/* picture coding type */
#define I_TYPE 1
#define P_TYPE 2
#define B_TYPE 3
#define D_TYPE 4

/* picture structure */
#define TOP_FIELD     1
#define BOTTOM_FIELD  2
#define FRAME_PICTURE 3

/* mv_format */
#define MV_FIELD 0
#define MV_FRAME 1

/* chroma_format */
#define CHROMA420 1
#define CHROMA422 2
#define CHROMA444 3

/* extension start code IDs */

#define SEQUENCE_EXTENSION_ID                    1
#define SEQUENCE_DISPLAY_EXTENSION_ID            2
#define QUANT_MATRIX_EXTENSION_ID                3
#define COPYRIGHT_EXTENSION_ID                   4
#define SEQUENCE_SCALABLE_EXTENSION_ID           5
#define PICTURE_DISPLAY_EXTENSION_ID             7
#define PICTURE_CODING_EXTENSION_ID              8
#define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID    9
#define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID  10

#define ZIG_ZAG                                  0

/* Layers: used by Verbose_Flag, Verifier_Flag, Stats_Flag, and Trace_Flag */
#define NO_LAYER                                0
#define SEQUENCE_LAYER                          1
#define PICTURE_LAYER                           2
#define SLICE_LAYER                             3    
#define MACROBLOCK_LAYER                        4    
#define BLOCK_LAYER                             5
#define EVENT_LAYER                             6
#define ALL_LAYERS                              7


typedef enum{
  VDEC_MPEG_CALLBACK_OK = 0,
  VDEC_MPEG_SLICE_FAIL  = 1,
  VDEC_MPEG_ERROR_FAIL  = 2,
  VDEC_MPEG_EMPTY_FAIL  = 4,
  VDEC_MPEG_DONE_FAIL   = 8,
  VDEC_MPEG_SLICE_ERROR = 16
  
} tmalVdecMpegTm2Error_t;


typedef struct _mpegHdrs {
/* slice_header() */
 int quantizer_scale_code;

/* ISO/IEC 13818-2 section 6.2.2.1:  sequence_header() */
 int horizontal_size;
 int vertical_size;
 int aspect_ratio_information;
 int frame_rate_code; 
 int bit_rate_value; 
 int vbv_buffer_size;
 int constrained_parameters_flag;
 int intra_quantizer_matrix[64];
 int non_intra_quantizer_matrix[64];
 int load_intra_quantizer_matrix;
 int load_non_intra_quantizer_matrix;
 int MPEG2_Flag;

/* ISO/IEC 13818-2 section 6.2.2.3:  sequence_extension() */
 int profile_and_level_indication;
 int progressive_sequence;
 int chroma_format;
 int low_delay;
 int frame_rate_extension_n;
 int frame_rate_extension_d;

/* ISO/IEC 13818-2 section 6.2.2.4:  sequence_display_extension() */
 int video_format;  
 int color_description;
 int color_primaries;
 int transfer_characteristics;
 int matrix_coefficients;
 int display_horizontal_size;
 int display_vertical_size;

/* ISO/IEC 13818-2 section 6.2.3: picture_header() */
 int temporal_reference;
 int picture_coding_type;
 int vbv_delay;
 int full_pel_forward_vector;
 int forward_f_code;
 int full_pel_backward_vector;
 int backward_f_code;

/* ISO/IEC 13818-2 section 6.2.3.1: picture_coding_extension() header */
 int f_code[2][2];
 int intra_dc_precision;
 int picture_structure;
 int top_field_first;
 int frame_pred_frame_dct;
 int concealment_motion_vectors;
 int intra_vlc_format;
 int q_scale_type;
 int alternate_scan;
 int intra_slice;
 int repeat_first_field;
 int chroma_420_type;
 int progressive_frame;
 int composite_display_flag;
 int v_axis;
 int field_sequence;
 int sub_carrier;
 int burst_amplitude;
 int sub_carrier_phase;

/* ISO/IEC 13818-2 section 6.2.3.3: picture_display_extension() header */
 int frame_center_horizontal_offset[3];
 int frame_center_vertical_offset[3];

/* ISO/IEC 13818-2 section 6.2.3.6: copyright_extension() header */
 int copyright_flag;
 int copyright_identifier;
 int original_or_copy;
 int copyright_number_1;
 int copyright_number_2;
 int copyright_number_3;

/* ISO/IEC 13818-2 section 6.2.2.6: group_of_pictures_header()  */
 int drop_flag;
 int hour;
 int minute;
 int sec;
 int frame;
 int closed_gop;
 int broken_link;
} tmMPEGHdr_t, *ptmMPEGHdr_t;

typedef struct _tm2MpegDecInstVars {
  int pipeInstance;
  int bitstreamFramenum;
  int sequenceFramenum;
  unsigned long slice_start_code;
  tmMpCallbackStat_t callbackError;
  unsigned long *backwardReferenceFrame[2][2];
  unsigned long *forwardReferenceFrame[2][2];
  unsigned long *bFrame1[2][2];
  unsigned long *bFrame2[2][2];
  unsigned long *currentFrame[2][2];
  int codedPictureWidth;
  int lineSize;
  int codedPictureHeight;
  int MBWidth;
  int MBHeight;
  int pictureHeight;
  int secondField;
  volatile Bool mpDone;
  volatile Bool mpEmpty;
  unsigned long *prevDMAAddr;
  unsigned long prevDMACount;
  Bool formatChange;
  /* control flags */
  int halfResMode;
  int noYVertHalfPel;
  int noUVVertHalfPel;
  int noBackwardMC; 
  unsigned long IQSel0;
  unsigned long IQSel1;
  tmMPEGHdr_t   ph;
} tm2MpegDecInstVars_t, *ptm2MpegDecInstVars_t;

#endif

⌨️ 快捷键说明

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