comparison libswscale/swscale.c @ 30285:042ec58ab0e2

Reuse h{lum,chr}Filter{,Pos} variables for MMX2 fast_bilinear horizontal scaler.
author ramiro
date Sat, 16 Jan 2010 18:39:06 +0000
parents 03f99130b7c3
children 67cace3e3df7
comparison
equal deleted inserted replaced
30284:03f99130b7c3 30285:042ec58ab0e2
2688 #else 2688 #else
2689 c->lumMmx2FilterCode = av_malloc(c->lumMmx2FilterCodeSize); 2689 c->lumMmx2FilterCode = av_malloc(c->lumMmx2FilterCodeSize);
2690 c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize); 2690 c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize);
2691 #endif 2691 #endif
2692 2692
2693 FF_ALLOCZ_OR_GOTO(c, c->lumMmx2Filter , (dstW /8+8)*sizeof(int16_t), fail); 2693 FF_ALLOCZ_OR_GOTO(c, c->hLumFilter , (dstW /8+8)*sizeof(int16_t), fail);
2694 FF_ALLOCZ_OR_GOTO(c, c->chrMmx2Filter , (c->chrDstW /4+8)*sizeof(int16_t), fail); 2694 FF_ALLOCZ_OR_GOTO(c, c->hChrFilter , (c->chrDstW /4+8)*sizeof(int16_t), fail);
2695 FF_ALLOCZ_OR_GOTO(c, c->lumMmx2FilterPos, (dstW /2/8+8)*sizeof(int32_t), fail); 2695 FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW /2/8+8)*sizeof(int32_t), fail);
2696 FF_ALLOCZ_OR_GOTO(c, c->chrMmx2FilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail); 2696 FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail);
2697 2697
2698 initMMX2HScaler( dstW, c->lumXInc, c->lumMmx2FilterCode, c->lumMmx2Filter, c->lumMmx2FilterPos, 8); 2698 initMMX2HScaler( dstW, c->lumXInc, c->lumMmx2FilterCode, c->hLumFilter, c->hLumFilterPos, 8);
2699 initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4); 2699 initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->hChrFilter, c->hChrFilterPos, 4);
2700 2700
2701 #ifdef MAP_ANONYMOUS 2701 #ifdef MAP_ANONYMOUS
2702 mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ); 2702 mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
2703 mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ); 2703 mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
2704 #endif 2704 #endif
3421 #endif 3421 #endif
3422 c->lumMmx2FilterCode=NULL; 3422 c->lumMmx2FilterCode=NULL;
3423 c->chrMmx2FilterCode=NULL; 3423 c->chrMmx2FilterCode=NULL;
3424 #endif /* ARCH_X86 && CONFIG_GPL */ 3424 #endif /* ARCH_X86 && CONFIG_GPL */
3425 3425
3426 av_freep(&c->lumMmx2Filter);
3427 av_freep(&c->chrMmx2Filter);
3428 av_freep(&c->lumMmx2FilterPos);
3429 av_freep(&c->chrMmx2FilterPos);
3430 av_freep(&c->yuvTable); 3426 av_freep(&c->yuvTable);
3431 3427
3432 av_free(c); 3428 av_free(c);
3433 } 3429 }
3434 3430