Statistics
| Branch: | Revision:

ffmpeg / libavcodec / xvmc.h @ a0723a4d

History | View | Annotate | Download (3.9 KB)

1
/*
2
 * Copyright (C) 2003 Ivan Kalvachev
3
 *
4
 * This file is part of FFmpeg.
5
 *
6
 * FFmpeg is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * FFmpeg is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with FFmpeg; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 */
20

    
21
#ifndef AVCODEC_XVMC_H
22
#define AVCODEC_XVMC_H
23

    
24
#include <X11/extensions/XvMC.h>
25

    
26
#include "avcodec.h"
27

    
28
#if LIBAVCODEC_VERSION_MAJOR < 53
29
#define AV_XVMC_STATE_DISPLAY_PENDING          1  /**  the surface should be shown, the video driver manipulates this */
30
#define AV_XVMC_STATE_PREDICTION               2  /**  the surface is needed for prediction, the codec manipulates this */
31
#define AV_XVMC_STATE_OSD_SOURCE               4  /**  this surface is needed for subpicture rendering */
32
#endif
33
#define AV_XVMC_RENDER_MAGIC          0x1DC711C0  /**< magic value to ensure that regular pixel routines haven't corrupted the struct */
34
                                                  //   1337 IDCT MCo
35

    
36
struct xvmc_render_state {
37
/** set by calling application */
38
//@{
39
    int             magic_id;                     ///< used as a check against memory corruption by regular pixel routines or other API structure
40

    
41
    short*          data_blocks;
42
    XvMCMacroBlock* mv_blocks;
43
    int             total_number_of_mv_blocks;
44
    int             total_number_of_data_blocks;
45
    int             idct;                         ///< indicate that IDCT acceleration level is used
46
    int             unsigned_intra;               ///< +-128 for intra pictures after clipping
47
    XvMCSurface*    p_surface;                    ///< pointer to rendered surface, never changed
48
//}@
49

    
50
/** set by the decoder
51
    used by the XvMCRenderSurface function */
52
//@{
53
    XvMCSurface*    p_past_surface;               ///< pointer to the past surface
54
    XvMCSurface*    p_future_surface;             ///< pointer to the future prediction surface
55

    
56
    unsigned int    picture_structure;            ///< top/bottom fields or frame
57
    unsigned int    flags;                        ///< XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
58
//}@
59

    
60
    /** Offset in the mv array for the current slice:
61
        - application - zeros it on  get_buffer().
62
                        successful draw_horiz_band() may increment it
63
                        with filled_mb_block_num or zero both.
64
        - libavcodec  - unchanged
65
    */
66
    int             start_mv_blocks_num;
67

    
68
    /** Processed mv blocks in this slice:
69
        - application - zeros it on get_buffer() or after successful draw_horiz_band()
70
        - libavcodec  - increment with one of each stored MB
71
    */
72
    int             filled_mv_blocks_num;
73

    
74
    /** Used in add_mv_block, pointer to next free block
75
        - application - zeroes it on get_buffer() and after successful draw_horiz_band()
76
        - libvcodec   - each macroblock increases it with the number of coded blocks in it.
77
    */
78
    int             next_free_data_block_num;
79

    
80
/** extensions may be placed here */
81
#if LIBAVCODEC_VERSION_MAJOR < 53
82
//@{
83
    /** State - used to workaround limitations in MPlayer vo system.
84
        0   -Surface not used
85
        1   -Surface is still hold in application to be displayed or is still visible.
86
        2   -Surface is still hold in lavcodec buffer for prediction
87
    */
88
    int             state;
89
    void*           p_osd_target_surface_render;  ///< pointer to the surface where subpicture is rendered
90
//}@
91
#endif
92
};
93

    
94
#endif /* AVCODEC_XVMC_H */