]> git.sesse.net Git - ffmpeg/blob - libavcodec/cuvid.h
lavf/qsvvpp: bypass vpp if not needed.
[ffmpeg] / libavcodec / cuvid.h
1 /*
2  * HW decode acceleration through CUVID
3  *
4  * Copyright (c) 2016 Anton Khirnov
5  *
6  * This file is part of Libav.
7  *
8  * Libav is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * Libav is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Libav; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #ifndef AVCODEC_CUVID_H
24 #define AVCODEC_CUVID_H
25
26 #include <cuviddec.h>
27 #include <stdint.h>
28
29 #include "libavutil/buffer.h"
30 #include "libavutil/frame.h"
31
32 #include "avcodec.h"
33
34 typedef struct CUVIDFrame {
35     unsigned int idx;
36     AVBufferRef *idx_ref;
37     AVBufferRef *decoder_ref;
38 } CUVIDFrame;
39
40 typedef struct CUVIDContext {
41     CUVIDPICPARAMS pic_params;
42
43     AVBufferPool *decoder_pool;
44
45     AVBufferRef  *decoder_ref;
46
47     uint8_t      *bitstream;
48     int           bitstream_len;
49     unsigned int  bitstream_allocated;
50
51     unsigned     *slice_offsets;
52     int           nb_slices;
53     unsigned int  slice_offsets_allocated;
54 } CUVIDContext;
55
56 int ff_cuvid_decode_init(AVCodecContext *avctx, unsigned int dpb_size);
57 int ff_cuvid_decode_uninit(AVCodecContext *avctx);
58 int ff_cuvid_start_frame(AVCodecContext *avctx, AVFrame *frame);
59 int ff_cuvid_end_frame(AVCodecContext *avctx);
60
61 #endif /* AVCODEC_CUVID_H */