aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3dsp.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2008-10-04 10:26:17 +0000
committerDavid Conrad <lessen42@gmail.com>2008-10-04 10:26:17 +0000
commit9971331dfb6f4ef499b17f156bc0befc98b504b1 (patch)
treec71ba4d03347044dd49b7055dcb2aa7d41c19568 /libavcodec/vp3dsp.c
parent0d696d34ef62725f3b445b370ff2ac374029ea92 (diff)
downloadffmpeg-9971331dfb6f4ef499b17f156bc0befc98b504b1.tar.gz
Move VP3 loop filter to DSPContext
Originally committed as revision 15551 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3dsp.c')
-rw-r--r--libavcodec/vp3dsp.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c
index d374a85f6e..da5b108bdc 100644
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@ -222,3 +222,34 @@ void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*
void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
idct(dest, line_size, block, 2);
}
+
+void ff_vp3_v_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values)
+{
+ unsigned char *end;
+ int filter_value;
+ const int nstride= -stride;
+
+ for (end= first_pixel + 8; first_pixel < end; first_pixel++) {
+ filter_value =
+ (first_pixel[2 * nstride] - first_pixel[ stride])
+ +3*(first_pixel[0 ] - first_pixel[nstride]);
+ filter_value = bounding_values[(filter_value + 4) >> 3];
+ first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value);
+ first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value);
+ }
+}
+
+void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values)
+{
+ unsigned char *end;
+ int filter_value;
+
+ for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
+ filter_value =
+ (first_pixel[-2] - first_pixel[ 1])
+ +3*(first_pixel[ 0] - first_pixel[-1]);
+ filter_value = bounding_values[(filter_value + 4) >> 3];
+ first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value);
+ first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value);
+ }
+}