History

avfilter/internal: Move ff_norm_qscale() to qp_table.h

It is the natural header for it.

Andreas Rheinhardt committed 5 years ago

Commit 2b6e0081 parent b75dc8b2 files · +17 −16Browse files

Showing the changes to libavfilter (2 of 2 files). Show all

Unified · Split

2 files
  1. libavfilter/internal.h +0 −16
  2. libavfilter/qp_table.h +17 −0
libavfilter/internal.h+0−16
@@ -341,22 +341,6 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter · 340 unmodified lines
341341 */
342342 int ff_filter_graph_run_once(AVFilterGraph *graph);
343343
344−/**
345− * Normalize the qscale factor
346− * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
347− * cannot be optimal
348− */
349−static inline int ff_norm_qscale(int qscale, int type)
350−{
351− switch (type) {
352− case FF_QSCALE_TYPE_MPEG1: return qscale;
353− case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
354− case FF_QSCALE_TYPE_H264: return qscale >> 2;
355− case FF_QSCALE_TYPE_VP56: return (63 - qscale + 2) >> 2;
356− }
357− return qscale;
358−}
359−
360344 /**
361345 * Get number of threads for current filter instance.
362346 * This number is always same or less than graph->nb_threads.
libavfilter/qp_table.h+17−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <stdint.h>
2323
2424 #include "libavutil/frame.h"
25+#include "libavcodec/internal.h"
2526
2627 /**
2728 * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16
@@ -30,4 +31,20 @@ · 2 unmodified lines
3031 int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h,
3132 int *qscale_type);
3233
34+/**
35+ * Normalize the qscale factor
36+ * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
37+ * cannot be optimal
38+ */
39+static inline int ff_norm_qscale(int qscale, int type)
40+{
41+ switch (type) {
42+ case FF_QSCALE_TYPE_MPEG1: return qscale;
43+ case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
44+ case FF_QSCALE_TYPE_H264: return qscale >> 2;
45+ case FF_QSCALE_TYPE_VP56: return (63 - qscale + 2) >> 2;
46+ }
47+ return qscale;
48+}
49+
3350 #endif // AVFILTER_QP_TABLE_H

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t