diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-08-14 19:05:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-08-14 19:34:48 +0200 |
commit | 66bb5cd5927ad2c198c68eb73bf60e7255185ca1 (patch) | |
tree | 86354ab138611b955697b32dae9fa0b5246be9d1 | |
parent | 3652409f5b45195a5907f1f5b860f87b1b64bed4 (diff) | |
download | ffmpeg-66bb5cd5927ad2c198c68eb73bf60e7255185ca1.tar.gz |
sws: remove hScale16N() and use ronalds reformated version of it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswscale/swscale.c | 23 | ||||
-rw-r--r-- | libswscale/utils.c | 2 |
2 files changed, 5 insertions, 20 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 4148980c31..fc37cba309 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2057,6 +2057,9 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW, const uint8_t const uint16_t *src = (const uint16_t *) _src; int sh = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; + if(sh<15) + sh= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; + for (i = 0; i < dstW; i++) { int j; int srcPos = filterPos[i]; @@ -2089,21 +2092,6 @@ static void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW, const uint8_t * } } -static inline void hScale16N_c(int16_t *dst, int dstW, const uint16_t *src, int srcW, int xInc, - const int16_t *filter, const int16_t *filterPos, long filterSize, int shift) -{ - int i, j; - - for (i=0; i<dstW; i++) { - int srcPos= filterPos[i]; - int val=0; - for (j=0; j<filterSize; j++) { - val += ((int)src[srcPos + j])*filter[filterSize*i + j]; - } - dst[i] = FFMIN(val>>shift, (1<<15)-1); // the cubic equation does overflow ... - } -} - static inline void hScale16NX_c(int16_t *dst, int dstW, const uint16_t *src, int srcW, int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize, int shift) { @@ -2945,9 +2933,6 @@ static av_cold void sws_init_swScale_c(SwsContext *c) if (c->srcBpc == 8) { if (c->dstBpc <= 10) { - if((isAnyRGB(c->srcFormat) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15) - || c->srcFormat == PIX_FMT_PAL8) - c->hScale16= hScale16N_c; c->hScale = hScale8To15_c; if (c->flags & SWS_FAST_BILINEAR) { c->hyscale_fast = hyscale_fast_c; @@ -2955,7 +2940,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c) } } else { c->hScale = hScale8To19_c; - av_assert0(c->hScale16 != hScale16N_c && c->hScale16 != hScale16NX_c); + av_assert0(c->hScale16 != hScale16NX_c); } } else { if(c->dstBpc > 10){ diff --git a/libswscale/utils.c b/libswscale/utils.c index 54a4c0d42f..c112fa3264 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -848,7 +848,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) c->dstBpc = 1 + av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1; if (c->dstBpc < 8) c->dstBpc = 8; - if (isAnyRGB(srcFormat) && c->dstBpc == 16) + if (isAnyRGB(srcFormat) || srcFormat == PIX_FMT_PAL8) c->srcBpc = 16; if (c->dstBpc == 16) dst_stride <<= 1; |