summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-18 18:11:26 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-18 18:11:26 +0000
commit1a84744160e610247d25a873cb78459a7f7682e3 (patch)
tree63e8f805c3c8d6c5a8b037644a82c0f03777828f /libmpcodecs
parent7df320df985ae31dc8ffbfe3b534500d292cb0d2 (diff)
downloadmpv-1a84744160e610247d25a873cb78459a7f7682e3.tar.bz2
mpv-1a84744160e610247d25a873cb78459a7f7682e3.tar.xz
negative quality values allow postproc regardless of input
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17224 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_fspp.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c
index 2428e2e828..6dea7f75c5 100644
--- a/libmpcodecs/vf_fspp.c
+++ b/libmpcodecs/vf_fspp.c
@@ -88,6 +88,9 @@ static const uint8_t __attribute__((aligned(32))) dither[8][8]={
{ 42, 26, 38, 22, 41, 25, 37, 21, },
};
+#define VF_FSPP_BFRAMES 1
+#define VF_FSPP_FORCE 2
+
struct vf_priv_s { //align 16 !
uint64_t threshold_mtx_noq[8*2];
uint64_t threshold_mtx[8*2];//used in both C & MMX (& later SSE2) versions
@@ -99,7 +102,7 @@ struct vf_priv_s { //align 16 !
int prev_q;
uint8_t *src;
int16_t *temp;
- int bframes;
+ int flags;
char *non_b_qp;
};
@@ -543,11 +546,12 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
}
if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
char *qp_tab= vf->priv->non_b_qp;
- if(vf->priv->bframes || !qp_tab)
+ if((vf->priv->flags & VF_FSPP_BFRAMES) || !qp_tab)
qp_tab= mpi->qscale;
if((qp_tab || vf->priv->qp)
- && (mpi->qscale_type == FF_QSCALE_TYPE_MPEG1 || mpi->qscale_type == FF_QSCALE_TYPE_MPEG2)){
+ && ((vf->priv->flags & VF_FSPP_FORCE)
+ || mpi->qscale_type == FF_QSCALE_TYPE_MPEG1 || mpi->qscale_type == FF_QSCALE_TYPE_MPEG2)){
filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0],
mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1],
@@ -643,6 +647,7 @@ static int open(vf_instance_t *vf, char* args)
int i=0, bias;
int custom_threshold_m[64];
int log2c=-1;
+ int bframes;
vf->config=config;
vf->put_image=put_image;
@@ -658,11 +663,15 @@ static int open(vf_instance_t *vf, char* args)
//dsputil_init(&vf->priv->dsp, vf->priv->avctx);
vf->priv->log2_count= 4;
- vf->priv->bframes = 0;
+ vf->priv->flags = 0;
- if (args) sscanf(args, "%d:%d:%d:%d", &log2c, &vf->priv->qp, &i, &vf->priv->bframes);
+ if (args) sscanf(args, "%d:%d:%d:%d", &log2c, &vf->priv->qp, &i, &bframes);
+ vf->priv->flags |= bframes ? VF_FSPP_BFRAMES : 0;
- if( log2c >=4 && log2c <=5 )
+ if( log2c >=-5 && log2c <=-4 ) {
+ vf->priv->log2_count = -log2c;
+ vf->priv->flags |= VF_FSPP_FORCE;
+ } else if( log2c >=4 && log2c <=5 )
vf->priv->log2_count = log2c;
else if( log2c >= 6 )
vf->priv->log2_count = 5;