28 #include <mfx/mfxvideo.h>
92 static const char *uid_hevcdec_sw =
"15dd936825ad475ea34e35f3f54217a6";
93 static const char *uid_hevcdec_hw =
"33a61c0b4c27454ca8d85dde757c6f8e";
97 "load_plugins is not empty, but load_plugin is not set to 'none'."
98 "The load_plugin value will be ignored.\n");
126 "hevc_mp4toannexb" :
"h264_mp4toannexb";
184 while (!*got_frame) {
228 #define OFFSET(x) offsetof(QSVH2645Context, x)
229 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
231 #if CONFIG_HEVC_QSV_DECODER
239 static const AVOption hevc_options[] = {
247 {
"load_plugins",
"A :-separate list of hexadecimal plugin UIDs to load in an internal session",
252 static const AVClass hevc_class = {
255 .option = hevc_options,
259 AVCodec ff_hevc_qsv_decoder = {
270 .priv_class = &hevc_class,
278 #if CONFIG_H264_QSV_DECODER
298 AVCodec ff_h264_qsv_decoder = {
300 .long_name =
NULL_IF_CONFIG_SMALL(
"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"),
309 .priv_class = &
class,
void av_bsf_free(AVBSFContext **ctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
The bitstream filter state.
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
static av_cold int qsv_decode_close(AVCodecContext *avctx)
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx)
Allocate a context for a given bitstream filter.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
int ff_qsv_decode_close(QSVContext *q)
int av_fifo_space(const AVFifoBuffer *f)
Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write int...
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, uint8_t clip)
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
const OptionDef options[]
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
AVFifoBuffer * packet_fifo
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVRational time_base_in
The timebase used for the timestamps of the input packets.
const char * name
Name of the codec implementation.
void ff_qsv_decode_flush(AVCodecContext *avctx, QSVContext *q)
#define ASYNC_DEPTH_DEFAULT
static int qsv_init_bsf(AVCodecContext *avctx, QSVH2645Context *s)
const char * name
Name of the hardware accelerated codec.
static void qsv_decode_flush(AVCodecContext *avctx)
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
char * av_strdup(const char *s)
Duplicate a string.
Libavcodec external API header.
int av_fifo_size(const AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
Resize an AVFifoBuffer.
main external API structure.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
a very simple circular buffer FIFO implementation
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Describe the class of an AVClass context structure.
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
static int qsv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static enum AVPixelFormat pix_fmts[]
static av_cold int qsv_decode_init(AVCodecContext *avctx)
common internal api header.
common internal and external API header
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q, AVFrame *frame, int *got_frame, AVPacket *pkt)
static void qsv_clear_buffers(QSVH2645Context *s)
AVPixelFormat
Pixel format.
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.