From 4a73fbd9c5d5ba6b32a116b296a8cb199f8940ed Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 21 Jan 2013 11:02:33 -0800 Subject: vp3/5: move put_no_rnd_pixels_l2 from dsputil to VP3DSPContext. The function is only used in VP3 and VP5, so no need to have it in DSPContext. --- libavcodec/vp3dsp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libavcodec/vp3dsp.c') diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c index 9e6209dfdd..1883099002 100644 --- a/libavcodec/vp3dsp.c +++ b/libavcodec/vp3dsp.c @@ -274,8 +274,27 @@ static void vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, } } +static void put_no_rnd_pixels_l2(uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, ptrdiff_t stride, int h) +{ + int i; + + for (i = 0; i < h; i++) { + uint32_t a, b; + + a = AV_RN32A(&src1[i * stride]); + b = AV_RN32A(&src2[i * stride]); + AV_WN32A(&dst[i * stride], no_rnd_avg32(a, b)); + a = AV_RN32A(&src1[i * stride + 4]); + b = AV_RN32A(&src2[i * stride + 4]); + AV_WN32A(&dst[i * stride + 4], no_rnd_avg32(a, b)); + } +} + av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags) { + c->put_no_rnd_pixels_l2 = put_no_rnd_pixels_l2; + c->idct_put = vp3_idct_put_c; c->idct_add = vp3_idct_add_c; c->idct_dc_add = vp3_idct_dc_add_c; -- cgit v1.2.3