]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/vf_codecview: convert to the video_enc_params API
authorAnton Khirnov <anton@khirnov.net>
Fri, 17 Apr 2020 08:32:12 +0000 (10:32 +0200)
committerAnton Khirnov <anton@khirnov.net>
Fri, 1 Jan 2021 13:25:33 +0000 (14:25 +0100)
libavfilter/Makefile
libavfilter/vf_codecview.c

index 1be93e443a3aa1a333a9d79faedfc27a312caa7d..bb0367e8286043e38c775715809c94f7ccc202ff 100644 (file)
@@ -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
index 331bfba777dce1c06d4863d4c4043786eda63a97..197dc961362c7df0917e3e508037dc465509b575 100644 (file)
@@ -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) {