vpar_blocks.h 4.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*****************************************************************************
 * vpar_blocks.h : video parser blocks management
 * (c)1999 VideoLAN
 *****************************************************************************
 *****************************************************************************
 * Requires:
 *  "config.h"
 *  "common.h"
 *  "mtime.h"
 *  "vlc_thread.h"
 *  "input.h"
 *  "video.h"
 *  "video_output.h"
 *  "decoder_fifo.h"
 *  "video_fifo.h"
 *****************************************************************************/

/*****************************************************************************
19 20 21 22 23 24 25 26 27
 * macroblock_t : information on a macroblock
 *****************************************************************************/
typedef struct macroblock_s
{
    picture_t *             p_picture;
    int                     i_structure;
    int                     i_l_x, i_l_y;    /* position of macroblock (lum) */
    int                     i_c_x, i_c_y; /* position of macroblock (chroma) */
    int                     i_chroma_nb_blocks;  /* nb of bks for a chr comp */
28 29 30
    int                     i_l_stride;           /* number of data_t to ignore
					           * when changing lines     */
    int                     i_c_stride;                  /* idem, for chroma */
31 32 33 34 35 36 37 38 39

    /* IDCT information */
    elem_t                  ppi_blocks[12][64];                    /* blocks */
    f_idct_t                pf_idct[12];             /* sparse IDCT or not ? */
    int                     pi_sparse_pos[12];

    /* Motion compensation information */
    f_motion_t              pf_motion;    /* function to use for motion comp */
    f_chroma_motion_t       pf_chroma_motion;
40 41 42 43
    picture_t *             p_backw_top;
    picture_t *             p_backw_bot;
    picture_t *             p_forw_top;
    picture_t *             p_forw_bot;
44 45 46 47 48 49 50 51
    int                     i_field_select_backw_top, i_field_select_backw_bot;
    int                     i_field_select_forw_top, i_field_select_forw_bot;
    int                     pi_motion_vectors_backw_top[2];
    int                     pi_motion_vectors_backw_bot[2];
    int                     pi_motion_vectors_forw_top[2];
    int                     pi_motion_vectors_forw_bot[2];

    /* AddBlock information */
52 53 54
    f_addb_t                pf_addb[12];      /* pointer to the Add function */
    data_t *                p_data[12];              /* pointer to the position
					              * in the final picture */
55 56 57 58 59 60 61 62 63 64
} macroblock_t;

/*****************************************************************************
 * macroblock_parsing_t : parser context descriptor #3
 *****************************************************************************/
typedef struct
{
    int                     i_mb_type, i_motion_type, i_mv_count, i_mv_format;
    int                     i_coded_block_pattern;
    boolean_t               b_dct_type;
65 66

    int                     i_l_x, i_l_y, i_c_x, i_c_y;
67 68 69 70 71 72 73 74 75 76 77
} macroblock_parsing_t;

/*****************************************************************************
 * Standard codes
 *****************************************************************************/
/* Macroblock types */
#define MB_INTRA                        1
#define MB_PATTERN                      2
#define MB_MOTION_BACKWARD              4
#define MB_MOTION_FORWARD               8
#define MB_QUANT                        16
78

79 80 81 82 83
/* Motion types */
#define MOTION_FIELD                    1
#define MOTION_FRAME                    2
#define MOTION_16X8                     2
#define MOTION_DMV                      3
84 85 86 87

/*****************************************************************************
 * Prototypes
 *****************************************************************************/
88 89 90
int vpar_CodedPattern420( struct vpar_thread_s* p_vpar );
int vpar_CodedPattern422( struct vpar_thread_s* p_vpar );
int vpar_CodedPattern444( struct vpar_thread_s* p_vpar );
91 92 93 94 95
int  vpar_IMBType( struct vpar_thread_s* p_vpar );
int  vpar_PMBType( struct vpar_thread_s* p_vpar );
int  vpar_BMBType( struct vpar_thread_s* p_vpar );
int  vpar_DMBType( struct vpar_thread_s* p_vpar );