📄 mp4.h
字号:
MP4_BAB_TYPE_MVDSNZ_INTERCAE = 6
};
#define MP4_DC_MARKER 0x6B001 // 110 1011 0000 0000 0001
#define MP4_MV_MARKER 0x1F001 // 1 1111 0000 0000 0001
// ISO/IEC 14496-2:2004 table G.1
enum {
MP4_SIMPLE_PROFILE_LEVEL_1 = 0x01,
MP4_SIMPLE_PROFILE_LEVEL_2 = 0x02,
MP4_SIMPLE_PROFILE_LEVEL_3 = 0x03,
MP4_SIMPLE_PROFILE_LEVEL_0 = 0x08,
MP4_SIMPLE_SCALABLE_PROFILE_LEVEL_0 = 0x10,
MP4_SIMPLE_SCALABLE_PROFILE_LEVEL_1 = 0x11,
MP4_SIMPLE_SCALABLE_PROFILE_LEVEL_2 = 0x12,
MP4_CORE_PROFILE_LEVEL_1 = 0x21,
MP4_CORE_PROFILE_LEVEL_2 = 0x22,
MP4_MAIN_PROFILE_LEVEL_2 = 0x32,
MP4_MAIN_PROFILE_LEVEL_3 = 0x33,
MP4_MAIN_PROFILE_LEVEL_4 = 0x34,
MP4_NBIT_PROFILE_LEVEL_2 = 0x42,
MP4_SCALABLE_TEXTURE_PROFILE_LEVEL_1 = 0x51,
MP4_SIMPLE_FACE_ANIMATION_PROFILE_LEVEL_1 = 0x61,
MP4_SIMPLE_FACE_ANIMATION_PROFILE_LEVEL_2 = 0x62,
MP4_SIMPLE_FBA_PROFILE_LEVEL_1 = 0x63,
MP4_SIMPLE_FBA_PROFILE_LEVEL_2 = 0x64,
MP4_BASIC_ANIMATED_TEXTURE_PROFILE_LEVEL_1 = 0x71,
MP4_BASIC_ANIMATED_TEXTURE_PROFILE_LEVEL_2 = 0x72,
MP4_HYBRID_PROFILE_LEVEL_1 = 0x81,
MP4_HYBRID_PROFILE_LEVEL_2 = 0x82,
MP4_ADVANCED_REAL_TIME_SIMPLE_PROFILE_LEVEL_1 = 0x91,
MP4_ADVANCED_REAL_TIME_SIMPLE_PROFILE_LEVEL_2 = 0x92,
MP4_ADVANCED_REAL_TIME_SIMPLE_PROFILE_LEVEL_3 = 0x93,
MP4_ADVANCED_REAL_TIME_SIMPLE_PROFILE_LEVEL_4 = 0x94,
MP4_CORE_SCALABLE_PROFILE_LEVEL_1 = 0xA1,
MP4_CORE_SCALABLE_PROFILE_LEVEL_2 = 0xA2,
MP4_CORE_SCALABLE_PROFILE_LEVEL_3 = 0xA3,
MP4_ADVANCED_CODING_EFFICIENCY_PROFILE_LEVEL_1 = 0xB1,
MP4_ADVANCED_CODING_EFFICIENCY_PROFILE_LEVEL_2 = 0xB2,
MP4_ADVANCED_CODING_EFFICIENCY_PROFILE_LEVEL_3 = 0xB3,
MP4_ADVANCED_CODING_EFFICIENCY_PROFILE_LEVEL_4 = 0xB4,
MP4_ADVANCED_CORE_PROFILE_LEVEL_1 = 0xC1,
MP4_ADVANCED_CORE_PROFILE_LEVEL_2 = 0xC2,
MP4_ADVANCED_SCALABLE_TEXTURE_PROFILE_LEVEL_1 = 0xD1,
MP4_ADVANCED_SCALABLE_TEXTURE_PROFILE_LEVEL_2 = 0xD2,
MP4_ADVANCED_SCALABLE_TEXTURE_PROFILE_LEVEL_3 = 0xD3,
MP4_SIMPLE_STUDIO_PROFILE_LEVEL_1 = 0xE1,
MP4_SIMPLE_STUDIO_PROFILE_LEVEL_2 = 0xE2,
MP4_SIMPLE_STUDIO_PROFILE_LEVEL_3 = 0xE3,
MP4_SIMPLE_STUDIO_PROFILE_LEVEL_4 = 0xE4,
MP4_CORE_STUDIO_PROFILE_LEVEL_1 = 0xE5,
MP4_CORE_STUDIO_PROFILE_LEVEL_2 = 0xE6,
MP4_CORE_STUDIO_PROFILE_LEVEL_3 = 0xE7,
MP4_CORE_STUDIO_PROFILE_LEVEL_4 = 0xE8,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_0 = 0xF0,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_1 = 0xF1,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_2 = 0xF2,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_3 = 0xF3,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_4 = 0xF4,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_5 = 0xF5,
MP4_ADVANCED_SIMPLE_PROFILE_LEVEL_3B = 0xF7,
MP4_FGS_PROFILE_LEVEL_0 = 0xF8,
MP4_FGS_PROFILE_LEVEL_1 = 0xF9,
MP4_FGS_PROFILE_LEVEL_2 = 0xFA,
MP4_FGS_PROFILE_LEVEL_3 = 0xFB,
MP4_FGS_PROFILE_LEVEL_4 = 0xFC,
MP4_FGS_PROFILE_LEVEL_5 = 0xFD
};
/* Frame Info */
typedef struct _mp4_Frame {
Ipp8u* apY; // allocated with border
Ipp8u* apCb; // allocated with border
Ipp8u* apCr; // allocated with border
Ipp32s stepY;
Ipp32s stepCr;
Ipp32s stepCb;
Ipp8u* pY; // real pointer
Ipp8u* pCb; // real pointer
Ipp8u* pCr; // real pointer
Ipp32s type;
Ipp64s time;
Ipp32s mbPerRow; // info for realloc VOP with Shape
Ipp32s mbPerCol;
Ipp8u* apB; // for binary mask
Ipp8u* pB;
Ipp8u* apA[3]; // for aux components
Ipp8u* pA[3];
Ipp32u mid;
} mp4_Frame;
/* Block Info for Intra Prediction */
typedef struct _mp4_IntraPredBlock {
struct _mp4_IntraPredBlock *predA;
struct _mp4_IntraPredBlock *predB;
struct _mp4_IntraPredBlock *predC;
Ipp16s dct_acA[8];
Ipp16s dct_acC[8];
Ipp16s dct_dc;
} mp4_IntraPredBlock;
/* Buffer for Intra Prediction */
typedef struct _mp4_IntraPredBuff {
Ipp8u *quant; // quant buffer;
mp4_IntraPredBlock dcB[6]; // blocks for Left-Top DC only
mp4_IntraPredBlock *block;
} mp4_IntraPredBuff;
/* MacroBlock Info Data Partitioned mode */
typedef struct _mp4_DataPartMacroBlock {
Ipp16s dct_dc[6];
Ipp8u type;
Ipp8u not_coded;
Ipp8u mcsel;
Ipp8u ac_pred_flag;
Ipp8u pat;
Ipp8u quant;
} mp4_DataPartMacroBlock;
/* MacroBlock Info for Motion */
typedef struct _mp4_MacroBlock {
IppMotionVector mv[4];
Ipp8u validPred; // for MV pred, OBMC
Ipp8u type; // for OBMC, BVOP
Ipp8u not_coded; // for OBMC, BVOP
Ipp8u field_info; // for Interlaced BVOP Direct mode
} mp4_MacroBlock;
/* Group Of Video Object Plane Info */
typedef struct _mp4_GroupOfVideoObjectPlane {
Ipp64s time_code;
Ipp32s closed_gov;
Ipp32s broken_link;
} mp4_GroupOfVideoObjectPlane;
/* Video Object Plane Info */
typedef struct _mp4_VideoObjectPlane {
Ipp32s coding_type;
Ipp32s modulo_time_base;
Ipp32s time_increment;
Ipp32s coded;
Ipp32s id; // verid != 1 (newpred)
Ipp32s id_for_prediction_indication; // verid != 1 (newpred)
Ipp32s id_for_prediction; // verid != 1 (newpred)
Ipp32s rounding_type;
Ipp32s reduced_resolution; // verid != 1
Ipp32s vop_width;
Ipp32s vop_height;
Ipp32s vop_horizontal_mc_spatial_ref;
Ipp32s vop_vertical_mc_spatial_ref;
Ipp32s background_composition;
Ipp32s change_conv_ratio_disable;
Ipp32s vop_constant_alpha;
Ipp32s vop_constant_alpha_value;
Ipp32s intra_dc_vlc_thr;
Ipp32s top_field_first;
Ipp32s alternate_vertical_scan_flag;
Ipp32s sprite_transmit_mode;
Ipp32s warping_mv_code_du[4];
Ipp32s warping_mv_code_dv[4];
Ipp32s brightness_change_factor;
Ipp32s quant;
Ipp32s alpha_quant[3];
Ipp32s fcode_forward;
Ipp32s fcode_backward;
Ipp32s shape_coding_type;
Ipp32s load_backward_shape;
Ipp32s ref_select_code;
Ipp32s dx;
Ipp32s dy;
Ipp32s quant_scale;
Ipp32s macroblock_num;
Ipp32s vop_id;
Ipp32s vop_id_for_prediction_indication;
Ipp32s vop_id_for_prediction;
} mp4_VideoObjectPlane;
/* mp4_ComplexityEstimation Info */
typedef struct _mp4_ComplexityEstimation {
Ipp32s estimation_method;
Ipp32s shape_complexity_estimation_disable;
Ipp32s opaque;
Ipp32s transparent;
Ipp32s intra_cae;
Ipp32s inter_cae;
Ipp32s no_update;
Ipp32s upsampling;
Ipp32s texture_complexity_estimation_set_1_disable;
Ipp32s intra_blocks;
Ipp32s inter_blocks;
Ipp32s inter4v_blocks;
Ipp32s not_coded_blocks;
Ipp32s texture_complexity_estimation_set_2_disable;
Ipp32s dct_coefs;
Ipp32s dct_lines;
Ipp32s vlc_symbols;
Ipp32s vlc_bits;
Ipp32s motion_compensation_complexity_disable;
Ipp32s apm;
Ipp32s npm;
Ipp32s interpolate_mc_q;
Ipp32s forw_back_mc_q;
Ipp32s halfpel2;
Ipp32s halfpel4;
Ipp32s version2_complexity_estimation_disable; // verid != 1
Ipp32s sadct; // verid != 1
Ipp32s quarterpel; // verid != 1
Ipp32s dcecs_opaque;
Ipp32s dcecs_transparent;
Ipp32s dcecs_intra_cae;
Ipp32s dcecs_inter_cae;
Ipp32s dcecs_no_update;
Ipp32s dcecs_upsampling;
Ipp32s dcecs_intra_blocks;
Ipp32s dcecs_inter_blocks;
Ipp32s dcecs_inter4v_blocks;
Ipp32s dcecs_not_coded_blocks;
Ipp32s dcecs_dct_coefs;
Ipp32s dcecs_dct_lines;
Ipp32s dcecs_vlc_symbols;
Ipp32s dcecs_vlc_bits;
Ipp32s dcecs_apm;
Ipp32s dcecs_npm;
Ipp32s dcecs_interpolate_mc_q;
Ipp32s dcecs_forw_back_mc_q;
Ipp32s dcecs_halfpel2;
Ipp32s dcecs_halfpel4;
Ipp32s dcecs_sadct; // verid != 1
Ipp32s dcecs_quarterpel; // verid != 1
} mp4_ComplexityEstimation;
/* mp4_Scalability Info */
typedef struct _mp4_ScalabilityParameters {
Ipp32s dummy;
} mp4_ScalabilityParameters;
/* VOLControlParameters Info */
typedef struct _mp4_VOLControlParameters {
Ipp32s chroma_format;
Ipp32s low_delay;
Ipp32s vbv_parameters;
Ipp32s bit_rate;
Ipp32s vbv_buffer_size;
Ipp32s vbv_occupancy;
} mp4_VOLControlParameters;
/* Video Object Plane with Ipp16s header Info */
typedef struct _mp4_VideoObjectPlaneH263 {
Ipp32s temporal_reference;
Ipp32s split_screen_indicator;
Ipp32s document_camera_indicator;
Ipp32s full_picture_freeze_release;
Ipp32s source_format;
Ipp32s picture_coding_type;
Ipp32s vop_quant;
Ipp32s gob_number;
Ipp32s num_gobs_in_vop;
Ipp32s num_macroblocks_in_gob;
Ipp32s gob_header_empty;
Ipp32s gob_frame_id;
Ipp32s quant_scale;
Ipp32s num_rows_in_gob;
#ifdef _OMP_KARABAS
Ipp32s nmb;
Ipp32s frGOB;
#endif // _OMP_KARABAS
} mp4_VideoObjectPlaneH263;
/* Video Object Info */
typedef struct _mp4_VideoObject {
// iso part
Ipp32s id;
Ipp32s short_video_header;
Ipp32s random_accessible_vol;
Ipp32s type_indication;
Ipp32s is_identifier;
Ipp32s verid;
Ipp32s priority;
Ipp32s aspect_ratio_info;
Ipp32s aspect_ratio_info_par_width;
Ipp32s aspect_ratio_info_par_height;
Ipp32s is_vol_control_parameters;
mp4_VOLControlParameters VOLControlParameters;
Ipp32s shape;
Ipp32s shape_extension; // verid != 1
Ipp32s vop_time_increment_resolution;
Ipp32s vop_time_increment_resolution_bits;
Ipp32s fixed_vop_rate;
Ipp32s fixed_vop_time_increment;
Ipp32s width;
Ipp32s height;
Ipp32s interlaced;
Ipp32s obmc_disable;
Ipp32s sprite_enable; // if verid != 1 (2 bit GMC is added)
Ipp32s sprite_width;
Ipp32s sprite_height;
Ipp32s sprite_left_coordinate;
Ipp32s sprite_top_coordinate;
Ipp32s sprite_warping_points;
Ipp32s sprite_warping_accuracy;
Ipp32s sprite_brightness_change;
Ipp32s low_latency_sprite_enable;
Ipp32s sadct_disable; // verid != 1
Ipp32s not_8_bit;
Ipp32s quant_precision;
Ipp32s bits_per_pixel;
Ipp32s no_gray_quant_update;
Ipp32s composition_method;
Ipp32s linear_composition;
Ipp32s quant_type;
Ipp32s load_intra_quant_mat;
Ipp8u intra_quant_mat[64];
Ipp32s load_nonintra_quant_mat;
Ipp8u nonintra_quant_mat[64];
Ipp32s load_intra_quant_mat_grayscale[3];
Ipp8u intra_quant_mat_grayscale[3][64];
Ipp32s load_nonintra_quant_mat_grayscale[3];
Ipp8u nonintra_quant_mat_grayscale[3][64];
Ipp32s quarter_sample; // verid != 1
Ipp32s complexity_estimation_disable;
mp4_ComplexityEstimation ComplexityEstimation;
Ipp32s resync_marker_disable;
Ipp32s data_partitioned;
Ipp32s reversible_vlc;
Ipp32s newpred_enable; // verid != 1
Ipp32s requested_upstream_message_type;// verid != 1
Ipp32s newpred_segment_type; // verid != 1
Ipp32s reduced_resolution_vop_enable; // verid != 1
Ipp32s scalability;
mp4_ScalabilityParameters ScalabilityParameters;
mp4_GroupOfVideoObjectPlane GroupOfVideoObjectPlane;
mp4_VideoObjectPlane VideoObjectPlane;
mp4_VideoObjectPlaneH263 VideoObjectPlaneH263;
// app part
Ipp32s VOPindex;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -