comparison libmpcodecs/vf_fspp.c @ 17221:c4591717390c

do not postprocess H264
author henry
date Sun, 18 Dec 2005 13:35:48 +0000
parents a2b24e0d7772
children 7a7958403de3
comparison
equal deleted inserted replaced
17220:a27e52b838e3 17221:c4591717390c
93 uint64_t threshold_mtx[8*2];//used in both C & MMX (& later SSE2) versions 93 uint64_t threshold_mtx[8*2];//used in both C & MMX (& later SSE2) versions
94 94
95 int log2_count; 95 int log2_count;
96 int temp_stride; 96 int temp_stride;
97 int qp; 97 int qp;
98 int mpeg2; 98 int qscale_type;
99 int prev_q; 99 int prev_q;
100 uint8_t *src; 100 uint8_t *src;
101 int16_t *temp; 101 int16_t *temp;
102 int bframes; 102 int bframes;
103 char *non_b_qp; 103 char *non_b_qp;
456 else 456 else
457 for (x=0; x<8*(BLOCKSZ-1); x+=8) { 457 for (x=0; x<8*(BLOCKSZ-1); x+=8) {
458 t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same 458 t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same
459 if (t<0) t=0;//t always < width-2 459 if (t<0) t=0;//t always < width-2
460 t=qp_store[qy+(t>>qps)]; 460 t=qp_store[qy+(t>>qps)];
461 if(p->mpeg2) t>>=1; //copy p->mpeg2,prev_q to locals? 461 if(p->qscale_type == FF_QSCALE_TYPE_MPEG2) t>>=1; //copy p->mpeg2,prev_q to locals?
462 if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t); 462 if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t);
463 column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT 463 column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT
464 } 464 }
465 row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1)); 465 row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1));
466 memcpy(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling 466 memcpy(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling
533 vf_clone_mpi_attributes(dmpi, mpi); 533 vf_clone_mpi_attributes(dmpi, mpi);
534 }else{ 534 }else{
535 dmpi=vf->dmpi; 535 dmpi=vf->dmpi;
536 } 536 }
537 537
538 vf->priv->mpeg2= mpi->qscale_type; 538 vf->priv->qscale_type= mpi->qscale_type;
539 if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){ 539 if(mpi->pict_type != 3 && mpi->qscale && !vf->priv->qp){
540 if(!vf->priv->non_b_qp) 540 if(!vf->priv->non_b_qp)
541 vf->priv->non_b_qp= malloc(mpi->qstride * mpi->h); 541 vf->priv->non_b_qp= malloc(mpi->qstride * mpi->h);
542 memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * mpi->h); 542 memcpy(vf->priv->non_b_qp, mpi->qscale, mpi->qstride * mpi->h);
543 } 543 }
544 if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){ 544 if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
545 char *qp_tab= vf->priv->non_b_qp; 545 char *qp_tab= vf->priv->non_b_qp;
546 if(vf->priv->bframes || !qp_tab) 546 if(vf->priv->bframes || !qp_tab)
547 qp_tab= mpi->qscale; 547 qp_tab= mpi->qscale;
548 548
549 if(qp_tab || vf->priv->qp){ 549 if((qp_tab || vf->priv->qp)
550 && (mpi->qscale_type == FF_QSCALE_TYPE_MPEG1 || mpi->qscale_type == FF_QSCALE_TYPE_MPEG2)){
550 filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], 551 filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0],
551 mpi->w, mpi->h, qp_tab, mpi->qstride, 1); 552 mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
552 filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], 553 filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1],
553 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0); 554 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
554 filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], 555 filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2],