2 * HW decode acceleration through NVDEC
4 * Copyright (c) 2016 Anton Khirnov
6 * This file is part of FFmpeg.
8 * FFmpeg 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.
13 * FFmpeg 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.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef AVCODEC_NVDEC_H
24 #define AVCODEC_NVDEC_H
26 #include "compat/cuda/dynlink_loader.h"
30 #include "libavutil/buffer.h"
31 #include "libavutil/frame.h"
35 typedef struct NVDECFrame {
38 AVBufferRef *decoder_ref;
41 typedef struct NVDECContext {
42 CUVIDPICPARAMS pic_params;
44 AVBufferPool *decoder_pool;
46 AVBufferRef *decoder_ref;
50 unsigned int bitstream_allocated;
52 unsigned *slice_offsets;
54 unsigned int slice_offsets_allocated;
57 int ff_nvdec_decode_init(AVCodecContext *avctx, unsigned int dpb_size);
58 int ff_nvdec_decode_uninit(AVCodecContext *avctx);
59 int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame);
60 int ff_nvdec_end_frame(AVCodecContext *avctx);
62 #endif /* AVCODEC_NVDEC_H */