From 5d8e836d0ec3bcaabf5bc2020210a1bc61975922 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 8 Sep 2015 17:10:48 +0200 Subject: Replace all remaining occurances of step/depth_minus1 and offset_plus1 --- libswscale/alphablend.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libswscale/alphablend.c') 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<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<alphablend == SWS_ALPHA_BLEND_CHECKERBOARD) { - a = (1<comp[0].depth_minus1)/2; - b = 3*(1<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<comp[0].depth_minus1 : a; - target_table[1][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<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) { -- cgit v1.2.3