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:
parent
e3809e5b52
commit
b2c4653b88
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user