Commit 3b95c7c1 authored by Mark Thompson's avatar Mark Thompson Committed by Mark Thompson

vaapi_encode: Add MPEG-2 support

(cherry picked from commit ca6ae3b7)
parent eefa4b76
......@@ -108,6 +108,7 @@ version 3.1:
- libutvideo wrapper removed
- YUY2 Lossless Codec decoder
- VideoToolbox H.264 encoder
- VAAPI-accelerated MPEG-2 encoding
version 3.0:
......
......@@ -2768,6 +2768,8 @@ mpeg2_qsv_decoder_deps="libmfx"
mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel"
mpeg2_qsv_encoder_deps="libmfx"
mpeg2_qsv_encoder_select="qsvenc"
mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2"
mpeg2_vaapi_encoder_select="vaapi_encode"
mpeg4_cuvid_decoder_deps="cuda cuvid"
mpeg4_cuvid_decoder_select="mpeg4_cuvid_hwaccel"
nvenc_h264_encoder_deps="nvenc"
......@@ -5653,6 +5655,7 @@ check_type "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer"
check_type "va/va.h va/va_enc_h264.h" "VAEncPictureParameterBufferH264"
check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
check_type "va/va.h va/va_enc_mpeg2.h" "VAEncPictureParameterBufferMPEG2"
check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
......
......@@ -413,6 +413,7 @@ OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec_mpeg2.o
OBJS-$(CONFIG_MPEG2_QSV_ENCODER) += qsvenc_mpeg2.o
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER) += vaapi_encode_mpeg2.o
OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o
OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_MPEG4_OMX_ENCODER) += omx.o
......
......@@ -661,6 +661,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(MPEG1_CUVID, mpeg1_cuvid);
REGISTER_DECODER(MPEG2_CUVID, mpeg2_cuvid);
REGISTER_ENCODER(MPEG2_QSV, mpeg2_qsv);
REGISTER_ENCODER(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_DECODER(MPEG4_CUVID, mpeg4_cuvid);
REGISTER_DECODER(MPEG4_MEDIACODEC, mpeg4_mediacodec);
REGISTER_DECODER(VC1_CUVID, vc1_cuvid);
......
......@@ -320,6 +320,7 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
err = AVERROR(ENOMEM);
goto fail;
}
slice->index = i;
pic->slices[i] = slice;
if (ctx->codec->slice_params_size > 0) {
......
......@@ -35,8 +35,8 @@ enum {
MAX_CONFIG_ATTRIBUTES = 4,
MAX_GLOBAL_PARAMS = 4,
MAX_PICTURE_REFERENCES = 2,
MAX_PICTURE_SLICES = 1,
MAX_PARAM_BUFFERS = 16,
MAX_PICTURE_SLICES = 112,
MAX_PARAM_BUFFERS = 128,
MAX_REORDER_DELAY = 16,
MAX_PARAM_BUFFER_SIZE = 1024,
};
......@@ -49,6 +49,7 @@ enum {
};
typedef struct VAAPIEncodeSlice {
int index;
void *priv_data;
void *codec_slice_params;
} VAAPIEncodeSlice;
......
This diff is collapsed.
......@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 75
#define LIBAVCODEC_VERSION_MINOR 76
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment