From 2b5b1e1e9b89063d352e2efed014f9d761b85032 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 27 Sep 2016 18:13:37 +0200 Subject: [PATCH] swscale: Rename is9_OR_10 to match what it does It is used to select functions that work with 9-15bits. --- libswscale/output.c | 2 +- libswscale/ppc/swscale_altivec.c | 2 +- libswscale/swscale.c | 4 ++-- libswscale/swscale_internal.h | 2 +- libswscale/swscale_unscaled.c | 8 ++++---- libswscale/x86/swscale_template.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index 93b3db65eb..6a51bb9bdf 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1364,7 +1364,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, 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 (is9_15BPS(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; diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index 004b385af2..9e3ddf359d 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -298,7 +298,7 @@ av_cold void ff_sws_init_swscale_ppc(SwsContext *c) if (c->srcBpc == 8 && c->dstBpc <= 10) { c->hyScale = c->hcScale = hScale_altivec_real; } - if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && + if (!is16BPS(dstFormat) && !is9_15BPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 && !c->alpPixBuf) { c->yuv2planeX = yuv2planeX_altivec; diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 142c79c14a..987a3bb820 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -386,7 +386,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 = is9_15BPS(c->srcFormat) || is16BPS(c->srcFormat); int lastDstY; @@ -696,7 +696,7 @@ static int swscale(SwsContext *c, const uint8_t *src[], if (is16BPS(c->dstFormat)) length *= 2; - if (is9_OR_10BPS(dstFormat)) { + if (is9_15BPS(dstFormat)) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat); fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY, 255, desc->comp[3].depth, isBE(dstFormat)); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 625bd864a4..abcdb9f41b 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -565,7 +565,7 @@ 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 is9_15BPS(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); av_assert0(desc); diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 0e6be515ea..fbdc2affe1 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -813,7 +813,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], int val = (plane == 3) ? 255 : 128; if (is16BPS(c->dstFormat)) length *= 2; - if (is9_OR_10BPS(c->dstFormat)) { + if (is9_15BPS(c->dstFormat)) { fill_plane9or10(dst[plane], dstStride[plane], length, height, y, val, desc_dst->comp[plane].depth, @@ -822,7 +822,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], fillPlane(dst[plane], dstStride[plane], length, height, y, val); } else { - if (is9_OR_10BPS(c->srcFormat)) { + if (is9_15BPS(c->srcFormat)) { const int src_depth = desc_src->comp[plane].depth; const int dst_depth = desc_dst->comp[plane].depth; const uint16_t *srcPtr2 = (const uint16_t *) srcPtr; @@ -862,7 +862,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], COPY9_OR_10TO16(AV_RL16, AV_WL16); } } - } else if (is9_OR_10BPS(c->dstFormat)) { + } else if (is9_15BPS(c->dstFormat)) { uint16_t *dstPtr2 = (uint16_t *) dstPtr; #define COPY9_OR_10TO9_OR_10(loop) \ for (i = 0; i < height; i++) { \ @@ -914,7 +914,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], COPY9_OR_10TO8(AV_RL16); } } - } else if (is9_OR_10BPS(c->dstFormat)) { + } else if (is9_15BPS(c->dstFormat)) { const int dst_depth = desc_dst->comp[plane].depth; uint16_t *dstPtr2 = (uint16_t *) dstPtr; diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index 3fb8bc8882..e0d1abe207 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -1564,7 +1564,7 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c) { enum AVPixelFormat dstFormat = c->dstFormat; - if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && + if (!is16BPS(dstFormat) && !is9_15BPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21) { if (!(c->flags & SWS_BITEXACT)) { if (c->flags & SWS_ACCURATE_RND) {