Statistics
| Branch: | Revision:

ffmpeg / libavcodec / xvmc.h @ a0723a4d

History | View | Annotate | Download (3.9 KB)

1 ef4d08ac Diego Biurrun
/*
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 af28efa2 Diego Biurrun
#ifndef AVCODEC_XVMC_H
22
#define AVCODEC_XVMC_H
23 699b3f99 Måns Rullgård
24 c97dffbc Diego Biurrun
#include <X11/extensions/XvMC.h>
25 7fade368 Ivan Kalvachev
26 5d6c1110 Diego Biurrun
#include "avcodec.h"
27
28 eb3b2ef9 Ivan Kalvachev
#if LIBAVCODEC_VERSION_MAJOR < 53
29 c1a5aa29 Diego Biurrun
#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 eb3b2ef9 Ivan Kalvachev
#endif
33 c1a5aa29 Diego Biurrun
#define AV_XVMC_RENDER_MAGIC          0x1DC711C0  /**< magic value to ensure that regular pixel routines haven't corrupted the struct */
34
                                                  //   1337 IDCT MCo
35 117f9234 Ivan Kalvachev
36 c96da3ed Diego Biurrun
struct xvmc_render_state {
37 aae667ba Ivan Kalvachev
/** set by calling application */
38 6785e509 Ivan Kalvachev
//@{
39 a0723a4d Ivan Kalvachev
    int             magic_id;                     ///< used as a check against memory corruption by regular pixel routines or other API structure
40 7fade368 Ivan Kalvachev
41 6b6ea1df Diego Biurrun
    short*          data_blocks;
42
    XvMCMacroBlock* mv_blocks;
43
    int             total_number_of_mv_blocks;
44
    int             total_number_of_data_blocks;
45 c1a5aa29 Diego Biurrun
    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 6785e509 Ivan Kalvachev
//}@
49 7fade368 Ivan Kalvachev
50 aae667ba Ivan Kalvachev
/** set by the decoder
51
    used by the XvMCRenderSurface function */
52 6785e509 Ivan Kalvachev
//@{
53 c1a5aa29 Diego Biurrun
    XvMCSurface*    p_past_surface;               ///< pointer to the past surface
54
    XvMCSurface*    p_future_surface;             ///< pointer to the future prediction surface
55 7fade368 Ivan Kalvachev
56 a1db3b93 Diego Biurrun
    unsigned int    picture_structure;            ///< top/bottom fields or frame
57 c1a5aa29 Diego Biurrun
    unsigned int    flags;                        ///< XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
58 6785e509 Ivan Kalvachev
//}@
59 7fade368 Ivan Kalvachev
60 72d38a74 Ivan Kalvachev
    /** 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 115329f1 Diego Biurrun
80 05c363e9 Diego Biurrun
/** extensions may be placed here */
81 3bffe5fc Ivan Kalvachev
#if LIBAVCODEC_VERSION_MAJOR < 53
82 6785e509 Ivan Kalvachev
//@{
83 72d38a74 Ivan Kalvachev
    /** 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 c1a5aa29 Diego Biurrun
    void*           p_osd_target_surface_render;  ///< pointer to the surface where subpicture is rendered
90 6785e509 Ivan Kalvachev
//}@
91 3bffe5fc Ivan Kalvachev
#endif
92 c96da3ed Diego Biurrun
};
93 699b3f99 Måns Rullgård
94 af28efa2 Diego Biurrun
#endif /* AVCODEC_XVMC_H */