diff mbox series

[FFmpeg-devel,06/10] avfilter/internal: Move ff_norm_qscale() to qp_table.h

Message ID AM7PR03MB666048C9714A0CE864D89D8D8FEF9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 2b6e008577fa444fc8d1b3a7b985c600633f4ee4
Headers show
Series [FFmpeg-devel,01/10] avcodec/mips/constants: Include intfloat.h in constants.h | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 2, 2021, 3:39 p.m. UTC
It is the natural header for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/internal.h | 16 ----------------
 libavfilter/qp_table.h | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 16 deletions(-)

Comments

Michael Niedermayer Aug. 3, 2021, 10:09 p.m. UTC | #1
On Mon, Aug 02, 2021 at 05:39:11PM +0200, Andreas Rheinhardt wrote:
> It is the natural header for it.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavfilter/internal.h | 16 ----------------
>  libavfilter/qp_table.h | 17 +++++++++++++++++
>  2 files changed, 17 insertions(+), 16 deletions(-)

i see no harm from this change, so as far as iam concerned
should be ok

thx

[...]
diff mbox series

Patch

diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 1bcfb830a1..61a1279b2f 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -343,22 +343,6 @@  void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter
  */
 int ff_filter_graph_run_once(AVFilterGraph *graph);
 
-/**
- * Normalize the qscale factor
- * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
- *       cannot be optimal
- */
-static inline int ff_norm_qscale(int qscale, int type)
-{
-    switch (type) {
-    case FF_QSCALE_TYPE_MPEG1: return qscale;
-    case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
-    case FF_QSCALE_TYPE_H264:  return qscale >> 2;
-    case FF_QSCALE_TYPE_VP56:  return (63 - qscale + 2) >> 2;
-    }
-    return qscale;
-}
-
 /**
  * Get number of threads for current filter instance.
  * This number is always same or less than graph->nb_threads.
diff --git a/libavfilter/qp_table.h b/libavfilter/qp_table.h
index a552fe2e64..4758ee8538 100644
--- a/libavfilter/qp_table.h
+++ b/libavfilter/qp_table.h
@@ -22,6 +22,7 @@ 
 #include <stdint.h>
 
 #include "libavutil/frame.h"
+#include "libavcodec/internal.h"
 
 /**
  * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16
@@ -30,4 +31,20 @@ 
 int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h,
                         int *qscale_type);
 
+/**
+ * Normalize the qscale factor
+ * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
+ *       cannot be optimal
+ */
+static inline int ff_norm_qscale(int qscale, int type)
+{
+    switch (type) {
+    case FF_QSCALE_TYPE_MPEG1: return qscale;
+    case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
+    case FF_QSCALE_TYPE_H264:  return qscale >> 2;
+    case FF_QSCALE_TYPE_VP56:  return (63 - qscale + 2) >> 2;
+    }
+    return qscale;
+}
+
 #endif // AVFILTER_QP_TABLE_H