1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

swscale: fixed compiler warnings

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Pedro Arthur 2015-08-18 15:06:49 -03:00 committed by Michael Niedermayer
parent 0f3687d6fb
commit ed80dec621
3 changed files with 25 additions and 16 deletions

View File

@ -321,35 +321,45 @@ static int swscale(SwsContext *c, const uint8_t *src[],
{ {
/* load a few things into local vars to make the code more readable? /* load a few things into local vars to make the code more readable?
* and faster */ * and faster */
#ifndef NEW_FILTER
const int srcW = c->srcW; const int srcW = c->srcW;
#endif
const int dstW = c->dstW; const int dstW = c->dstW;
const int dstH = c->dstH; const int dstH = c->dstH;
const int chrDstW = c->chrDstW; const int chrDstW = c->chrDstW;
#ifndef NEW_FILTER
const int chrSrcW = c->chrSrcW; const int chrSrcW = c->chrSrcW;
const int lumXInc = c->lumXInc; const int lumXInc = c->lumXInc;
const int chrXInc = c->chrXInc; const int chrXInc = c->chrXInc;
#endif
const enum AVPixelFormat dstFormat = c->dstFormat; const enum AVPixelFormat dstFormat = c->dstFormat;
const int flags = c->flags; const int flags = c->flags;
int32_t *vLumFilterPos = c->vLumFilterPos; int32_t *vLumFilterPos = c->vLumFilterPos;
int32_t *vChrFilterPos = c->vChrFilterPos; int32_t *vChrFilterPos = c->vChrFilterPos;
#ifndef NEW_FILTER
int32_t *hLumFilterPos = c->hLumFilterPos; int32_t *hLumFilterPos = c->hLumFilterPos;
int32_t *hChrFilterPos = c->hChrFilterPos; int32_t *hChrFilterPos = c->hChrFilterPos;
int16_t *hLumFilter = c->hLumFilter; int16_t *hLumFilter = c->hLumFilter;
int16_t *hChrFilter = c->hChrFilter; int16_t *hChrFilter = c->hChrFilter;
#endif
int32_t *lumMmxFilter = c->lumMmxFilter; int32_t *lumMmxFilter = c->lumMmxFilter;
int32_t *chrMmxFilter = c->chrMmxFilter; int32_t *chrMmxFilter = c->chrMmxFilter;
const int vLumFilterSize = c->vLumFilterSize; const int vLumFilterSize = c->vLumFilterSize;
const int vChrFilterSize = c->vChrFilterSize; const int vChrFilterSize = c->vChrFilterSize;
#ifndef NEW_FILTER
const int hLumFilterSize = c->hLumFilterSize; const int hLumFilterSize = c->hLumFilterSize;
const int hChrFilterSize = c->hChrFilterSize; const int hChrFilterSize = c->hChrFilterSize;
int16_t **lumPixBuf = c->lumPixBuf; int16_t **lumPixBuf = c->lumPixBuf;
int16_t **chrUPixBuf = c->chrUPixBuf; int16_t **chrUPixBuf = c->chrUPixBuf;
int16_t **chrVPixBuf = c->chrVPixBuf; int16_t **chrVPixBuf = c->chrVPixBuf;
#endif
int16_t **alpPixBuf = c->alpPixBuf; int16_t **alpPixBuf = c->alpPixBuf;
const int vLumBufSize = c->vLumBufSize; const int vLumBufSize = c->vLumBufSize;
const int vChrBufSize = c->vChrBufSize; const int vChrBufSize = c->vChrBufSize;
#ifndef NEW_FILTER
uint8_t *formatConvBuffer = c->formatConvBuffer; uint8_t *formatConvBuffer = c->formatConvBuffer;
uint32_t *pal = c->pal_yuv; uint32_t *pal = c->pal_yuv;
#endif
yuv2planar1_fn yuv2plane1 = c->yuv2plane1; yuv2planar1_fn yuv2plane1 = c->yuv2plane1;
yuv2planarX_fn yuv2planeX = c->yuv2planeX; yuv2planarX_fn yuv2planeX = c->yuv2planeX;
yuv2interleavedX_fn yuv2nv12cX = c->yuv2nv12cX; yuv2interleavedX_fn yuv2nv12cX = c->yuv2nv12cX;
@ -369,9 +379,8 @@ static int swscale(SwsContext *c, const uint8_t *src[],
int chrBufIndex = c->chrBufIndex; int chrBufIndex = c->chrBufIndex;
int lastInLumBuf = c->lastInLumBuf; int lastInLumBuf = c->lastInLumBuf;
int lastInChrBuf = c->lastInChrBuf; int lastInChrBuf = c->lastInChrBuf;
int perform_gamma = c->is_internal_gamma; // int perform_gamma = c->is_internal_gamma;
int numDesc = c->numDesc;
int lumStart = 0; int lumStart = 0;
int lumEnd = c->descIndex[0]; int lumEnd = c->descIndex[0];
int chrStart = lumEnd; int chrStart = lumEnd;
@ -382,10 +391,11 @@ static int swscale(SwsContext *c, const uint8_t *src[],
int hasLumHoles = 1; int hasLumHoles = 1;
int hasChrHoles = 1; int hasChrHoles = 1;
#ifndef NEW_FILTER
if (!usePal(c->srcFormat)) { if (!usePal(c->srcFormat)) {
pal = c->input_rgb2yuv_table; pal = c->input_rgb2yuv_table;
} }
#endif
if (isPacked(c->srcFormat)) { if (isPacked(c->srcFormat)) {
src[0] = src[0] =
@ -450,8 +460,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
} }
lastDstY = dstY; lastDstY = dstY;
#define NEW_FILTER 1
ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW, ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW,
srcSliceY, srcSliceH, srcSliceY, srcSliceH,
chrSrcSliceY, chrSrcSliceH); chrSrcSliceY, chrSrcSliceH);
@ -532,7 +540,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
lastLumSrcY, lastChrSrcY); lastLumSrcY, lastChrSrcY);
} }
#if NEW_FILTER #ifdef NEW_FILTER
posY = dst_slice->plane[0].sliceY + dst_slice->plane[0].sliceH; posY = dst_slice->plane[0].sliceY + dst_slice->plane[0].sliceH;
if (posY <= lastLumSrcY && !hasLumHoles) { if (posY <= lastLumSrcY && !hasLumHoles) {
firstPosY = FFMAX(firstLumSrcY, posY); firstPosY = FFMAX(firstLumSrcY, posY);
@ -645,7 +653,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
} }
{ {
#if NEW_FILTER #ifdef NEW_FILTER
const int16_t **lumSrcPtr = (const int16_t **)(void*) dst_slice->plane[0].line + firstLumSrcY - dst_slice->plane[0].sliceY; const int16_t **lumSrcPtr = (const int16_t **)(void*) dst_slice->plane[0].line + firstLumSrcY - dst_slice->plane[0].sliceY;
const int16_t **chrUSrcPtr = (const int16_t **)(void*) dst_slice->plane[1].line + firstChrSrcY - dst_slice->plane[1].sliceY; const int16_t **chrUSrcPtr = (const int16_t **)(void*) dst_slice->plane[1].line + firstChrSrcY - dst_slice->plane[1].sliceY;
const int16_t **chrVSrcPtr = (const int16_t **)(void*) dst_slice->plane[2].line + firstChrSrcY - dst_slice->plane[2].sliceY; const int16_t **chrVSrcPtr = (const int16_t **)(void*) dst_slice->plane[2].line + firstChrSrcY - dst_slice->plane[2].sliceY;
@ -722,7 +730,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
} }
} }
} else if (yuv2packedX) { } else if (yuv2packedX) {
#if !NEW_FILTER #ifndef NEW_FILTER
av_assert1(lumSrcPtr + vLumFilterSize - 1 < (const int16_t **)lumPixBuf + vLumBufSize * 2); av_assert1(lumSrcPtr + vLumFilterSize - 1 < (const int16_t **)lumPixBuf + vLumBufSize * 2);
av_assert1(chrUSrcPtr + vChrFilterSize - 1 < (const int16_t **)chrUPixBuf + vChrBufSize * 2); av_assert1(chrUSrcPtr + vChrFilterSize - 1 < (const int16_t **)chrUPixBuf + vChrBufSize * 2);
#endif #endif

View File

@ -1036,4 +1036,6 @@ int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst
//number of extra lines to process //number of extra lines to process
#define MAX_LINES_AHEAD 4 #define MAX_LINES_AHEAD 4
#define NEW_FILTER
#endif /* SWSCALE_SWSCALE_INTERNAL_H */ #endif /* SWSCALE_SWSCALE_INTERNAL_H */

View File

@ -85,8 +85,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
{ {
const int dstH= c->dstH; const int dstH= c->dstH;
const int flags= c->flags; const int flags= c->flags;
#define NEW_FILTER 1 #ifdef NEW_FILTER
#if NEW_FILTER
SwsPlane *lumPlane = &c->slice[c->numSlice-1].plane[0]; SwsPlane *lumPlane = &c->slice[c->numSlice-1].plane[0];
SwsPlane *chrUPlane = &c->slice[c->numSlice-1].plane[1]; SwsPlane *chrUPlane = &c->slice[c->numSlice-1].plane[1];
SwsPlane *alpPlane = &c->slice[c->numSlice-1].plane[3]; SwsPlane *alpPlane = &c->slice[c->numSlice-1].plane[3];
@ -94,10 +93,10 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
int16_t **lumPixBuf= c->lumPixBuf; int16_t **lumPixBuf= c->lumPixBuf;
int16_t **chrUPixBuf= c->chrUPixBuf; int16_t **chrUPixBuf= c->chrUPixBuf;
int16_t **alpPixBuf= c->alpPixBuf; int16_t **alpPixBuf= c->alpPixBuf;
#endif
int hasAlpha = c->alpPixBuf != NULL;
const int vLumBufSize= c->vLumBufSize; const int vLumBufSize= c->vLumBufSize;
const int vChrBufSize= c->vChrBufSize; const int vChrBufSize= c->vChrBufSize;
#endif
int hasAlpha = c->alpPixBuf != NULL;
int32_t *vLumFilterPos= c->vLumFilterPos; int32_t *vLumFilterPos= c->vLumFilterPos;
int32_t *vChrFilterPos= c->vChrFilterPos; int32_t *vChrFilterPos= c->vChrFilterPos;
int16_t *vLumFilter= c->vLumFilter; int16_t *vLumFilter= c->vLumFilter;
@ -118,7 +117,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
c->greenDither= ff_dither4[dstY&1]; c->greenDither= ff_dither4[dstY&1];
c->redDither= ff_dither8[(dstY+1)&1]; c->redDither= ff_dither8[(dstY+1)&1];
if (dstY < dstH - 2) { if (dstY < dstH - 2) {
#if NEW_FILTER #ifdef NEW_FILTER
const int16_t **lumSrcPtr = (const int16_t **)(void*) lumPlane->line + firstLumSrcY - lumPlane->sliceY; const int16_t **lumSrcPtr = (const int16_t **)(void*) lumPlane->line + firstLumSrcY - lumPlane->sliceY;
const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPlane->line + firstChrSrcY - chrUPlane->sliceY; const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPlane->line + firstChrSrcY - chrUPlane->sliceY;
const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) ? (const int16_t **)(void*) alpPlane->line + firstLumSrcY - alpPlane->sliceY : NULL; const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) ? (const int16_t **)(void*) alpPlane->line + firstLumSrcY - alpPlane->sliceY : NULL;
@ -129,7 +128,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
#endif #endif
int i; int i;
if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) { if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) {
#if NEW_FILTER #ifdef NEW_FILTER
const int16_t **tmpY = (const int16_t **) lumPlane->tmp; const int16_t **tmpY = (const int16_t **) lumPlane->tmp;
#else #else
const int16_t **tmpY = (const int16_t **) lumPixBuf + 2 * vLumBufSize; const int16_t **tmpY = (const int16_t **) lumPixBuf + 2 * vLumBufSize;
@ -144,7 +143,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
lumSrcPtr = tmpY; lumSrcPtr = tmpY;
if (alpSrcPtr) { if (alpSrcPtr) {
#if NEW_FILTER #ifdef NEW_FILTER
const int16_t **tmpA = (const int16_t **) alpPlane->tmp; const int16_t **tmpA = (const int16_t **) alpPlane->tmp;
#else #else
const int16_t **tmpA = (const int16_t **) alpPixBuf + 2 * vLumBufSize; const int16_t **tmpA = (const int16_t **) alpPixBuf + 2 * vLumBufSize;
@ -159,7 +158,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
} }
} }
if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) { if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) {
#if NEW_FILTER #ifdef NEW_FILTER
const int16_t **tmpU = (const int16_t **) chrUPlane->tmp; const int16_t **tmpU = (const int16_t **) chrUPlane->tmp;
#else #else
const int16_t **tmpU = (const int16_t **) chrUPixBuf + 2 * vChrBufSize; const int16_t **tmpU = (const int16_t **) chrUPixBuf + 2 * vChrBufSize;