summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-08 15:43:03 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-08 16:35:28 +0200
commit151aa2ebff514a9d150a2d3a7b92be1dcc46df36 (patch)
tree866bd99edecd778aee4cd8eb5f34977d0c82a27d /libswscale
parentf53569a93f853057d4852601b547a1d9c57613b6 (diff)
parent2268db2cd052674fde55c7d48b7a5098ce89b4ba (diff)
downloadffmpeg-streaming-151aa2ebff514a9d150a2d3a7b92be1dcc46df36.zip
ffmpeg-streaming-151aa2ebff514a9d150a2d3a7b92be1dcc46df36.tar.gz
Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba': lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/output.c4
-rw-r--r--libswscale/swscale.c6
-rw-r--r--libswscale/swscale_internal.h6
-rw-r--r--libswscale/swscale_unscaled.c10
-rw-r--r--libswscale/utils.c4
5 files changed, 15 insertions, 15 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 31e1023..16cfd75 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 e9e4f62..b7d3d6a 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 608cc3e..9676d46 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 18baaea..8f57b2a 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 0c4b4d7..b2ce496 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)
OpenPOWER on IntegriCloud