summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-16 22:34:48 +0000
committerramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-16 22:34:48 +0000
commitd41ec8ed48821c0796ef04dfa2b54d8ffe7a1919 (patch)
tree5b171badb6d3a0e2bca1d847b39a69a16b390b64 /libswscale
parentb769ea34ea539ba49d48b409ec8de358e3cf2c0f (diff)
downloadmpv-d41ec8ed48821c0796ef04dfa2b54d8ffe7a1919.tar.bz2
mpv-d41ec8ed48821c0796ef04dfa2b54d8ffe7a1919.tar.xz
Cleanup buffer debugs in swScale().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29686 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale_template.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index ad07bf7e5d..27faf49d35 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2529,6 +2529,9 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
}
}
+#define DEBUG_SWSCALE_BUFFERS 0
+#define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
+
static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
{
@@ -2589,11 +2592,13 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
srcStride[1]<<= c->vChrDrop;
srcStride[2]<<= c->vChrDrop;
- //printf("swscale %X %X %X -> %X %X %X\n", (int)src[0], (int)src[1], (int)src[2],
- // (int)dst[0], (int)dst[1], (int)dst[2]);
-
- //printf("sws Strides:%d %d %d -> %d %d %d\n", srcStride[0],srcStride[1],srcStride[2],
- //dstStride[0],dstStride[1],dstStride[2]);
+ DEBUG_BUFFERS("swScale() %p[%d] %p[%d] %p[%d] %p[%d] -> %p[%d] %p[%d] %p[%d] %p[%d]\n",
+ src[0], srcStride[0], src[1], srcStride[1], src[2], srcStride[2], src[3], srcStride[3],
+ dst[0], dstStride[0], dst[1], dstStride[1], dst[2], dstStride[2], dst[3], dstStride[3]);
+ DEBUG_BUFFERS("srcSliceY: %d srcSliceH: %d dstY: %d dstH: %d\n",
+ srcSliceY, srcSliceH, dstY, dstH);
+ DEBUG_BUFFERS("vLumFilterSize: %d vLumBufSize: %d vChrFilterSize: %d vChrBufSize: %d\n",
+ vLumFilterSize, vLumBufSize, vChrFilterSize, vChrBufSize);
if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0 || dstStride[3]%8 != 0) {
static int warnedAlready=0; //FIXME move this into the context perhaps
@@ -2630,12 +2635,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
int lastChrSrcY= firstChrSrcY + vChrFilterSize -1; // Last line needed as input
int enough_lines;
- //printf("dstY:%d dstH:%d firstLumSrcY:%d lastInLumBuf:%d vLumBufSize: %d vChrBufSize: %d slice: %d %d vLumFilterSize: %d firstChrSrcY: %d vChrFilterSize: %d c->chrSrcVSubSample: %d\n",
- // dstY, dstH, firstLumSrcY, lastInLumBuf, vLumBufSize, vChrBufSize, srcSliceY, srcSliceH, vLumFilterSize, firstChrSrcY, vChrFilterSize, c->chrSrcVSubSample);
//handle holes (FAST_BILINEAR & weird filters)
if (firstLumSrcY > lastInLumBuf) lastInLumBuf= firstLumSrcY-1;
if (firstChrSrcY > lastInChrBuf) lastInChrBuf= firstChrSrcY-1;
- //printf("%d %d %d\n", firstChrSrcY, lastInChrBuf, vChrBufSize);
assert(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1);
assert(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1);
@@ -2646,21 +2648,22 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1;
}
- /* printf("%d %d Last:%d %d LastInBuf:%d %d Index:%d %d Y:%d FSize: %d %d BSize: %d %d\n",
- firstChrSrcY,firstLumSrcY,lastChrSrcY,lastLumSrcY,
- lastInChrBuf,lastInLumBuf,chrBufIndex,lumBufIndex,dstY,vChrFilterSize,vLumFilterSize,
- vChrBufSize, vLumBufSize);*/
+ DEBUG_BUFFERS("dstY: %d\n", dstY);
+ DEBUG_BUFFERS("\tfirstLumSrcY: %d lastLumSrcY: %d lastInLumBuf: %d\n",
+ firstLumSrcY, lastLumSrcY, lastInLumBuf);
+ DEBUG_BUFFERS("\tfirstChrSrcY: %d lastChrSrcY: %d lastInChrBuf: %d\n",
+ firstChrSrcY, lastChrSrcY, lastInChrBuf);
//Do horizontal scaling
while(lastInLumBuf < lastLumSrcY) {
uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
lumBufIndex++;
- //printf("%d %d %d %d\n", lumBufIndex, vLumBufSize, lastInLumBuf, lastLumSrcY);
+ DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n",
+ lumBufIndex, lastInLumBuf);
assert(lumBufIndex < 2*vLumBufSize);
assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
assert(lastInLumBuf + 1 - srcSliceY >= 0);
- //printf("%d %d\n", lumBufIndex, vLumBufSize);
RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc,
flags, hLumFilter, hLumFilterPos, hLumFilterSize,
c->srcFormat, formatConvBuffer,
@@ -2676,6 +2679,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1];
uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2];
chrBufIndex++;
+ DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n",
+ chrBufIndex, lastInChrBuf);
assert(chrBufIndex < 2*vChrBufSize);
assert(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH));
assert(lastInChrBuf + 1 - chrSrcSliceY >= 0);