From 335f35f2bf4d6fbc7caa9a27e8f8d21f4c937477 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 19 Dec 2005 18:04:37 +0000 Subject: [PATCH] reverse the H264 hack git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17226 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 5 +---- libmpcodecs/vf_fspp.c | 28 +++++++++------------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 20cc5f615a..462708b2cb 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -4925,10 +4925,7 @@ Force quantization parameter (default: 0, use QP from video). . .TP .B fspp[=quality[:qp[:strength[:bframes]]]] -Faster version of the simple postprocessing filter. Turned off by -default for H264 content as this filter only causes excessive blur -with it. You can force filtering even with H264 using negative values -for quality parameter. +faster version of the simple postprocessing filter .RSs .IPs 4\-5 (equivalent to spp; default: 4) diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c index 6dea7f75c5..25bf1f46d5 100644 --- a/libmpcodecs/vf_fspp.c +++ b/libmpcodecs/vf_fspp.c @@ -88,9 +88,6 @@ 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 @@ -98,11 +95,11 @@ struct vf_priv_s { //align 16 ! int log2_count; int temp_stride; int qp; - int qscale_type; + int mpeg2; int prev_q; uint8_t *src; int16_t *temp; - int flags; + int bframes; char *non_b_qp; }; @@ -461,7 +458,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same if (t<0) t=0;//t always < width-2 t=qp_store[qy+(t>>qps)]; - if(p->qscale_type == FF_QSCALE_TYPE_MPEG2) t>>=1; //copy p->mpeg2,prev_q to locals? + if(p->mpeg2) t>>=1; //copy p->mpeg2,prev_q to locals? if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t); column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT } @@ -538,7 +535,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi) dmpi=vf->dmpi; } - vf->priv->qscale_type= mpi->qscale_type; + vf->priv->mpeg2= mpi->qscale_type; if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){ if(!vf->priv->non_b_qp) vf->priv->non_b_qp= malloc(mpi->qstride * mpi->h); @@ -546,12 +543,10 @@ 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->flags & VF_FSPP_BFRAMES) || !qp_tab) + if(vf->priv->bframes || !qp_tab) qp_tab= mpi->qscale; - if((qp_tab || vf->priv->qp) - && ((vf->priv->flags & VF_FSPP_FORCE) - || mpi->qscale_type == FF_QSCALE_TYPE_MPEG1 || mpi->qscale_type == FF_QSCALE_TYPE_MPEG2)){ + if(qp_tab || vf->priv->qp){ 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], @@ -647,7 +642,6 @@ 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; @@ -663,15 +657,11 @@ static int open(vf_instance_t *vf, char* args) //dsputil_init(&vf->priv->dsp, vf->priv->avctx); vf->priv->log2_count= 4; - vf->priv->flags = 0; + vf->priv->bframes = 0; - if (args) sscanf(args, "%d:%d:%d:%d", &log2c, &vf->priv->qp, &i, &bframes); - vf->priv->flags |= bframes ? VF_FSPP_BFRAMES : 0; + if (args) sscanf(args, "%d:%d:%d:%d", &log2c, &vf->priv->qp, &i, &vf->priv->bframes); - if( log2c >=-5 && log2c <=-4 ) { - vf->priv->log2_count = -log2c; - vf->priv->flags |= VF_FSPP_FORCE; - } else if( log2c >=4 && log2c <=5 ) + if( log2c >=4 && log2c <=5 ) vf->priv->log2_count = log2c; else if( log2c >= 6 ) vf->priv->log2_count = 5;