comparison postproc/postprocess_template.c @ 8805:e547ce712577

YUV 411/422/444 support for pp
author michael
date Sun, 05 Jan 2003 19:10:42 +0000
parents 809adad85bbc
children 8b2dde0dccf6
comparison
equal deleted inserted replaced
8804:b233200c3fca 8805:e547ce712577
2661 int copyAhead; 2661 int copyAhead;
2662 #ifdef HAVE_MMX 2662 #ifdef HAVE_MMX
2663 int i; 2663 int i;
2664 #endif 2664 #endif
2665 2665
2666 const int qpHShift= isColor ? 4-c.hChromaSubSample : 4;
2667 const int qpVShift= isColor ? 4-c.vChromaSubSample : 4;
2668
2666 //FIXME remove 2669 //FIXME remove
2667 uint64_t * const yHistogram= c.yHistogram; 2670 uint64_t * const yHistogram= c.yHistogram;
2668 uint8_t * const tempSrc= c.tempSrc; 2671 uint8_t * const tempSrc= c.tempSrc;
2669 uint8_t * const tempDst= c.tempDst; 2672 uint8_t * const tempDst= c.tempDst;
2670 const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; 2673 const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4;
2844 uint8_t *dstBlock= &(dst[y*dstStride]); 2847 uint8_t *dstBlock= &(dst[y*dstStride]);
2845 #ifdef HAVE_MMX 2848 #ifdef HAVE_MMX
2846 uint8_t *tempBlock1= c.tempBlocks; 2849 uint8_t *tempBlock1= c.tempBlocks;
2847 uint8_t *tempBlock2= c.tempBlocks + 8; 2850 uint8_t *tempBlock2= c.tempBlocks + 8;
2848 #endif 2851 #endif
2849 int8_t *QPptr= isColor ? &QPs[(y>>3)*QPStride] :&QPs[(y>>4)*QPStride]; 2852 int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride];
2850 int8_t *nonBQPptr= isColor ? &c.nonBQPTable[(y>>3)*mbWidth] :&c.nonBQPTable[(y>>4)*mbWidth]; 2853 int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*mbWidth];
2851 int QP=0; 2854 int QP=0;
2852 /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards 2855 /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
2853 if not than use a temporary buffer */ 2856 if not than use a temporary buffer */
2854 if(y+15 >= height) 2857 if(y+15 >= height)
2855 { 2858 {
2884 #ifdef HAVE_MMX 2887 #ifdef HAVE_MMX
2885 uint8_t *tmpXchg; 2888 uint8_t *tmpXchg;
2886 #endif 2889 #endif
2887 if(isColor) 2890 if(isColor)
2888 { 2891 {
2889 QP= QPptr[x>>3]; 2892 QP= QPptr[x>>qpHShift];
2890 c.nonBQP= nonBQPptr[x>>3]; 2893 c.nonBQP= nonBQPptr[x>>qpHShift];
2891 } 2894 }
2892 else 2895 else
2893 { 2896 {
2894 QP= QPptr[x>>4]; 2897 QP= QPptr[x>>4];
2895 QP= (QP* QPCorrecture + 256*128)>>16; 2898 QP= (QP* QPCorrecture + 256*128)>>16;