Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-12-20 23:39:56 +0300
committerMark Thompson <sw@jkqxz.net>2019-01-24 02:04:11 +0300
commit5fdcf85bbffe7451c227478fda62da5c0938f27d (patch)
treee780fe3a5b8289e4c0cd8fe9700583452e8a06c0 /libavcodec/vaapi_encode_mjpeg.c
parent26ce3a43a35fe3a43c895945252aa22c6b46ffb7 (diff)
vaapi_encode: Convert to send/receive API
This attaches the logic of picking the mode of for the next picture to the output, which simplifies some choices by removing the concept of the picture for which input is not yet available. At the same time, we allow more complex reference structures and track more reference metadata (particularly the contents of the DPB) for use in the codec-specific code. It also adds flags to explicitly track the available features of the different codecs. The new structure also allows open-GOP support, so that is now available for codecs which can do it.
Diffstat (limited to 'libavcodec/vaapi_encode_mjpeg.c')
-rw-r--r--libavcodec/vaapi_encode_mjpeg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index 79f43473f5..f0ea292098 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -230,6 +230,8 @@ static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
const uint8_t *components;
int t, i, quant_scale, len;
+ av_assert0(pic->type == PICTURE_TYPE_IDR);
+
desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format);
av_assert0(desc);
if (desc->flags & AV_PIX_FMT_FLAG_RGB)
@@ -476,7 +478,8 @@ static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
.profiles = vaapi_encode_mjpeg_profiles,
- .flags = FLAG_CONSTANT_QUALITY_ONLY,
+ .flags = FLAG_CONSTANT_QUALITY_ONLY |
+ FLAG_INTRA_ONLY,
.configure = &vaapi_encode_mjpeg_configure,
@@ -535,7 +538,6 @@ static const AVOption vaapi_encode_mjpeg_options[] = {
static const AVCodecDefault vaapi_encode_mjpeg_defaults[] = {
{ "global_quality", "80" },
{ "b", "0" },
- { "g", "1" },
{ NULL },
};
@@ -553,7 +555,8 @@ AVCodec ff_mjpeg_vaapi_encoder = {
.id = AV_CODEC_ID_MJPEG,
.priv_data_size = sizeof(VAAPIEncodeMJPEGContext),
.init = &vaapi_encode_mjpeg_init,
- .encode2 = &ff_vaapi_encode2,
+ .send_frame = &ff_vaapi_encode_send_frame,
+ .receive_packet = &ff_vaapi_encode_receive_packet,
.close = &vaapi_encode_mjpeg_close,
.priv_class = &vaapi_encode_mjpeg_class,
.capabilities = AV_CODEC_CAP_HARDWARE |