Commit 4700f7d6 authored by Ruiling Song's avatar Ruiling Song Committed by Michael Niedermayer

swscale/swscale: remove useless code

Signed-off-by: 's avatarRuiling Song <ruiling.song@intel.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9f567c43
...@@ -266,8 +266,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], ...@@ -266,8 +266,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
/* vars which will change and which we need to store back in the context */ /* vars which will change and which we need to store back in the context */
int dstY = c->dstY; int dstY = c->dstY;
int lumBufIndex = c->lumBufIndex;
int chrBufIndex = c->chrBufIndex;
int lastInLumBuf = c->lastInLumBuf; int lastInLumBuf = c->lastInLumBuf;
int lastInChrBuf = c->lastInChrBuf; int lastInChrBuf = c->lastInChrBuf;
...@@ -336,8 +334,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], ...@@ -336,8 +334,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
* will not get executed. This is not really intended but works * will not get executed. This is not really intended but works
* currently, so people might do it. */ * currently, so people might do it. */
if (srcSliceY == 0) { if (srcSliceY == 0) {
lumBufIndex = -1;
chrBufIndex = -1;
dstY = 0; dstY = 0;
lastInLumBuf = -1; lastInLumBuf = -1;
lastInChrBuf = -1; lastInChrBuf = -1;
...@@ -461,7 +457,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], ...@@ -461,7 +457,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
desc[i].process(c, &desc[i], firstPosY, lastPosY - firstPosY + 1); desc[i].process(c, &desc[i], firstPosY, lastPosY - firstPosY + 1);
} }
lumBufIndex += lastLumSrcY - lastInLumBuf;
lastInLumBuf = lastLumSrcY; lastInLumBuf = lastLumSrcY;
if (cPosY < lastChrSrcY + 1) { if (cPosY < lastChrSrcY + 1) {
...@@ -469,20 +464,13 @@ static int swscale(SwsContext *c, const uint8_t *src[], ...@@ -469,20 +464,13 @@ static int swscale(SwsContext *c, const uint8_t *src[],
desc[i].process(c, &desc[i], firstCPosY, lastCPosY - firstCPosY + 1); desc[i].process(c, &desc[i], firstCPosY, lastCPosY - firstCPosY + 1);
} }
chrBufIndex += lastChrSrcY - lastInChrBuf;
lastInChrBuf = lastChrSrcY; lastInChrBuf = lastChrSrcY;
// wrap buf index around to stay inside the ring buffer
if (lumBufIndex >= vLumFilterSize)
lumBufIndex -= vLumFilterSize;
if (chrBufIndex >= vChrFilterSize)
chrBufIndex -= vChrFilterSize;
if (!enough_lines) if (!enough_lines)
break; // we can't output a dstY line so let's try with the next slice break; // we can't output a dstY line so let's try with the next slice
#if HAVE_MMX_INLINE #if HAVE_MMX_INLINE
ff_updateMMXDitherTables(c, dstY, lumBufIndex, chrBufIndex, ff_updateMMXDitherTables(c, dstY);
lastInLumBuf, lastInChrBuf);
#endif #endif
if (should_dither) { if (should_dither) {
c->chrDither8 = ff_dither_8x8_128[chrDstY & 7]; c->chrDither8 = ff_dither_8x8_128[chrDstY & 7];
...@@ -524,8 +512,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], ...@@ -524,8 +512,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
/* store changed local vars back in the context */ /* store changed local vars back in the context */
c->dstY = dstY; c->dstY = dstY;
c->lumBufIndex = lumBufIndex;
c->chrBufIndex = chrBufIndex;
c->lastInLumBuf = lastInLumBuf; c->lastInLumBuf = lastInLumBuf;
c->lastInChrBuf = lastInChrBuf; c->lastInChrBuf = lastInChrBuf;
......
...@@ -350,8 +350,6 @@ typedef struct SwsContext { ...@@ -350,8 +350,6 @@ typedef struct SwsContext {
//@{ //@{
int lastInLumBuf; ///< Last scaled horizontal luma/alpha line from source in the ring buffer. int lastInLumBuf; ///< Last scaled horizontal luma/alpha line from source in the ring buffer.
int lastInChrBuf; ///< Last scaled horizontal chroma line from source in the ring buffer. int lastInChrBuf; ///< Last scaled horizontal chroma line from source in the ring buffer.
int lumBufIndex; ///< Index in ring buffer of the last scaled horizontal luma/alpha line from source.
int chrBufIndex; ///< Index in ring buffer of the last scaled horizontal chroma line from source.
//@} //@}
uint8_t *formatConvBuffer; uint8_t *formatConvBuffer;
...@@ -635,8 +633,7 @@ int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], ...@@ -635,8 +633,7 @@ int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4], void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4],
int brightness, int contrast, int saturation); int brightness, int contrast, int saturation);
void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex, void ff_updateMMXDitherTables(SwsContext *c, int dstY);
int lastInLumBuf, int lastInChrBuf);
av_cold void ff_sws_init_range_convert(SwsContext *c); av_cold void ff_sws_init_range_convert(SwsContext *c);
......
...@@ -79,8 +79,7 @@ DECLARE_ASM_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; ...@@ -79,8 +79,7 @@ DECLARE_ASM_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
#include "swscale_template.c" #include "swscale_template.c"
#endif #endif
void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex, void ff_updateMMXDitherTables(SwsContext *c, int dstY)
int lastInLumBuf, int lastInChrBuf)
{ {
const int dstH= c->dstH; const int dstH= c->dstH;
const int flags= c->flags; const int flags= c->flags;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment