diff options
Diffstat (limited to 'libavcodec/huffyuvdsp.c')
-rw-r--r-- | libavcodec/huffyuvdsp.c | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/libavcodec/huffyuvdsp.c b/libavcodec/huffyuvdsp.c index b5a714d072..e8a05f6592 100644 --- a/libavcodec/huffyuvdsp.c +++ b/libavcodec/huffyuvdsp.c @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -27,7 +27,7 @@ #define pb_7f (~0UL / 255 * 0x7f) #define pb_80 (~0UL / 255 * 0x80) -static void add_bytes_c(uint8_t *dst, uint8_t *src, int w) +static void add_bytes_c(uint8_t *dst, uint8_t *src, intptr_t w) { long i; @@ -41,7 +41,7 @@ static void add_bytes_c(uint8_t *dst, uint8_t *src, int w) } static void add_hfyu_median_pred_c(uint8_t *dst, const uint8_t *src1, - const uint8_t *diff, int w, + const uint8_t *diff, intptr_t w, int *left, int *left_top) { int i; @@ -60,7 +60,7 @@ static void add_hfyu_median_pred_c(uint8_t *dst, const uint8_t *src1, *left_top = lt; } -static int add_hfyu_left_pred_c(uint8_t *dst, const uint8_t *src, int w, +static int add_hfyu_left_pred_c(uint8_t *dst, const uint8_t *src, intptr_t w, int acc) { int i; @@ -81,22 +81,11 @@ static int add_hfyu_left_pred_c(uint8_t *dst, const uint8_t *src, int w, return acc; } -#if HAVE_BIGENDIAN -#define B 3 -#define G 2 -#define R 1 -#define A 0 -#else -#define B 0 -#define G 1 -#define R 2 -#define A 3 -#endif static void add_hfyu_left_pred_bgr32_c(uint8_t *dst, const uint8_t *src, - int w, int *red, int *green, - int *blue, int *alpha) + intptr_t w, uint8_t *left) { - int i, r = *red, g = *green, b = *blue, a = *alpha; + int i; + uint8_t r = left[R], g = left[G], b = left[B], a = left[A]; for (i = 0; i < w; i++) { b += src[4 * i + B]; @@ -110,15 +99,11 @@ static void add_hfyu_left_pred_bgr32_c(uint8_t *dst, const uint8_t *src, dst[4 * i + A] = a; } - *red = r; - *green = g; - *blue = b; - *alpha = a; + left[B] = b; + left[G] = g; + left[R] = r; + left[A] = a; } -#undef B -#undef G -#undef R -#undef A av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c) { |