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

📄 umc_mp4_parser.h

📁 audio-video-codecs.rar语音编解码器
💻 H
📖 第 1 页 / 共 2 页
字号:
/*//////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2004-2007 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __UMC_MP4_PARSER_H__
#define __UMC_MP4_PARSER_H__

#include "vm_types.h"
#include "umc_data_reader.h"

/*******************DECLARATIONS TYPES********************/

namespace UMC
{

#define MAXTRACKS 1024

typedef struct
{
    Ipp64u start;         /* byte start in file */
    Ipp64u end;           /* byte endpoint in file */
    Ipp64u size;          /* number of byte in this box */
    bool   is_large_size; /* true if actual size is in largesize field, false otherwise */
    char   type[4];
} T_atom_mp4;

typedef struct
{
    float values[9];
} T_matrix_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    Ipp64u       creation_time;
    Ipp64u       modification_time;
    unsigned int    time_scale;
    Ipp64u       duration;
    float           preferred_rate;
    float           preferred_volume;
    char            reserved[10];
    T_matrix_data   matrix;
    long            preview_time;
    long            preview_duration;
    long            poster_time;
    long            selection_time;
    long            selection_duration;
    long            current_time;
    unsigned int    next_track_id;
} T_mvhd_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned short  objectDescriptorID;
    unsigned char   OD_profileAndLevel;
    unsigned char   scene_profileAndLevel;
    unsigned char   audioProfileId;
    unsigned char   videoProfileId;
    unsigned char   graphics_profileAndLevel;
} T_iods_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    Ipp64u       creation_time;
    Ipp64u       modification_time;
    unsigned int    track_id;
    long            reserved1;
    Ipp64u       duration;
    char            reserved2[8];
    int             layer;
    int             alternate_group;
    float           volume;
    long            reserved3;
    T_matrix_data   matrix;
    float           track_width;
    float           track_height;
    int             is_video;
    int             is_audio;
    int             is_hint;
} T_tkhd_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    Ipp64u       creation_time;
    Ipp64u       modification_time;
    unsigned int    time_scale;
    Ipp64u       duration;
    unsigned short  language;
    unsigned short  quality;
} T_mdhd_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    int             graphics_mode;
    int             opcolor[3];
} T_vmhd_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    int             balance;
    int             reserved;
} T_smhd_data;

/* hint media handler */
typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned short  maxPDUsize;
    unsigned short  avgPDUsize;
    unsigned int    maxbitrate;
    unsigned int    avgbitrate;
    unsigned int    slidingavgbitrate;
} T_hmhd_data;

typedef struct
{
    Ipp64u       start;
    unsigned char   version;
    int            flags;
    unsigned int    decoderConfigLen;
    unsigned char*  decoderConfig;

    unsigned char   objectTypeID;
    unsigned char   streamType;
    long            bufferSizeDB;
    unsigned int    maxBitrate;
    unsigned int    avgBitrate;

    unsigned short  es_ID;
    unsigned short  ocr_ID;
    unsigned char   streamDependenceFlag;
    unsigned char   urlflag;
    unsigned char   ocrflag;
    unsigned char   streamPriority;
    unsigned char*  URLString;
} T_esds_data;

typedef struct
{
    Ipp32s  decoderConfigLen;
    Ipp8u*  decoderConfig;
} T_damr_data;

typedef struct
{
    Ipp32s  decoderConfigLen;
    Ipp8u*  decoderConfig;
//    Ipp8u   m_nH264FrameIntraSize;
} T_avcC_data;

typedef struct
{
    char            format[4];
    char            reserved[6];
    unsigned short  data_reference;
/* common to audio and video */
    int             version;
    int             revision;
    char            vendor[4];
/* video description */
    long            temporal_quality;
    long            spatial_quality;
    unsigned short  width;
    unsigned short  height;
    unsigned int    dpi_horizontal;
    unsigned int    dpi_vertical;
    long            data_size;
    int             frames_per_sample;
    char            compressor_name[32];
    int             depth;
    int             ctab_id;
    float           gamma;
    int             fields;    /* 0, 1, or 2 */
    int             field_dominance;   /* 0 - unknown     1 - top first     2 - bottom first */
/* audio description */
    unsigned short  channels;
    unsigned short  sample_size;
    int             compression_id;
    int             packet_size;
    unsigned int    sample_rate;
    unsigned int    is_protected;
/* hint description */
    int             maxPktSize;
/* MP4 elementary stream descriptor */
    T_esds_data     esds;
/* ARM elementary stream descriptor */
    T_damr_data     damr;
/* avc elementary stream descriptor */
    T_avcC_data     avcC;

} T_stsd_table_data;

typedef struct
{
    unsigned char       version;
    long                flags;
    unsigned int       total_entries;
    T_stsd_table_data * table;
} T_stsd_data;

typedef struct
{
    unsigned int        sample_count;
    unsigned int        sample_duration;
} T_stts_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    total_entries;
/////    long            entries_allocated;
    T_stts_table_data *table;
} T_stts_data;

/* sync sample */
typedef struct
{
    Ipp32u        sample_number;
} T_stss_table_data;

typedef struct
{
    unsigned char  version;
    long flags;
    Ipp32u total_entries;
/////    long entries_allocated;
    T_stss_table_data *table;
} T_stss_data;

/* sample to chunk */
typedef struct
{
    unsigned int chunk;
    unsigned int samples;
    unsigned int id;
    unsigned int first_sample;
} T_stsc_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    total_entries;
/////    unsigned int    entries_allocated;
    T_stsc_table_data *table;
} T_stsc_data;

/* sample size */
typedef struct
{
    unsigned int size;
} T_stsz_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    sample_size;
    unsigned int    total_entries;
    unsigned int    max_sample_size;
    T_stsz_table_data *table;
} T_stsz_data;

/* chunk offset */
typedef struct
{
    unsigned int offset;
} T_stco_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    total_entries;

/////    long            entries_allocated;
    T_stco_table_data *table;
} T_stco_data;

typedef struct
{
    Ipp64u offset;
} T_co64_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    total_entries;
    T_co64_table_data *table;
} T_co64_data;

/* composition time to sample */
typedef struct
{
    unsigned int   sample_count;
    unsigned int   sample_offset;
} T_ctts_table_data;

typedef struct
{
    unsigned char   version;
    long            flags;
    unsigned int    total_entries;
/////    long            entries_allocated;
    T_ctts_table_data *table;
} T_ctts_data;

/* sample table */
typedef struct
{
    int         version;
    long        flags;
    T_stsd_data stsd;
    T_stts_data stts;
    T_stss_data stss;
    T_stsc_data stsc;
    T_stsz_data stsz;
    T_stco_data stco;
    T_co64_data co64;
    T_ctts_data ctts;

⌨️ 快捷键说明

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