Mercurial > libavcodec.hg
comparison vp3dsp.c @ 7995:1fbfce20cb79 libavcodec
Move VP3 loop filter to DSPContext
author | conrad |
---|---|
date | Sat, 04 Oct 2008 10:26:17 +0000 |
parents | 25914f8a9bb3 |
children | e9d9d946f213 |
comparison
equal
deleted
inserted
replaced
7994:ecade9a77827 | 7995:1fbfce20cb79 |
---|---|
220 } | 220 } |
221 | 221 |
222 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ | 222 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ |
223 idct(dest, line_size, block, 2); | 223 idct(dest, line_size, block, 2); |
224 } | 224 } |
225 | |
226 void ff_vp3_v_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values) | |
227 { | |
228 unsigned char *end; | |
229 int filter_value; | |
230 const int nstride= -stride; | |
231 | |
232 for (end= first_pixel + 8; first_pixel < end; first_pixel++) { | |
233 filter_value = | |
234 (first_pixel[2 * nstride] - first_pixel[ stride]) | |
235 +3*(first_pixel[0 ] - first_pixel[nstride]); | |
236 filter_value = bounding_values[(filter_value + 4) >> 3]; | |
237 first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value); | |
238 first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value); | |
239 } | |
240 } | |
241 | |
242 void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values) | |
243 { | |
244 unsigned char *end; | |
245 int filter_value; | |
246 | |
247 for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) { | |
248 filter_value = | |
249 (first_pixel[-2] - first_pixel[ 1]) | |
250 +3*(first_pixel[ 0] - first_pixel[-1]); | |
251 filter_value = bounding_values[(filter_value + 4) >> 3]; | |
252 first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value); | |
253 first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value); | |
254 } | |
255 } |