Commit d736b52a authored by Michael Niedermayer's avatar Michael Niedermayer

swscale: Drop is9_OR_10BPS() use, its name is not correct

Found-by: Luca Barbato
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 226d35c8
......@@ -2184,7 +2184,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
} else if (is16BPS(dstFormat)) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
} else if (is9_OR_10BPS(dstFormat)) {
} else if (isNBPS(dstFormat)) {
if (desc->comp[0].depth == 9) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
......
......@@ -337,7 +337,7 @@ av_cold void ff_sws_init_swscale_ppc(SwsContext *c)
if (c->srcBpc == 8 && c->dstBpc <= 14) {
c->hyScale = c->hcScale = hScale_altivec_real;
}
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
if (!is16BPS(dstFormat) && !isNBPS(dstFormat) &&
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
!c->needAlpha) {
c->yuv2planeX = yuv2planeX_altivec;
......
......@@ -254,7 +254,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
yuv2anyX_fn yuv2anyX = c->yuv2anyX;
const int chrSrcSliceY = srcSliceY >> c->chrSrcVSubSample;
const int chrSrcSliceH = AV_CEIL_RSHIFT(srcSliceH, c->chrSrcVSubSample);
int should_dither = is9_OR_10BPS(c->srcFormat) ||
int should_dither = isNBPS(c->srcFormat) ||
is16BPS(c->srcFormat);
int lastDstY;
......
......@@ -652,15 +652,13 @@ static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
return desc->comp[0].depth == 16;
}
static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
av_assert0(desc);
return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 14;
}
#define isNBPS(x) is9_OR_10BPS(x)
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
......
......@@ -1499,7 +1499,7 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
enum AVPixelFormat dstFormat = c->dstFormat;
c->use_mmx_vfilter= 0;
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12
if (!is16BPS(dstFormat) && !isNBPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12
&& dstFormat != AV_PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) {
if (c->flags & SWS_ACCURATE_RND) {
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
......
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