summaryrefslogtreecommitdiff
path: root/libavfilter/vf_pp7.c
diff options
context:
space:
mode:
authorArwa Arif <arwaarif1994@gmail.com>2015-01-10 01:43:42 +0530
committerMichael Niedermayer <michaelni@gmx.at>2015-01-10 02:22:02 +0100
commit4df01d5d44cf65c141e5569c9cb6c57a77c70e39 (patch)
treef3295e63789963015bcba9b41acb0c690700b049 /libavfilter/vf_pp7.c
parentaab74a38b8ba910a383dd82953061d5c42772ae9 (diff)
avfilter: Factorize the use of norm_qscale in pp7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_pp7.c')
-rw-r--r--libavfilter/vf_pp7.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c
index 2f071f2116..bb590a2465 100644
--- a/libavfilter/vf_pp7.c
+++ b/libavfilter/vf_pp7.c
@@ -33,7 +33,6 @@
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "vf_pp7.h"
-#include "libavcodec/avcodec.h"
enum mode {
MODE_HARD,
@@ -87,17 +86,6 @@ static const int thres[16] = {
N / (SN2 * SN0), N / (SN2 * SN2), N / (SN2 * SN0), N / (SN2 * SN2),
};
-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;
-}
-
static void init_thres2(PP7Context *p)
{
int qp, i;
@@ -259,7 +247,7 @@ static void filter(PP7Context *p, uint8_t *dst, uint8_t *src,
qp = p->qp;
else {
qp = qp_store[ (FFMIN(x, width - 1) >> qps) + (FFMIN(y, height - 1) >> qps) * qp_stride];
- qp = norm_qscale(qp, p->qscale_type);
+ qp = ff_norm_qscale(qp, p->qscale_type);
}
for (; x < end; x++) {
const int index = x + y * stride + (8 - 3) * (1 + stride) + 8; //FIXME silly offset