video_decoder.h 4.19 KB
Newer Older
1
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
2
 * video_decoder.h : video decoder thread
3
 *****************************************************************************
4 5
 * Copyright (C) 1999, 2000 VideoLAN
 *
6
 * Authors: Christophe Massiot <massiot@via.ecp.fr>
7 8 9 10 11
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
12
 * 
13 14
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
17
 *
18 19 20
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21 22 23
 *****************************************************************************/
 
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
24 25 26 27
 * Requires:
 *  "config.h"
 *  "common.h"
 *  "mtime.h"
28
 *  "threads.h"
Michel Kaempf's avatar
Michel Kaempf committed
29 30 31 32
 *  "input.h"
 *  "video.h"
 *  "video_output.h"
 *  "decoder_fifo.h"
33
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
34

35
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
36
 * vdec_thread_t: video decoder thread descriptor
37
 *****************************************************************************
38
 * XXX??
39
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
40 41 42
typedef struct vdec_thread_s
{
    /* Thread properties and locks */
43 44 45 46 47
    boolean_t           b_die;                                 /* `die' flag */
    boolean_t           b_run;                                 /* `run' flag */
    boolean_t           b_error;                             /* `error' flag */
    boolean_t           b_active;                           /* `active' flag */
    vlc_thread_t        thread_id;                /* id for thread functions */
Michel Kaempf's avatar
Michel Kaempf committed
48 49

    /* Thread configuration */
50
    /* XXX?? */
51
//    int *pi_status;
52

53 54 55 56 57 58 59 60 61 62 63
    /* idct iformations */
    dctelem_t              p_pre_idct[64*64];

    /* Input properties */
    struct vpar_thread_s *    p_vpar;                 /* video_parser thread */

    /* Lookup tables */
//#ifdef MPEG2_COMPLIANT
    u8              pi_crop_buf[VDEC_CROPRANGE];
    u8 *            pi_crop;
//#endif
64

Michel Kaempf's avatar
Michel Kaempf committed
65 66
#ifdef STATS
    /* Statistics */
67 68 69 70 71 72
    count_t         c_loops;                              /* number of loops */
    count_t         c_idle_loops;                    /* number of idle loops */
    count_t         c_decoded_pictures;        /* number of pictures decoded */
    count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
    count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
    count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
Renaud Dartus's avatar
 
Renaud Dartus committed
73 74 75

/*    void            (*vdec_DecodeMacroblock)  ( struct vdec_thread_s *p_vdec,
                                                struct macroblock_s *p_mb );*/
Michel Kaempf's avatar
Michel Kaempf committed
76 77 78
#endif
} vdec_thread_t;

79
/*****************************************************************************
Stéphane Borel's avatar
 
Stéphane Borel committed
80
 * Prototypes
81 82
 *****************************************************************************/
struct vpar_thread_s;
83
struct macroblock_s;
Michel Kaempf's avatar
Michel Kaempf committed
84

Stéphane Borel's avatar
 
Stéphane Borel committed
85
/* Thread management functions */
86 87
#ifndef VDEC_SMP
int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
88 89
void            vdec_DecodeMacroblock   ( struct vdec_thread_s *p_vdec,
                                          struct macroblock_s *p_mb );
Renaud Dartus's avatar
 
Renaud Dartus committed
90 91 92 93
void            vdec_DecodeMacroblockC  ( struct vdec_thread_s *p_vdec,
                                          struct macroblock_s *p_mb );
void            vdec_DecodeMacroblockBW ( struct vdec_thread_s *p_vdec,
                                          struct macroblock_s *p_mb );
94
#endif
95 96 97 98 99
vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*,
                                          int *pi_status */ );
void            vdec_DestroyThread      ( vdec_thread_t *p_vdec /*,
                                          int *pi_status */ );