|
|
|
@ -705,6 +705,31 @@ static int swscale(SwsContext *c, const uint8_t *src[], |
|
|
|
|
return dstY - lastDstY; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
av_cold void ff_sws_init_range_convert(SwsContext *c) |
|
|
|
|
{ |
|
|
|
|
c->lumConvertRange = NULL; |
|
|
|
|
c->chrConvertRange = NULL; |
|
|
|
|
if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { |
|
|
|
|
if (c->dstBpc <= 14) { |
|
|
|
|
if (c->srcRange) { |
|
|
|
|
c->lumConvertRange = lumRangeFromJpeg_c; |
|
|
|
|
c->chrConvertRange = chrRangeFromJpeg_c; |
|
|
|
|
} else { |
|
|
|
|
c->lumConvertRange = lumRangeToJpeg_c; |
|
|
|
|
c->chrConvertRange = chrRangeToJpeg_c; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (c->srcRange) { |
|
|
|
|
c->lumConvertRange = lumRangeFromJpeg16_c; |
|
|
|
|
c->chrConvertRange = chrRangeFromJpeg16_c; |
|
|
|
|
} else { |
|
|
|
|
c->lumConvertRange = lumRangeToJpeg16_c; |
|
|
|
|
c->chrConvertRange = chrRangeToJpeg16_c; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static av_cold void sws_init_swscale(SwsContext *c) |
|
|
|
|
{ |
|
|
|
|
enum AVPixelFormat srcFormat = c->srcFormat; |
|
|
|
@ -731,27 +756,7 @@ static av_cold void sws_init_swscale(SwsContext *c) |
|
|
|
|
: hScale16To15_c; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
c->lumConvertRange = NULL; |
|
|
|
|
c->chrConvertRange = NULL; |
|
|
|
|
if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { |
|
|
|
|
if (c->dstBpc <= 14) { |
|
|
|
|
if (c->srcRange) { |
|
|
|
|
c->lumConvertRange = lumRangeFromJpeg_c; |
|
|
|
|
c->chrConvertRange = chrRangeFromJpeg_c; |
|
|
|
|
} else { |
|
|
|
|
c->lumConvertRange = lumRangeToJpeg_c; |
|
|
|
|
c->chrConvertRange = chrRangeToJpeg_c; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (c->srcRange) { |
|
|
|
|
c->lumConvertRange = lumRangeFromJpeg16_c; |
|
|
|
|
c->chrConvertRange = chrRangeFromJpeg16_c; |
|
|
|
|
} else { |
|
|
|
|
c->lumConvertRange = lumRangeToJpeg16_c; |
|
|
|
|
c->chrConvertRange = chrRangeToJpeg16_c; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ff_sws_init_range_convert(c); |
|
|
|
|
|
|
|
|
|
if (!(isGray(srcFormat) || isGray(c->dstFormat) || |
|
|
|
|
srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE)) |
|
|
|
|