📄 ippvideoencodermpeg4.hpp
字号:
/* /////////////////////////////////////////////////////////////////////////// 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) 2003-2005 Intel Corporation. All Rights Reserved.//// Description: class ippVideoEncoderMPEG4//*/#include "ippvideobitstream.hpp"#include "ippdefs.h"#include "ipps.h"#include "ippi.h"#include "ippvc.h"#include "vm_debug.h"#pragma warning(disable : 4514) // unreferenced inline function has been removed/* MPEG-4 start code values */// ISO/IEC 14496-2: table 6-3enum { MP4_VIDEO_OBJECT_MIN_SC = 0x00, MP4_VIDEO_OBJECT_MAX_SC = 0x1F, MP4_VIDEO_OBJECT_LAYER_MIN_SC = 0x20, MP4_VIDEO_OBJECT_LAYER_MAX_SC = 0x2F, MP4_FGS_BP_MIN_SC = 0x40, MP4_FGS_BP_MAX_SC = 0x5F, MP4_VISUAL_OBJECT_SEQUENCE_SC = 0xB0, MP4_VISUAL_OBJECT_SEQUENCE_EC = 0xB1, MP4_USER_DATA_SC = 0xB2, MP4_GROUP_OF_VOP_SC = 0xB3, MP4_VIDEO_SESSION_ERROR_SC = 0xB4, MP4_VISUAL_OBJECT_SC = 0xB5, MP4_VIDEO_OBJECT_PLANE_SC = 0xB6, MP4_SLICE_SC = 0xB7, MP4_EXTENSION_SC = 0xB8, MP4_FGS_VOP_SC = 0xB9, MP4_FBA_OBJECT_SC = 0xBA, MP4_FBA_OBJECT_PLANE_SC = 0xBB, MP4_MESH_OBJECT_SC = 0xBC, MP4_MESH_OBJECT_PLANE_SC = 0xBD, MP4_STILL_TEXTURE_OBJECT_SC = 0xBE, MP4_TEXTURE_SPATIAL_LAYER_SC = 0xBF, MP4_TEXTURE_SNR_LAYER_SC = 0xC0, MP4_TEXTURE_TILE_SC = 0xC1, MP4_TEXTURE_SHAPE_LAYER_SC = 0xC2, MP4_STUFFING_SC = 0xC3};/* MPEG-4 code values */// ISO/IEC 14496-2:2004 table 6-6enum { MP4_VISUAL_OBJECT_TYPE_VIDEO = 1, MP4_VISUAL_OBJECT_TYPE_TEXTURE = 2, MP4_VISUAL_OBJECT_TYPE_MESH = 3, MP4_VISUAL_OBJECT_TYPE_FBA = 4, MP4_VISUAL_OBJECT_TYPE_3DMESH = 5};// ISO/IEC 14496-2:2004 table 6-7enum { MP4_VIDEO_FORMAT_COMPONENT = 0, MP4_VIDEO_FORMAT_PAL = 1, MP4_VIDEO_FORMAT_NTSC = 2, MP4_VIDEO_FORMAT_SECAM = 3, MP4_VIDEO_FORMAT_MAC = 4, MP4_VIDEO_FORMAT_UNSPECIFIED = 5};// ISO/IEC 14496-2:2004 table 6-8..10enum { MP4_VIDEO_COLORS_FORBIDDEN = 0, MP4_VIDEO_COLORS_ITU_R_BT_709 = 1, MP4_VIDEO_COLORS_UNSPECIFIED = 2, MP4_VIDEO_COLORS_RESERVED = 3, MP4_VIDEO_COLORS_ITU_R_BT_470_2_M = 4, MP4_VIDEO_COLORS_ITU_R_BT_470_2_BG = 5, MP4_VIDEO_COLORS_SMPTE_170M = 6, MP4_VIDEO_COLORS_SMPTE_240M = 7, MP4_VIDEO_COLORS_GENERIC_FILM = 8};// ISO/IEC 14496-2:2004 table 6-11enum { MP4_VIDEO_OBJECT_TYPE_SIMPLE = 1, MP4_VIDEO_OBJECT_TYPE_SIMPLE_SCALABLE = 2, MP4_VIDEO_OBJECT_TYPE_CORE = 3, MP4_VIDEO_OBJECT_TYPE_MAIN = 4, MP4_VIDEO_OBJECT_TYPE_NBIT = 5, MP4_VIDEO_OBJECT_TYPE_2DTEXTURE = 6, MP4_VIDEO_OBJECT_TYPE_2DMESH = 7, MP4_VIDEO_OBJECT_TYPE_SIMPLE_FACE = 8, MP4_VIDEO_OBJECT_TYPE_STILL_SCALABLE_TEXTURE = 9, MP4_VIDEO_OBJECT_TYPE_ADVANCED_REAL_TIME_SIMPLE = 10, MP4_VIDEO_OBJECT_TYPE_CORE_SCALABLE = 11, MP4_VIDEO_OBJECT_TYPE_ADVANCED_CODING_EFFICIENCY = 12, MP4_VIDEO_OBJECT_TYPE_ADVANCED_SCALABLE_TEXTURE = 13, MP4_VIDEO_OBJECT_TYPE_SIMPLE_FBA = 14, MP4_VIDEO_OBJECT_TYPE_SIMPLE_STUDIO = 15, MP4_VIDEO_OBJECT_TYPE_CORE_STUDIO = 16, MP4_VIDEO_OBJECT_TYPE_ADVANCED_SIMPLE = 17, MP4_VIDEO_OBJECT_TYPE_FINE_GRANULARITY_SCALABLE = 18};// ISO/IEC 14496-2:2004 table 6-14enum { MP4_ASPECT_RATIO_FORBIDDEN = 0, MP4_ASPECT_RATIO_1_1 = 1, MP4_ASPECT_RATIO_12_11 = 2, MP4_ASPECT_RATIO_10_11 = 3, MP4_ASPECT_RATIO_16_11 = 4, MP4_ASPECT_RATIO_40_33 = 5, MP4_ASPECT_RATIO_EXTPAR = 15};// ISO/IEC 14496-2:2004 table 6-15#define MP4_CHROMA_FORMAT_420 1// ISO/IEC 14496-2:2004 table 6-16enum { MP4_SHAPE_TYPE_RECTANGULAR = 0, MP4_SHAPE_TYPE_BINARY = 1, MP4_SHAPE_TYPE_BINARYONLY = 2, MP4_SHAPE_TYPE_GRAYSCALE = 3};// ISO/IEC 14496-2:2004 table 6-19#define MP4_SPRITE_STATIC 1#define MP4_SPRITE_GMC 2// ISO/IEC 14496-2:2004 table 6-24enum { MP4_VOP_TYPE_I = 0, MP4_VOP_TYPE_P = 1, MP4_VOP_TYPE_B = 2, MP4_VOP_TYPE_S = 3};// ISO/IEC 14496-2:2004 table 6-26enum { MP4_SPRITE_TRANSMIT_MODE_STOP = 0, MP4_SPRITE_TRANSMIT_MODE_PIECE = 1, MP4_SPRITE_TRANSMIT_MODE_UPDATE = 2, MP4_SPRITE_TRANSMIT_MODE_PAUSE = 3};/* Block Info */struct mp4_Block { mp4_Block *predA; mp4_Block *predB; mp4_Block *predC; Ipp16s dct_acA[8]; Ipp16s dct_acC[8]; Ipp16s dct_dc; Ipp16s dct_dcq; Ipp8u quant; Ipp8u validPredIntra;};/* MacroBlock Info */struct mp4_MacroBlock { IppMotionVector mv[4]; Ipp32s lumaErr; mp4_Block block[6]; Ipp8u type; Ipp8u not_coded; Ipp8u validPredInter; Ipp8u mcsel;};/* Video Object Plane Info */struct mp4_VideoObjectPlane { int vop_coding_type; int modulo_time_base; int vop_time_increment; int vop_coded; int vop_id; // verid != 1 (newpred) int vop_id_for_prediction_indication; // verid != 1 (newpred) int vop_id_for_prediction; // verid != 1 (newpred) int vop_rounding_type; int vop_reduced_resolution; // verid != 1 int vop_width; int vop_height; int vop_horizontal_mc_spatial_ref; int vop_vertical_mc_spatial_ref; int background_composition; int change_conv_ratio_disable; int vop_constant_alpha; int vop_constant_alpha_value; // complexity Estimation int dcecs_opaque; int dcecs_transparent; int dcecs_intra_cae; int dcecs_inter_cae; int dcecs_no_update; int dcecs_upsampling; int dcecs_intra_blocks; int dcecs_inter_blocks; int dcecs_inter4v_blocks; int dcecs_not_coded_blocks; int dcecs_dct_coefs; int dcecs_dct_lines; int dcecs_vlc_symbols; int dcecs_vlc_bits; int dcecs_apm; int dcecs_npm; int dcecs_interpolate_mc_q; int dcecs_forw_back_mc_q; int dcecs_halfpel2; int dcecs_halfpel4; int dcecs_sadct; // verid != 1 int dcecs_quarterpel; // verid != 1 int intra_dc_vlc_thr; int top_field_first; int alternate_vertical_scan_flag; int sprite_transmit_mode; int warping_mv_code_du[4]; int warping_mv_code_dv[4]; int brightness_change_factor; int vop_quant; int vop_alpha_quant; int vop_fcode_forward; int vop_fcode_backward; int vop_shape_coding_type; // scalability info is absent // short header int temporal_reference; int temporal_reference_increment; int split_screen_indicator; int document_camera_indicator; int full_picture_freeze_release; int source_format; int picture_coding_type; int gob_number; int num_gobs_in_vop; int num_macroblocks_in_gob; int gob_header_empty; int gob_frame_id; int quant_scale; int gob_resync;};/* Video Object Info */struct mp4_VideoObjectLayer {// iso part int video_object_layer_id; int short_video_header; int random_accessible_vol; int video_object_type_indication; int is_object_layer_identifier; int video_object_layer_verid; int video_object_layer_priority; int aspect_ratio_info; int par_width; int par_height; int vol_control_parameters; int chroma_format; int low_delay; int vbv_parameters; int first_half_bit_rate; int latter_half_bit_rate; int first_half_vbv_buffer_size; int latter_half_vbv_buffer_size; int first_half_vbv_occupancy; int latter_half_vbv_occupancy; int video_object_layer_shape; int video_object_layer_shape_extension; // verid != 1 int vop_time_increment_resolution; int vop_time_increment_resolution_bits; int fixed_vop_rate; int fixed_vop_time_increment; int video_object_layer_width; int video_object_layer_height; int interlaced; int obmc_disable; int sprite_enable; // if verid != 1 (2 bit GMC is added) int sprite_width; int sprite_height; int sprite_left_coordinate; int sprite_top_coordinate; int no_of_sprite_warping_points; int sprite_warping_accuracy; int sprite_brightness_change; int low_latency_sprite_enable; int sadct_disable; // verid != 1 int not_8_bit; int quant_precision; int bits_per_pixel; int no_gray_quant_update; int composition_method; int linear_composition; int quant_type; int load_intra_quant_mat; int load_intra_quant_mat_len; Ipp8u intra_quant_mat[64]; int load_nonintra_quant_mat; int load_nonintra_quant_mat_len; Ipp8u nonintra_quant_mat[64]; int quarter_sample; // verid != 1 int complexity_estimation_disable; int estimation_method; int shape_complexity_estimation_disable; int opaque; int transparent; int intra_cae; int inter_cae; int no_update; int upsampling; int texture_complexity_estimation_set_1_disable; int intra_blocks; int inter_blocks; int inter4v_blocks; int not_coded_blocks; int texture_complexity_estimation_set_2_disable; int dct_coefs; int dct_lines; int vlc_symbols; int vlc_bits; int motion_compensation_complexity_disable; int apm; int npm; int interpolate_mc_q; int forw_back_mc_q; int halfpel2; int halfpel4; int version2_complexity_estimation_disable; // verid != 1 int sadct; // verid != 1 int quarterpel; // verid != 1 int resync_marker_disable; int data_partitioned; int reversible_vlc; int newpred_enable; // verid != 1 int requested_upstream_message_type;// verid != 1 int newpred_segment_type; // verid != 1 int reduced_resolution_vop_enable; // verid != 1 int scalability; int hierarchy_type; int ref_layer_id; int ref_layer_sampling_direct; int hor_sampling_factor_n; int hor_sampling_factor_m; int vert_sampling_factor_n; int vert_sampling_factor_m; int enhancement_type; int use_ref_shape; int use_ref_texture; int shape_hor_sampling_factor_n; int shape_hor_sampling_factor_m; int shape_vert_sampling_factor_n; int shape_vert_sampling_factor_m;};/* Group Of Video Object Plane Info */struct mp4_GroupOfVideoObjectPlane { int time_code; int closed_gov; int broken_link;};/* StillTexture Object Info */struct mp4_StillTextureObject { int dummy;};/* Mesh Object Info */struct mp4_MeshObject { int dummy;};/* Face Object Info */struct mp4_FaceObject { int dummy;};/* Visual Object Info */struct mp4_VisualObject { int is_visual_object_identifier; int visual_object_verid; int visual_object_priority; int visual_object_type; int video_signal_type; int video_format; int video_range; int colour_description; int colour_primaries; int transfer_characteristics; int matrix_coefficients;};/* Visual Object Sequence Info */struct mp4_VisualObjectSequence { int profile_and_level_indication;};struct mp4_Param{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -