Улучшение отношения сигнал/шум при микшировании видео изображения, сжатого по стандарту MPEG2, страница 21

/// Sequence display extension structure

typedef struct sequence_display_ext_t

{

t_bool is_present;

t_ui8 video_format;

t_bool colour_description;

t_ui8 colour_primaries;

t_ui8 transfer_characterisitics;

t_ui8 matrix_coefficients;

t_ui16 display_horizontal_size;

t_ui16 display_vertical_size;

} sequence_display_ext_t;

/// Quant matrix extension structure

typedef struct quant_matrix_ext_t

{

t_bool is_present;

t_bool load_intra_quant_matrix;

t_bool load_non_intra_quant_matrix;

t_bool load_chroma_intra_quant_matrix;

t_bool load_chroma_non_intra_quant_matrix;

t_ui8 chroma_intra_quant_matrix[64];

t_ui8 chroma_non_intra_quant_matrix[64];

} quant_matrix_ext_t;

/// Picture coding extension structure

typedef struct picture_coding_ext_t

{

t_bool is_present;

t_ui8 f_code[2][2];

t_ui8 intra_dc_precision;

t_ui8 picture_structure;

t_bool top_field_first;

t_bool frame_pred_frame_dct;

t_bool concealment_motion_vectors;

t_bool q_scale_type;

t_bool intra_vlc_format;

t_bool alternate_scan;

t_bool repeat_first_field;

t_bool chroma_420_type;

t_bool progressive_frame;

t_bool composite_display_flag;

t_bool v_axis;

t_ui8 field_sequence;

t_ui32 sub_carrier;

t_ui8 burst_amplitude;

t_ui8 sub_carrier_phase;

} picture_coding_ext_t;

/// Picture display extension

typedef struct picture_display_ext_t

{

t_bool is_present;

t_ui32 number_of_frame_centre_offsets;

t_si16 frame_centre_horizontal_offset[3];

t_si16 frame_centre_vertical_offset[3];

} picture_display_ext_t;

/// Copyright extension structure

typedef struct copyright_ext_t

{

t_bool is_present;

t_bool copyright_flag;

t_ui8 copyright_identifier;

t_bool original_or_copy;

t_ui8 reserved;

t_ui32 copyright_number_1;

t_ui32 copyright_number_2;

t_ui32 copyright_number_3;

} copyright_ext_t;

/// MPEG2 data structure

typedef struct mpeg2_data_t

{

/// Headers

sequence_header_t sequence_header;

group_of_pictures_header_t group_of_pictures_header;

picture_header_t picture_header;

/// Extensions

sequence_ext_t sequence_extension;

sequence_display_ext_t sequence_display_extension;

quant_matrix_ext_t quant_matrix_extension;

picture_coding_ext_t picture_coding_extension;

picture_display_ext_t picture_display_extension;

copyright_ext_t copyright_extension;

} mpeg2_data_t;

////////////////////////////////// Common Data types //////////////////////////////////

/// Block processing input structure

typedef struct block_process_t

{

void *video_stream;

t_si16 *current_block;

t_bool intra_vlc_format;

t_bool alternate_scan;

t_ui8 *quant_matrix;

t_ui8 quantizer_scale;

} block_process_t;

/// Motion vector structure

typedef struct motion_vector_t

{

t_si32 x;

t_si32 y;

t_bool field;

} motion_vector_t;

/// Macroblock information

typedef struct macroblock_info_t

{

t_ui32 type;                                                     /// Type of macroblock 

t_ui8 quantizer_scale;

t_bool first_in_slice;                                     /// Macroblock is first in slice

t_bool dct_type;                                           /// Field OR Frame DCT

t_ui8 motion_type;                                               /// Type of motion compensation (see Defines of MC_FIELD, MC_FRAME...)

t_si32 dmvector[2];                                              /// Uses in Dual Motion Vector (DMV) prediction

motion_vector_t motion_vectors[2][2];                /// Motion vectors [Direction][Field]

} macroblock_info_t;

#endif // !_VSM2_VSM2_H

3.  vsm2dec_defines.h – Определение типов ошибок и предупреждений, выдаваемых декодером MPEG2.

/**

* @file vsm2dec_defines.h

* List of errors that could be occured during decoding process.

*

* - Copyright (c) 2002-2006, Vanguard Software Solutions, Inc.

* - Project: MPEG2 video decoder

**/

#ifndef _VSM2DEC_DEFINES_H

#define _VSM2DEC_DEFINES_H

/// DECODE MODE

#define VSM2DEC_DECODE_I_FRAMES                     1  /// Don't skip I frames decoding

#define VSM2DEC_DECODE_P_FRAMES                     2  /// Don't skip P frames decoding

#define VSM2DEC_DECODE_B_FRAMES                     4  /// Don't skip B frames decoding

#define VSM2DEC_DECODE_D_FRAMES                     8  /// Don't skip D frames decoding