summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-08 17:10:48 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-08 17:10:48 +0200
commit5d8e836d0ec3bcaabf5bc2020210a1bc61975922 (patch)
tree8ff87745055d571431ded709218556357b18341c /libswscale
parent151aa2ebff514a9d150a2d3a7b92be1dcc46df36 (diff)
downloadffmpeg-5d8e836d0ec3bcaabf5bc2020210a1bc61975922.tar.gz
Replace all remaining occurances of step/depth_minus1 and offset_plus1
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/alphablend.c16
-rw-r--r--libswscale/output.c6
-rw-r--r--libswscale/swscale.c4
-rw-r--r--libswscale/swscale_unscaled.c4
-rw-r--r--libswscale/utils.c2
-rw-r--r--libswscale/x86/swscale.c2
6 files changed, 17 insertions, 17 deletions
diff --git a/libswscale/alphablend.c b/libswscale/alphablend.c
index b9b809b702..1f63493bdc 100644
--- a/libswscale/alphablend.c
+++ b/libswscale/alphablend.c
@@ -28,20 +28,20 @@ int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
int nb_components = desc->nb_components;
int plane, x, y;
int plane_count = isGray(c->srcFormat) ? 1 : 3;
- int sixteen_bits = desc->comp[0].depth_minus1 >= 8;
- unsigned off = 1<<desc->comp[0].depth_minus1;
- unsigned shift = desc->comp[0].depth_minus1 + 1;
+ int sixteen_bits = desc->comp[0].depth >= 9;
+ unsigned off = 1<<(desc->comp[0].depth - 1);
+ unsigned shift = desc->comp[0].depth;
unsigned max = (1<<shift) - 1;
int target_table[2][3];
for (plane = 0; plane < plane_count; plane++) {
int a = 0, b = 0;
if (c->alphablend == SWS_ALPHA_BLEND_CHECKERBOARD) {
- a = (1<<desc->comp[0].depth_minus1)/2;
- b = 3*(1<<desc->comp[0].depth_minus1)/2;
+ a = (1<<(desc->comp[0].depth - 1))/2;
+ b = 3*(1<<(desc->comp[0].depth-1))/2;
}
- target_table[0][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<desc->comp[0].depth_minus1 : a;
- target_table[1][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<desc->comp[0].depth_minus1 : b;
+ target_table[0][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<(desc->comp[0].depth - 1) : a;
+ target_table[1][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<(desc->comp[0].depth - 1) : b;
}
av_assert0(plane_count == nb_components - 1);
@@ -125,7 +125,7 @@ int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
}
}
} else {
- int alpha_pos = desc->comp[plane_count].offset_plus1 - 1;
+ int alpha_pos = desc->comp[plane_count].offset;
int w = c->srcW;
for (y = srcSliceY; y < srcSliceH; y++) {
if (sixteen_bits) {
diff --git a/libswscale/output.c b/libswscale/output.c
index 16cfd75c5a..3188baadf9 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2076,13 +2076,13 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
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) {
+ } else if (desc->comp[0].depth == 10) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_10LE_c;
- } else if (desc->comp[0].depth_minus1 == 11) {
+ } else if (desc->comp[0].depth == 12) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_12BE_c : yuv2planeX_12LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_12BE_c : yuv2plane1_12LE_c;
- } else if (desc->comp[0].depth_minus1 == 13) {
+ } else if (desc->comp[0].depth == 14) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_14BE_c : yuv2planeX_14LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_14BE_c : yuv2plane1_14LE_c;
} else
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index b7d3d6a3a2..8d71abbbbc 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -90,7 +90,7 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
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)
+ if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16)
sh= 9;
for (i = 0; i < dstW; i++) {
@@ -116,7 +116,7 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW,
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;
+ sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
for (i = 0; i < dstW; i++) {
int j;
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 8f57b2a3d2..f387f52df4 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -554,7 +554,7 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],
int stride1023[] = { dstStride[1], dstStride[0], dstStride[2], dstStride[3] };
const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
- int bpc = dst_format->comp[0].depth_minus1 + 1;
+ int bpc = dst_format->comp[0].depth;
int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;
int swap = 0;
if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
@@ -725,7 +725,7 @@ static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[],
int stride201[] = { srcStride[2], srcStride[0], srcStride[1], srcStride[3] };
const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
- int bits_per_sample = src_format->comp[0].depth_minus1 + 1;
+ int bits_per_sample = src_format->comp[0].depth;
int swap = 0;
if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
!HAVE_BIGENDIAN && src_format->flags & AV_PIX_FMT_FLAG_BE)
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b2ce49601b..354ec055f2 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1691,7 +1691,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
// try to avoid drawing green stuff between the right end and the stride end
for (i = 0; i < c->vChrBufSize; i++)
- if(desc_dst->comp[0].depth_minus1 == 15){
+ if(desc_dst->comp[0].depth == 16){
av_assert0(c->dstBpc > 14);
for(j=0; j<dst_stride/2+1; j++)
((int32_t*)(c->chrUPixBuf[i]))[j] = 1<<18;
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index fe5690d4a3..66ac7d5e56 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -434,7 +434,7 @@ av_cold void ff_sws_init_swscale_x86(SwsContext *c)
} else if (c->srcBpc == 12) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
ff_hscale12to19_ ## filtersize ## _ ## opt1; \
- } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth_minus1<15)) { \
+ } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth<16)) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
ff_hscale14to19_ ## filtersize ## _ ## opt1; \
} else { /* c->srcBpc == 16 */ \