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

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
341 */341 */
342int ff_filter_graph_run_once(AVFilterGraph *graph);342int ff_filter_graph_run_once(AVFilterGraph *graph);
343 343
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 */
349static 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
360/**344/**
361 * Get number of threads for current filter instance.345 * Get number of threads for current filter instance.
362 * This number is always same or less than graph->nb_threads.346 * This number is always same or less than graph->nb_threads.
libavfilter/qp_table.h+17−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include <stdint.h>22#include <stdint.h>
23 23
24#include "libavutil/frame.h"24#include "libavutil/frame.h"
25#include "libavcodec/internal.h"
25 26
26/**27/**
27 * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x1628 * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16
@@ -30,4 +31,20 @@ · 2 unmodified lines
30int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h,31int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h,
31 int *qscale_type);32 int *qscale_type);
32 33
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 */
39static 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
33#endif // AVFILTER_QP_TABLE_H50#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