From: Juan De León
This is intended to replace the deprecated the AV_FRAME_DATA_QP_TABLE*
API and extend it to a wider range of codecs.
In the future, it may also be extended to support other encoding
parameters such as motion vectors.
Additional changes by Anton Khirnov with suggestions
by Lynne .
Signed-off-by: Juan De León
Signed-off-by: Michael Niedermayer
Signed-off-by: Anton Khirnov
---
doc/APIchanges | 4 ++
libavutil/Makefile | 5 +-
libavutil/frame.c| 1 +
libavutil/frame.h| 5 ++
libavutil/version.h | 4 +-
libavutil/video_enc_params.c | 79
libavutil/video_enc_params.h | 135 +++
7 files changed, 230 insertions(+), 3 deletions(-)
create mode 100644 libavutil/video_enc_params.c
create mode 100644 libavutil/video_enc_params.h
diff --git a/doc/APIchanges b/doc/APIchanges
index e30148dc90..2fc9428827 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2017-10-21
API changes, most recent first:
+2020-xx-xx - xx - lavu 56.43.100 - video_enc_params.h
+ Add a new API for exporting video encoding information.
+ Replaces the deprecated API for exporting QP tables from decoders.
+
2020-04-15 - xx - lavc 58.79.100 - avcodec.h
Add formal support for calling avcodec_flush_buffers() on encoders.
Encoders that set the cap AV_CODEC_CAP_ENCODER_FLUSH will be flushed.
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 8feb029a3a..d44b62877f 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -79,6 +79,7 @@ HEADERS = adler32.h
\
tree.h\
twofish.h \
version.h \
+ video_enc_params.h\
xtea.h\
tea.h \
tx.h \
@@ -165,7 +166,9 @@ OBJS = adler32.o
\
tx.o \
tx_float.o \
tx_double.o \
- tx_int32.o
+ tx_int32.o \
+ video_enc_params.o \
+
OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
OBJS-$(CONFIG_D3D11VA) += hwcontext_d3d11va.o
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 769851ceac..53581e4862 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -850,6 +850,7 @@ const char *av_frame_side_data_name(enum
AVFrameSideDataType type)
#endif
case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata
SMPTE2094-40 (HDR10+)";
case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
+case AV_FRAME_DATA_VIDEO_ENC_PARAMS:return "Video encoding
parameters";
}
return NULL;
}
diff --git a/libavutil/frame.h b/libavutil/frame.h
index b5afb58634..fc67db0f6c 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -179,6 +179,11 @@ enum AVFrameSideDataType {
* array element is implied by AVFrameSideData.size /
AVRegionOfInterest.self_size.
*/
AV_FRAME_DATA_REGIONS_OF_INTEREST,
+
+/**
+ * Encoding parameters for a video frame, as described by AVVideoEncParams.
+ */
+AV_FRAME_DATA_VIDEO_ENC_PARAMS,
};
enum AVActiveFormatDescription {
diff --git a/libavutil/version.h b/libavutil/version.h
index 70836a5d52..ea9363e8e9 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,8 +79,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 42
-#define LIBAVUTIL_VERSION_MICRO 102
+#define LIBAVUTIL_VERSION_MINOR 43
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
diff --git a/libavutil/video_enc_params.c b/libavutil/video_enc_params.c
new file mode 100644
index 00..c46c0f1dc6
--- /dev/null
+++ b/libavutil/video_enc_params.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of