It is the natural header for it.
Showing the changes to libavfilter (2 of 2 files). Show all
Unified · Split
| @@ -341,22 +341,6 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter · 340 unmodified lines | ||
| 341 | 341 | */ |
| 342 | 342 | int 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 | − */ | |
| 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 | − | |
| 360 | 344 | /** |
| 361 | 345 | * Get number of threads for current filter instance. |
| 362 | 346 | * This number is always same or less than graph->nb_threads. |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <stdint.h> |
| 23 | 23 | |
| 24 | 24 | #include "libavutil/frame.h" |
| 25 | +#include "libavcodec/internal.h" | |
| 25 | 26 | |
| 26 | 27 | /** |
| 27 | 28 | * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16 |
| @@ -30,4 +31,20 @@ · 2 unmodified lines | ||
| 30 | 31 | int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h, |
| 31 | 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 | + */ | |
| 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 | + | |
| 33 | 50 | #endif // AVFILTER_QP_TABLE_H |