Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-05 06:24:45 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-06-05 06:24:45 +0400
commitec4207c46ae3f9a1add21dbe3eee124bb2b10eee (patch)
treebe071f3fda8e9adfe862cbc5fe654ced226ba4ef /libswscale
parent46eb300d016b69b5fedb0410df98e3c698090c8c (diff)
swscale: factor should_dither out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index d2b3337dc3..29c26e87ac 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1730,6 +1730,7 @@ static int swScale(SwsContext *c, const uint8_t* src[],
const int chrSrcSliceH= -((-srcSliceH) >> c->chrSrcVSubSample);
int lastDstY;
uint32_t *pal=c->pal_yuv;
+ int should_dither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat);
/* vars which will change and which we need to store back in the context */
int dstY= c->dstY;
@@ -1787,8 +1788,8 @@ static int swScale(SwsContext *c, const uint8_t* src[],
unsigned char *uDest=dst[1]+dstStride[1]*chrDstY;
unsigned char *vDest=dst[2]+dstStride[2]*chrDstY;
unsigned char *aDest=(CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3]+dstStride[3]*dstY : NULL;
- const uint8_t *lumDither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat) ? dithers[7][dstY &7] : flat64;
- const uint8_t *chrDither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat) ? dithers[7][chrDstY&7] : flat64;
+ const uint8_t *lumDither= should_dither ? dithers[7][dstY &7] : flat64;
+ const uint8_t *chrDither= should_dither ? dithers[7][chrDstY&7] : flat64;
const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
const int firstLumSrcY2= vLumFilterPos[FFMIN(dstY | ((1<<c->chrDstVSubSample) - 1), dstH-1)];