1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

vf: move norm_qscale() to the only filter which uses it

This commit is contained in:
wm4 2013-12-05 22:55:21 +01:00
parent e3809e5b52
commit b2c4653b88
2 changed files with 15 additions and 15 deletions

View File

@ -151,21 +151,6 @@ void vf_rescale_dsize(int *d_width, int *d_height, int old_w, int old_h,
int new_w, int new_h);
void vf_set_dar(int *d_width, int *d_height, int w, int h, double dar);
static inline 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;
}
struct vf_detc_pts_buf {
double inpts_prev, outpts_prev;
double lastdelta;

View File

@ -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;