diff options
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/output.c | 4 | ||||
-rw-r--r-- | libswscale/swscale.c | 6 | ||||
-rw-r--r-- | libswscale/swscale_internal.h | 6 | ||||
-rw-r--r-- | libswscale/swscale_unscaled.c | 10 | ||||
-rw-r--r-- | libswscale/utils.c | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index 31e10237d8..16cfd75c5a 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1845,7 +1845,7 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter, int i; int hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) && alpSrc; uint16_t **dest16 = (uint16_t**)dest; - int SH = 22 + 7 - desc->comp[0].depth_minus1; + int SH = 22 + 8 - desc->comp[0].depth; int A = 0; // init to silence warning for (i = 0; i < dstW; i++) { @@ -2073,7 +2073,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c; *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c; } else if (is9_OR_10BPS(dstFormat)) { - if (desc->comp[0].depth_minus1 == 8) { + if (desc->comp[0].depth == 9) { *yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c; *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c; } else if (desc->comp[0].depth_minus1 == 9) { diff --git a/libswscale/swscale.c b/libswscale/swscale.c index e9e4f622f5..b7d3d6a3a2 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -87,7 +87,7 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, int i; int32_t *dst = (int32_t *) _dst; const uint16_t *src = (const uint16_t *) _src; - int bits = desc->comp[0].depth_minus1; + int bits = desc->comp[0].depth - 1; int sh = bits - 4; if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth_minus1<15) @@ -113,7 +113,7 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW, const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); int i; const uint16_t *src = (const uint16_t *) _src; - int sh = desc->comp[0].depth_minus1; + int sh = desc->comp[0].depth - 1; if(sh<15) sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : desc->comp[0].depth_minus1; @@ -796,7 +796,7 @@ static int swscale(SwsContext *c, const uint8_t *src[], if (is16BPS(dstFormat) || isNBPS(dstFormat)) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat); fillPlane16(dst[3], dstStride[3], length, height, lastDstY, - 1, desc->comp[3].depth_minus1, + 1, desc->comp[3].depth, isBE(dstFormat)); } else fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 608cc3e6e9..9676d463d1 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -651,14 +651,14 @@ static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); av_assert0(desc); - return desc->comp[0].depth_minus1 == 15; + return desc->comp[0].depth == 16; } static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); av_assert0(desc); - return desc->comp[0].depth_minus1 >= 8 && desc->comp[0].depth_minus1 <= 13; + return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 14; } #define isNBPS(x) is9_OR_10BPS(x) @@ -928,7 +928,7 @@ static inline void fillPlane16(uint8_t *plane, int stride, int width, int height { int i, j; uint8_t *ptr = plane + stride * y; - int v = alpha ? 0xFFFF>>(15-bits) : (1<<bits); + int v = alpha ? 0xFFFF>>(16-bits) : (1<<(bits-1)); for (i = 0; i < height; i++) { #define FILL(wfunc) \ for (j = 0; j < width; j++) {\ diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 18baaead35..8f57b2a3d2 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1417,7 +1417,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], if (!src[plane] || (plane == 1 && !src[2])) { if (is16BPS(c->dstFormat) || isNBPS(c->dstFormat)) { fillPlane16(dst[plane], dstStride[plane], length, height, y, - plane == 3, desc_dst->comp[plane].depth_minus1, + plane == 3, desc_dst->comp[plane].depth, isBE(c->dstFormat)); } else { fillPlane(dst[plane], dstStride[plane], length, height, y, @@ -1427,8 +1427,8 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], if(isNBPS(c->srcFormat) || isNBPS(c->dstFormat) || (is16BPS(c->srcFormat) != is16BPS(c->dstFormat)) ) { - const int src_depth = desc_src->comp[plane].depth_minus1 + 1; - const int dst_depth = desc_dst->comp[plane].depth_minus1 + 1; + 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; uint16_t *dstPtr2 = (uint16_t*)dstPtr; @@ -1543,7 +1543,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], } else { if (is16BPS(c->srcFormat) && is16BPS(c->dstFormat)) length *= 2; - else if (!desc_src->comp[0].depth_minus1) + else if (desc_src->comp[0].depth == 1) length >>= 3; // monowhite/black for (i = 0; i < height; i++) { memcpy(dstPtr, srcPtr, length); @@ -1648,7 +1648,7 @@ void ff_get_unscaled_swscale(SwsContext *c) dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE)) c->swscale = planarRgb16ToRgb16Wrapper; - if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 && + if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth == 8 && isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP) c->swscale = rgbToPlanarRgbWrapper; diff --git a/libswscale/utils.c b/libswscale/utils.c index 0c4b4d7977..b2ce49601b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1335,10 +1335,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, FF_ALLOCZ_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail); - c->srcBpc = 1 + desc_src->comp[0].depth_minus1; + c->srcBpc = desc_src->comp[0].depth; if (c->srcBpc < 8) c->srcBpc = 8; - c->dstBpc = 1 + desc_dst->comp[0].depth_minus1; + c->dstBpc = desc_dst->comp[0].depth; if (c->dstBpc < 8) c->dstBpc = 8; if (isAnyRGB(srcFormat) || srcFormat == AV_PIX_FMT_PAL8) |