summaryrefslogtreecommitdiff
path: root/libavfilter/vf_fspp.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2015-01-13 13:00:18 +0100
committerStefano Sabatini <stefasab@gmail.com>2015-01-13 13:12:58 +0100
commit57ede2a5070f42fde19175ef666b63b101bcd983 (patch)
tree524aa534214830f3b4e918e59eb9dad6c164f2f6 /libavfilter/vf_fspp.c
parentb23a8668448d99b4c59daad3d485f17e182f43a3 (diff)
lavfi: use ff_norm_qscale(), factorize
Diffstat (limited to 'libavfilter/vf_fspp.c')
-rw-r--r--libavfilter/vf_fspp.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/libavfilter/vf_fspp.c b/libavfilter/vf_fspp.c
index bce8fcce80..fe15db0f7c 100644
--- a/libavfilter/vf_fspp.c
+++ b/libavfilter/vf_fspp.c
@@ -40,7 +40,6 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
-#include "libavcodec/avcodec.h" //for reference to FF_QSCALE_TYPE
#include "vf_fspp.h"
#define OFFSET(x) offsetof(FSPPContext, x)
@@ -80,17 +79,6 @@ static const short custom_threshold[64] = {
20, 27, 26, 23, 20, 15, 11, 5
};
-static inline int 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;
-}
-
//This func reads from 1 slice, 1 and clears 0 & 1
static void store_slice_c(uint8_t *dst, int16_t *src,
ptrdiff_t dst_stride, ptrdiff_t src_stride,
@@ -218,7 +206,7 @@ static void filter(FSPPContext *p, uint8_t *dst, uint8_t *src,
if (t < 0) t = 0; //t always < width-2
t = qp_store[qy + (t >> qpsh)];
- t = norm_qscale(t, p->qscale_type);
+ t = ff_norm_qscale(t, p->qscale_type);
if (t != p->prev_q) p->prev_q = t, p->mul_thrmat((int16_t *)(&p->threshold_mtx_noq[0]), (int16_t *)(&p->threshold_mtx[0]), t);
p->column_fidct((int16_t *)(&p->threshold_mtx[0]), block + x * 8, block3 + x * 8, 8); //yes, this is a HOTSPOT