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

void *vsm2dec_create(vsm2dec_options_t *vsm2dec_options);

/**

* Change decoding options.

* See vsm2dec_options structure to get list of options.

*

* @param decoder [In] - valid decoder session context

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

**/

void vsm2dec_set_options(void *decoder, vsm2dec_options_t *vsm2dec_options);

/**

* Send compressed data to decoder.

*

* @param decoder [In] - valid decoder session context

* @param coded_data [In]- buffer with bitstream to decode

* @param coded_data_size [In] - size of data in the buffer

* @param time_stamp [In] - DirectShow time_stamp for proper video/audio synchronization

**/

void vsm2dec_send_data(void *decoder, t_ui8 *coded_data, t_ui32 coded_data_size,

__int64 time_stamp);

/**

* Decoding compressed data.

*

* @param decoder [In] - valid decoder session context

* @param vsm2dec_output [Out] - strucure contains decoded data and additional info

**/

void vsm2dec_decode(void *decoder, vsm2dec_output_t *vsm2dec_output);

/**

* Release decoder, destruction decoder session.

*

* @param decoder [In] - valid decoder session context

**/

void vsm2dec_release(void *decoder);

#ifdef __cplusplus

}

#endif

#endif   //_VSM2DEC_DEC_API_H

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

/**

* @file vsm2tenc_api.h

* Encoder public API implementation.

*

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

* - Project: MPEG2 video title encoder

**/

#ifndef _VSM2TENC_VSM2TENC_API_H

#define _VSM2TENC_VSM2TENC_API_H

#ifdef __cplusplus

extern "C" {

#endif

#include "vsm2_stypes.h"

#include "vsm2tenc_errors.h"

#include "vsm2.h"

////////////////////////////////// Encoder data types ////////////////////////////

/// Encoder input structure

typedef struct vsm2tenc_input_t

{

t_si32 frame_id;                                           /// Frame ID in title buffer

__int64 time_stamp;                                              /// DirectShow time_stamp for proper video/audio synchronization

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

t_ui8 *macroblock_changes_coeff;                     /// 255 - macroblock all pixels of MB were changed, 0 - No changes in this MB

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_ui8 *Y;                                                        ///

t_ui8 *U;                                                        /// Reconstructed image

t_ui8 *V;                                                        /// in YUV format

} vsm2tenc_input_t;

//////////////////////////// Encoder function declaration ////////////////////////

/**

* Create encoder session, initializing encoder data.

*

* @return created encoder context or NULL

**/

void *vsm2tenc_create();

/**

* Passes frame to be encoded to the encoder. Frames should be passes in the

* display order.

*

* @param encoder [In] - valid encoder session context

* @param vsm2tenc_input [In] - input frame with additional information

* @return VSM2ENC_OK on success, error code otherwise

**/

t_ui32 vsm2tenc_send_frame(void *encoder, vsm2tenc_input_t *vsm2tenc_input);

/**

* Retrieves frame is not used by encoder anymore.

*

* @param encoder [In] - valid encoder session context

* @return frame ID

**/

t_si32 vsm2tenc_get_frame(void *encoder);

/**

* Does actual frame encoding. Input frames should be passed

* to the encoder prior to call to this function.

*

* @param encoder [In] - valid encoder session context

* @param coded_data [Out] - buffer for encoded data

* @param coded_data_size [In] - size of buffer for encoded data

* @return VSM2ENC_OK on success, error code otherwise

**/

t_ui32 vsm2tenc_encode_frame(void *encoder, t_ui8 *coded_data, t_ui32 coded_data_size);

/**