From e17ccf60fe4ef23424f567bfa7e58199735d43fe Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Sun, 18 Oct 2009 20:47:25 +0000 Subject: [PATCH] huffyuv: add some const qualifiers Originally committed as revision 20290 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dsputil.c | 4 ++-- libavcodec/dsputil.h | 4 ++-- libavcodec/x86/dsputil_mmx.c | 8 ++++---- libavcodec/x86/dsputil_yasm.asm | 4 ++-- libavcodec/x86/dsputilenc_mmx.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 0500872036..a04b8a400a 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -3573,7 +3573,7 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ dst[i+0] = src1[i+0]-src2[i+0]; } -static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, uint8_t *diff, int w, int *left, int *left_top){ +static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *diff, int w, int *left, int *left_top){ int i; uint8_t l, lt; @@ -3590,7 +3590,7 @@ static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, uint *left_top= lt; } -static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ +static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){ int i; uint8_t l, lt; diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index ab791f53cb..c097461c4a 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -347,8 +347,8 @@ typedef struct DSPContext { * subtract huffyuv's variant of median prediction * note, this might read from src1[-1], src2[-1] */ - void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top); - void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, uint8_t *diff, int w, int *left, int *left_top); + void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top); + void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top); int (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src, int w, int left); void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue); /* this might write to dst[w] */ diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 3f6f1dae6b..af33707df0 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -597,7 +597,7 @@ static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ } #if HAVE_7REGS && HAVE_TEN_OPERANDS -static void add_hfyu_median_prediction_cmov(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top) { +static void add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top) { x86_reg w2 = -w; x86_reg x; int l = *left & 0xff; @@ -2384,9 +2384,9 @@ static void float_to_int16_sse2(int16_t *dst, const float *src, long len){ void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len); void ff_float_to_int16_interleave6_3dnow(int16_t *dst, const float **src, int len); void ff_float_to_int16_interleave6_3dn2(int16_t *dst, const float **src, int len); -void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top); -int ff_add_hfyu_left_prediction_ssse3(uint8_t *dst, uint8_t *src, int w, int left); -int ff_add_hfyu_left_prediction_sse4(uint8_t *dst, uint8_t *src, int w, int left); +void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top); +int ff_add_hfyu_left_prediction_ssse3(uint8_t *dst, const uint8_t *src, int w, int left); +int ff_add_hfyu_left_prediction_sse4(uint8_t *dst, const uint8_t *src, int w, int left); void ff_x264_deblock_v_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); void ff_x264_deblock_h_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); void ff_x264_deblock_v8_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta); diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index d071186f5c..c3a23a9cb2 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -99,7 +99,7 @@ FLOAT_TO_INT16_INTERLEAVE6 3dn2 -; void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top) +; void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top) cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_top movq mm0, [topq] movq mm2, mm0 @@ -197,7 +197,7 @@ cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_to RET %endmacro -; int ff_add_hfyu_left_prediction(uint8_t *dst, uint8_t *src, int w, int left) +; int ff_add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src, int w, int left) INIT_MMX cglobal add_hfyu_left_prediction_ssse3, 3,3,7, dst, src, w, left .skip_prologue: diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index a7fafe0605..3ee2c38d00 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -902,7 +902,7 @@ static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ dst[i+0] = src1[i+0]-src2[i+0]; } -static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ +static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){ x86_reg i=0; uint8_t l, lt;