summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_dlopen.c
diff options
context:
space:
mode:
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;