History

swscale/swscale: remove useless code

Ruiling Song committed 6 years ago

Commit 4700f7d1 parent 9f567c43 files · +3 −21Browse files

Unified · Split

3 files
  1. libswscale/swscale.c +1 −15
  2. libswscale/swscale_internal.h +1 −4
  3. libswscale/x86/swscale.c +1 −2
libswscale/swscale.c+1−15
@@ -266,8 +266,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], · 265 unmodified lines
266266
267267 /* vars which will change and which we need to store back in the context */
268268 int dstY = c->dstY;
269− int lumBufIndex = c->lumBufIndex;
270− int chrBufIndex = c->chrBufIndex;
271269 int lastInLumBuf = c->lastInLumBuf;
272270 int lastInChrBuf = c->lastInChrBuf;
273271
@@ -336,8 +334,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], · 62 unmodified lines
336334 * will not get executed. This is not really intended but works
337335 * currently, so people might do it. */
338336 if (srcSliceY == 0) {
339− lumBufIndex = -1;
340− chrBufIndex = -1;
341337 dstY = 0;
342338 lastInLumBuf = -1;
343339 lastInChrBuf = -1;
@@ -461,7 +457,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], · 117 unmodified lines
461457 desc[i].process(c, &desc[i], firstPosY, lastPosY - firstPosY + 1);
462458 }
463459
464− lumBufIndex += lastLumSrcY - lastInLumBuf;
465460 lastInLumBuf = lastLumSrcY;
466461
467462 if (cPosY < lastChrSrcY + 1) {
@@ -469,20 +464,13 @@ static int swscale(SwsContext *c, const uint8_t *src[], · 1 unmodified line
469464 desc[i].process(c, &desc[i], firstCPosY, lastCPosY - firstCPosY + 1);
470465 }
471466
472− chrBufIndex += lastChrSrcY - lastInChrBuf;
473467 lastInChrBuf = lastChrSrcY;
474468
475− // wrap buf index around to stay inside the ring buffer
476− if (lumBufIndex >= vLumFilterSize)
477− lumBufIndex -= vLumFilterSize;
478− if (chrBufIndex >= vChrFilterSize)
479− chrBufIndex -= vChrFilterSize;
480469 if (!enough_lines)
481470 break; // we can't output a dstY line so let's try with the next slice
482471
483472 #if HAVE_MMX_INLINE
484− ff_updateMMXDitherTables(c, dstY, lumBufIndex, chrBufIndex,
485− lastInLumBuf, lastInChrBuf);
473+ ff_updateMMXDitherTables(c, dstY);
486474 #endif
487475 if (should_dither) {
488476 c->chrDither8 = ff_dither_8x8_128[chrDstY & 7];
@@ -524,8 +512,6 @@ static int swscale(SwsContext *c, const uint8_t *src[], · 35 unmodified lines
524512
525513 /* store changed local vars back in the context */
526514 c->dstY = dstY;
527− c->lumBufIndex = lumBufIndex;
528− c->chrBufIndex = chrBufIndex;
529515 c->lastInLumBuf = lastInLumBuf;
530516 c->lastInChrBuf = lastInChrBuf;
531517
libswscale/swscale_internal.h+1−4
@@ -350,8 +350,6 @@ typedef struct SwsContext { · 349 unmodified lines
350350 //@{
351351 int lastInLumBuf; ///< Last scaled horizontal luma/alpha line from source in the ring buffer.
352352 int lastInChrBuf; ///< Last scaled horizontal chroma line from source in the ring buffer.
353− int lumBufIndex; ///< Index in ring buffer of the last scaled horizontal luma/alpha line from source.
354− int chrBufIndex; ///< Index in ring buffer of the last scaled horizontal chroma line from source.
355353 //@}
356354
357355 uint8_t *formatConvBuffer;
@@ -635,8 +633,7 @@ int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], · 277 unmodified lines
635633 void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4],
636634 int brightness, int contrast, int saturation);
637635
638−void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
639− int lastInLumBuf, int lastInChrBuf);
636+void ff_updateMMXDitherTables(SwsContext *c, int dstY);
640637
641638 av_cold void ff_sws_init_range_convert(SwsContext *c);
642639
libswscale/x86/swscale.c+1−2
@@ -79,8 +79,7 @@ DECLARE_ASM_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; · 78 unmodified lines
7979 #include "swscale_template.c"
8080 #endif
8181
82−void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
83− int lastInLumBuf, int lastInChrBuf)
82+void ff_updateMMXDitherTables(SwsContext *c, int dstY)
8483 {
8584 const int dstH= c->dstH;
8685 const int flags= c->flags;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t