--- libpostproc/postprocess_template.c | 189 +++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 94 deletions(-)
diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index 344152e..584cb4c 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -3291,14 +3291,14 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ if(mode & CUBIC_IPOL_DEINT_FILTER) copyAhead=16; else if( (mode & LINEAR_BLEND_DEINT_FILTER) - || (mode & FFMPEG_DEINT_FILTER) - || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14; + || (mode & FFMPEG_DEINT_FILTER) + || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14; else if( (mode & V_DEBLOCK) - || (mode & LINEAR_IPOL_DEINT_FILTER) - || (mode & MEDIAN_DEINT_FILTER) - || (mode & V_A_DEBLOCK)) copyAhead=13; + || (mode & LINEAR_IPOL_DEINT_FILTER) + || (mode & MEDIAN_DEINT_FILTER) + || (mode & V_A_DEBLOCK)) copyAhead=13; else if(mode & V_X1_FILTER) copyAhead=11; -// else if(mode & V_RK1_FILTER) copyAhead=10; + // else if(mode & V_RK1_FILTER) copyAhead=10; else if(mode & DERING) copyAhead=9; else copyAhead=8; @@ -3390,9 +3390,9 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); else if(mode & LOWPASS5_DEINT_FILTER) RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x); -/* else if(mode & CUBIC_BLEND_DEINT_FILTER) - RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); -*/ + /* else if(mode & CUBIC_BLEND_DEINT_FILTER) + RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); + */ dstBlock+=8; srcBlock+=8; } @@ -3428,14 +3428,14 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ /* duplicate last line of src to fill the void up to line (copyAhead+7) */ for(i=FFMAX(height-y, 8); i<copyAhead+8; i++) - memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), FFABS(srcStride)); + memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), FFABS(srcStride)); /* copy up to (copyAhead+1) lines of dst (line -1 to (copyAhead-1))*/ linecpy(tempDst, dstBlock - dstStride, FFMIN(height-y+1, copyAhead+1), dstStride); /* duplicate last line of dst to fill the void up to line (copyAhead) */ for(i=height-y+1; i<=copyAhead; i++) - memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), FFABS(dstStride)); + memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), FFABS(dstStride)); dstBlock= tempDst + dstStride; srcBlock= tempSrc; @@ -3512,112 +3512,113 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ c.pQPb = c.pQPb_block[qp_index]; c.pQPb2 = c.pQPb2_block[qp_index++]; - /* only deblock if we have 2 blocks */ - if(y + 8 < height){ - if(mode & V_X1_FILTER) - RENAME(vertX1Filter)(dstBlock, stride, &c); - else if(mode & V_DEBLOCK){ - const int t= RENAME(vertClassify)(dstBlock, stride, &c); - - if(t==1) - RENAME(doVertLowPass)(dstBlock, stride, &c); - else if(t==2) - RENAME(doVertDefFilter)(dstBlock, stride, &c); - }else if(mode & V_A_DEBLOCK){ - RENAME(do_a_deblock)(dstBlock, stride, 1, &c, mode); + /* only deblock if we have 2 blocks */ + if(y + 8 < height){ + if(mode & V_X1_FILTER) + RENAME(vertX1Filter)(dstBlock, stride, &c); + else if(mode & V_DEBLOCK){ + const int t= RENAME(vertClassify)(dstBlock, stride, &c); + + if(t==1) + RENAME(doVertLowPass)(dstBlock, stride, &c); + else if(t==2) + RENAME(doVertDefFilter)(dstBlock, stride, &c); + }else if(mode & V_A_DEBLOCK){ + RENAME(do_a_deblock)(dstBlock, stride, 1, &c, mode); + } } + + dstBlock+=8; + srcBlock+=8; } - dstBlock+=8; - srcBlock+=8; - } - qp_index = 0; - dstBlock = dstBlockStart; - srcBlock = srcBlockStart; + qp_index = 0; + dstBlock = dstBlockStart; + srcBlock = srcBlockStart; - for(x = startx; x < endx; x+=BLOCK_SIZE){ - const int stride= dstStride; - av_unused uint8_t *tmpXchg; + for(x = startx; x < endx; x+=BLOCK_SIZE){ + const int stride= dstStride; + av_unused uint8_t *tmpXchg; - c.QP = c.QP_block[qp_index]; - c.nonBQP = c.nonBQP_block[qp_index]; - c.pQPb = c.pQPb_block[qp_index]; - c.pQPb2 = c.pQPb2_block[qp_index++]; + c.QP = c.QP_block[qp_index]; + c.nonBQP = c.nonBQP_block[qp_index]; + c.pQPb = c.pQPb_block[qp_index]; + c.pQPb2 = c.pQPb2_block[qp_index++]; #if TEMPLATE_PP_MMX - RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); + RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); #endif - /* check if we have a previous block to deblock it with dstBlock */ - if(x - 8 >= 0){ + /* check if we have a previous block to deblock it with dstBlock */ + if(x - 8 >= 0){ #if TEMPLATE_PP_MMX - if(mode & H_X1_FILTER) + if(mode & H_X1_FILTER) RENAME(vertX1Filter)(tempBlock1, 16, &c); - else if(mode & H_DEBLOCK){ - const int t= RENAME(vertClassify)(tempBlock1, 16, &c); - if(t==1) - RENAME(doVertLowPass)(tempBlock1, 16, &c); - else if(t==2) - RENAME(doVertDefFilter)(tempBlock1, 16, &c); - }else if(mode & H_A_DEBLOCK){ + else if(mode & H_DEBLOCK){ + const int t= RENAME(vertClassify)(tempBlock1, 16, &c); + if(t==1) + RENAME(doVertLowPass)(tempBlock1, 16, &c); + else if(t==2) + RENAME(doVertDefFilter)(tempBlock1, 16, &c); + }else if(mode & H_A_DEBLOCK){ RENAME(do_a_deblock)(tempBlock1, 16, 1, &c, mode); - } + } - RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16); + RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16); #else - if(mode & H_X1_FILTER) - horizX1Filter(dstBlock-4, stride, c.QP); - else if(mode & H_DEBLOCK){ + if(mode & H_X1_FILTER) + horizX1Filter(dstBlock-4, stride, c.QP); + else if(mode & H_DEBLOCK){ #if TEMPLATE_PP_ALTIVEC - DECLARE_ALIGNED(16, unsigned char, tempBlock)[272]; - int t; - transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride); - - t = vertClassify_altivec(tempBlock-48, 16, &c); - if(t==1) { - doVertLowPass_altivec(tempBlock-48, 16, &c); - transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); - } - else if(t==2) { - doVertDefFilter_altivec(tempBlock-48, 16, &c); - transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); - } + DECLARE_ALIGNED(16, unsigned char, tempBlock)[272]; + int t; + transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride); + + t = vertClassify_altivec(tempBlock-48, 16, &c); + if(t==1) { + doVertLowPass_altivec(tempBlock-48, 16, &c); + transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); + } + else if(t==2) { + doVertDefFilter_altivec(tempBlock-48, 16, &c); + transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); + } #else - const int t= RENAME(horizClassify)(dstBlock-4, stride, &c); + const int t= RENAME(horizClassify)(dstBlock-4, stride, &c); - if(t==1) - RENAME(doHorizLowPass)(dstBlock-4, stride, &c); - else if(t==2) - RENAME(doHorizDefFilter)(dstBlock-4, stride, &c); + if(t==1) + RENAME(doHorizLowPass)(dstBlock-4, stride, &c); + else if(t==2) + RENAME(doHorizDefFilter)(dstBlock-4, stride, &c); #endif - }else if(mode & H_A_DEBLOCK){ - RENAME(do_a_deblock)(dstBlock-8, 1, stride, &c, mode); - } + }else if(mode & H_A_DEBLOCK){ + RENAME(do_a_deblock)(dstBlock-8, 1, stride, &c, mode); + } #endif //TEMPLATE_PP_MMX - if(mode & DERING){ - //FIXME filter first line - if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c); - } + if(mode & DERING){ + //FIXME filter first line + if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c); + } - if(mode & TEMP_NOISE_FILTER) - { - RENAME(tempNoiseReducer)(dstBlock-8, stride, - c.tempBlurred[isColor] + y*dstStride + x, - c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, - c.ppMode.maxTmpNoise); + if(mode & TEMP_NOISE_FILTER) + { + RENAME(tempNoiseReducer)(dstBlock-8, stride, + c.tempBlurred[isColor] + y*dstStride + x, + c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, + c.ppMode.maxTmpNoise); + } } - } - dstBlock+=8; - srcBlock+=8; + dstBlock+=8; + srcBlock+=8; #if TEMPLATE_PP_MMX - tmpXchg= tempBlock1; - tempBlock1= tempBlock2; - tempBlock2 = tmpXchg; + tmpXchg= tempBlock1; + tempBlock1= tempBlock2; + tempBlock2 = tmpXchg; #endif - } + } } if(mode & DERING){ @@ -3626,9 +3627,9 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ if((mode & TEMP_NOISE_FILTER)){ RENAME(tempNoiseReducer)(dstBlock-8, dstStride, - c.tempBlurred[isColor] + y*dstStride + x, - c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, - c.ppMode.maxTmpNoise); + c.tempBlurred[isColor] + y*dstStride + x, + c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, + c.ppMode.maxTmpNoise); } /* did we use a tmp buffer for the last lines*/ -- 2.3.3 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel