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

/// ERROR TYPES

#define VSM2DEC_ERROR_OK                            0  /// No errors

#define VSM2DEC_ERROR_MARKER_BIT                    1  /// Wrong marker bit

#define VSM2DEC_ERROR_MACROBLOCK_ADDR_INC           2  /// Error of decoding next macroblock's address

#define VSM2DEC_ERROR_MACROBLOCK_TYPE               4  /// Error of decoding macroblock's type

#define VSM2DEC_ERROR_CODED_BLOCK_PATTERN           8  /// Error of decoding block's information

#define VSM2DEC_ERROR_VLD_AC_COEF                  16  /// VLD Error

#define VSM2DEC_ERROR_VLD_OVERFLOW                 32  /// VLD Error (Overflow)

#define VSM2DEC_ERROR_MOTION_VECTOR_INCORRECT      64  /// Error of decoding motion vector

#define VSM2DEC_ERROR_HANDLE                      128  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_256                256  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_512                512  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_1024              1024  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_2048              2048  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_4096              4096  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_8192              8192  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_16384            16384  /// Reserved error

#define VSM2DEC_ERROR_RESERVED_32768            32768  /// Reserved error

#define VSM2DEC_ERRORS_MAX                      65535  /// 16 types of errors reserved, warnings - others

/// WARNING TYPES

#define VSM2DEC_WARNING_BAD_REFERENCE_FRAME     65536  /// Reference frame has errors

#endif // !_VSM2DEC_DEFINES_H

  1. vsm2dec_api.h – API декодера.

/**

* @file dec_api.h

* Decoder public API implementation.

*

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

* - Project: MPEG2 video decoder

**/

#ifndef _VSM2DEC_DEC_API_H

#define _VSM2DEC_DEC_API_H

#ifdef __cplusplus

extern "C" {

#endif

#include "vsm2_stypes.h"

#include "vsm2.h"

#include "vsm2dec_defines.h"

////////////////////////////////// Decoder structures ////////////////////////////

typedef struct vsm2dec_options_t

{

t_ui32 decode_type;

} vsm2dec_options_t;

typedef struct vsm2dec_output_t

{

mpeg2_data_t *mpeg2_data;                                  /// Headers and Extensions of MPEG2 Video Stream

macroblock_info_t *macroblock_info;                  /// Information about all macroblocks for future usage out of decoder

__int64 time_stamp;                                              /// DirectShow time_stamp

t_bool frame_decoded;                                      /// Is frame decoded

t_ui32 coded_picture_width;                                /// Coded_width!=width in case of adding Padding by encoder

t_ui32 coded_picture_height;                         /// Coded_height!=height in case of adding Padding by encoder

t_ui32 error_log;                                          /// Errors, occured during decoding process (See Error defines)

t_ui8 *Y;                                                        ///

t_ui8 *U;                                                        /// Reconstructed image

t_ui8 *V;                                                        /// in YUV format

} vsm2dec_output_t;

///////////////////////////// Decoder function declaration ////////////////////////

/**

* Obtain library version info (major.minor.rev.build, i.e. 2.2.3.2);

*

* @param magic - pointer to a variable to receive magic API number;

* @param major - pointer to a variable to receive major version number;

* @param minor - pointer to a variable to receive minor version number;

* @param rev   - pointer to a variable to receive revision number;

* @param build - pointer to a variable to receive build number;

*/

void vsm2dec_get_version(t_ui32 *magic, t_ui32 *major, t_ui32 *minor, t_ui32 *rev, t_ui32 *build);

/**

* Creating decoder session, initializing decoder data.

* Determinating CPU type

*

* @param vsm2dec_options [In] - decoding options set by decoder user

* @return created decoder context or NULL

**/