[FFmpeg-cvslog] avfilter/vf_qp: Deduplicate variable names arrays

Andreas Rheinhardt git at videolan.org
Fri Jan 8 07:12:09 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Jan  3 02:02:28 2021 +0100| [a91b18f368d3c8a0c82fb6af7c31548f50bd28b2] | committer: Andreas Rheinhardt

avfilter/vf_qp: Deduplicate variable names arrays

This also avoids relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a91b18f368d3c8a0c82fb6af7c31548f50bd28b2
---

 libavfilter/vf_qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_qp.c b/libavfilter/vf_qp.c
index af46fe0ece..e2d60fdbb5 100644
--- a/libavfilter/vf_qp.c
+++ b/libavfilter/vf_qp.c
@@ -38,6 +38,8 @@ typedef struct QPContext {
     int evaluate_per_mb;
 } QPContext;
 
+static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
+
 #define OFFSET(x) offsetof(QPContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
@@ -55,7 +57,6 @@ static int config_input(AVFilterLink *inlink)
     int i;
     int ret;
     AVExpr *e = NULL;
-    static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
 
     if (!s->qp_expr_str)
         return 0;
@@ -144,7 +145,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
                 AVVideoBlockParams *b = av_video_enc_params_block(par_out, block_idx);
                 int qp = sd_in ? in_qp_global + BLOCK_QP_DELTA(block_idx) : NAN;
                 double var_values[] = { !!sd_in, qp, x, y, s->qstride, s->h, 0};
-                static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL };
                 double temp_val;
 
                 ret = av_expr_parse_and_eval(&temp_val, s->qp_expr_str,



More information about the ffmpeg-cvslog mailing list