summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_dlopen.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-05 22:55:21 +0100
committerwm4 <wm4@nowhere>2013-12-05 22:58:53 +0100
commitb2c4653b8841dba16e0dcc38fd49f9ae5b1166ff (patch)
tree62a942fd95515a15a8c76d8fd012db43e01f9657 /video/filter/vf_dlopen.c
parente3809e5b52619692ba91fcd3e857cbf335f43d1a (diff)
downloadmpv-b2c4653b8841dba16e0dcc38fd49f9ae5b1166ff.tar.bz2
mpv-b2c4653b8841dba16e0dcc38fd49f9ae5b1166ff.tar.xz
vf: move norm_qscale() to the only filter which uses it
Diffstat (limited to 'video/filter/vf_dlopen.c')
-rw-r--r--video/filter/vf_dlopen.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/video/filter/vf_dlopen.c b/video/filter/vf_dlopen.c
index 2378b84674..5bf8198ce7 100644
--- a/video/filter/vf_dlopen.c
+++ b/video/filter/vf_dlopen.c
@@ -208,6 +208,21 @@ static void uninit(struct vf_instance *vf)
}
}
+static int norm_qscale(int qscale, int type)
+{
+ switch (type) {
+ case 0: // MPEG-1
+ return qscale;
+ case 1: // MPEG-2
+ return qscale >> 1;
+ case 2: // H264
+ return qscale >> 2;
+ case 3: // VP56
+ return (63 - qscale + 2) >> 2;
+ }
+ return qscale;
+}
+
static int filter(struct vf_instance *vf, struct mp_image *mpi)
{
int i, k;