aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-04-17 10:32:12 +0200
committerAnton Khirnov <anton@khirnov.net>2021-01-01 14:25:33 +0100
commit7f7eb137d6e04d73eb851fc847a54a47384748dc (patch)
treebe3a68651a4fe3b4ccd0114cd1ff45ade37b7eda
parent3f0930387cd8f365381b02d03407ec33f06e6f05 (diff)
downloadffmpeg-7f7eb137d6e04d73eb851fc847a54a47384748dc.tar.gz
lavfi/vf_codecview: convert to the video_enc_params API
-rw-r--r--libavfilter/Makefile2
-rw-r--r--libavfilter/vf_codecview.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 1be93e443a..bb0367e828 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -193,7 +193,7 @@ OBJS-$(CONFIG_CHROMAKEY_FILTER) += vf_chromakey.o
OBJS-$(CONFIG_CHROMANR_FILTER) += vf_chromanr.o
OBJS-$(CONFIG_CHROMASHIFT_FILTER) += vf_chromashift.o
OBJS-$(CONFIG_CIESCOPE_FILTER) += vf_ciescope.o
-OBJS-$(CONFIG_CODECVIEW_FILTER) += vf_codecview.o
+OBJS-$(CONFIG_CODECVIEW_FILTER) += vf_codecview.o qp_table.o
OBJS-$(CONFIG_COLORBALANCE_FILTER) += vf_colorbalance.o
OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o
OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o
diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index 331bfba777..197dc96136 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -33,6 +33,7 @@
#include "libavutil/motion_vector.h"
#include "libavutil/opt.h"
#include "avfilter.h"
+#include "qp_table.h"
#include "internal.h"
#define MV_P_FOR (1<<0)
@@ -219,8 +220,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
AVFilterLink *outlink = ctx->outputs[0];
if (s->qp) {
- int qstride, qp_type;
- int8_t *qp_table = av_frame_get_qp_table(frame, &qstride, &qp_type);
+ int qstride, qp_type, ret;
+ int8_t *qp_table;
+
+ ret = ff_qp_table_extract(frame, &qp_table, &qstride, NULL, &qp_type);
+ if (ret < 0) {
+ av_frame_free(&frame);
+ return ret;
+ }
if (qp_table) {
int x, y;
@@ -240,6 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
pv += lzv;
}
}
+ av_freep(&qp_table);
}
if (s->mv || s->mv_type) {