comparison postproc/swscale_template.c @ 9494:543ab3909b78

sws_ prefix, more seperation between internal & external swscaler API sws_scale() returns the number of outputed lines
author michael
date Sun, 23 Feb 2003 22:05:55 +0000
parents eff727517e6b
children bc5b87370cd1
comparison
equal deleted inserted replaced
9493:d1f82707ad78 9494:543ab3909b78
2500 } 2500 }
2501 #endif 2501 #endif
2502 } 2502 }
2503 } 2503 }
2504 2504
2505 static void RENAME(swScale)(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcSliceY, 2505 static int RENAME(swScale)(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcSliceY,
2506 int srcSliceH, uint8_t* dstParam[], int dstStrideParam[]){ 2506 int srcSliceH, uint8_t* dstParam[], int dstStrideParam[]){
2507 2507
2508 /* load a few things into local vars to make the code more readable? and faster */ 2508 /* load a few things into local vars to make the code more readable? and faster */
2509 const int srcW= c->srcW; 2509 const int srcW= c->srcW;
2510 const int dstW= c->dstW; 2510 const int dstW= c->dstW;
2538 uint8_t *funnyYCode= c->funnyYCode; 2538 uint8_t *funnyYCode= c->funnyYCode;
2539 uint8_t *funnyUVCode= c->funnyUVCode; 2539 uint8_t *funnyUVCode= c->funnyUVCode;
2540 uint8_t *formatConvBuffer= c->formatConvBuffer; 2540 uint8_t *formatConvBuffer= c->formatConvBuffer;
2541 const int chrSrcSliceY= srcSliceY >> c->chrSrcVSubSample; 2541 const int chrSrcSliceY= srcSliceY >> c->chrSrcVSubSample;
2542 const int chrSrcSliceH= -((-srcSliceH) >> c->chrSrcVSubSample); 2542 const int chrSrcSliceH= -((-srcSliceH) >> c->chrSrcVSubSample);
2543 int lastDstY;
2543 2544
2544 /* vars whch will change and which we need to storw back in the context */ 2545 /* vars whch will change and which we need to storw back in the context */
2545 int dstY= c->dstY; 2546 int dstY= c->dstY;
2546 int lumBufIndex= c->lumBufIndex; 2547 int lumBufIndex= c->lumBufIndex;
2547 int chrBufIndex= c->chrBufIndex; 2548 int chrBufIndex= c->chrBufIndex;
2600 chrBufIndex=0; 2601 chrBufIndex=0;
2601 dstY=0; 2602 dstY=0;
2602 lastInLumBuf= -1; 2603 lastInLumBuf= -1;
2603 lastInChrBuf= -1; 2604 lastInChrBuf= -1;
2604 } 2605 }
2606
2607 lastDstY= dstY;
2605 2608
2606 for(;dstY < dstH; dstY++){ 2609 for(;dstY < dstH; dstY++){
2607 unsigned char *dest =dst[0]+dstStride[0]*dstY; 2610 unsigned char *dest =dst[0]+dstStride[0]*dstY;
2608 const int chrDstY= dstY>>c->chrDstVSubSample; 2611 const int chrDstY= dstY>>c->chrDstVSubSample;
2609 unsigned char *uDest=dst[1]+dstStride[1]*chrDstY; 2612 unsigned char *uDest=dst[1]+dstStride[1]*chrDstY;
2808 c->dstY= dstY; 2811 c->dstY= dstY;
2809 c->lumBufIndex= lumBufIndex; 2812 c->lumBufIndex= lumBufIndex;
2810 c->chrBufIndex= chrBufIndex; 2813 c->chrBufIndex= chrBufIndex;
2811 c->lastInLumBuf= lastInLumBuf; 2814 c->lastInLumBuf= lastInLumBuf;
2812 c->lastInChrBuf= lastInChrBuf; 2815 c->lastInChrBuf= lastInChrBuf;
2816
2817 return dstY - lastDstY;
2813 } 2818 }