aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-05-30 20:37:15 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-05-30 20:37:15 +0000
commitc6148de2320739d4443fa702f78eac68fc0ab044 (patch)
tree8f67f7c50aca4c412fa0dc3f366f088cc9c96fa7 /libavcodec/dsputil.c
parent20646267cdde0ec0c6d8fb61b7bab29f431fa541 (diff)
downloadffmpeg-c6148de2320739d4443fa702f78eac68fc0ab044.tar.gz
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
Originally committed as revision 3176 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index b1252251ad..63fb32e426 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2360,6 +2360,36 @@ static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
}
}
+static void h261_v_loop_filter_c(uint8_t *dest,uint8_t *src, int stride){
+ int i,j,xy,yz;
+ int res;
+ for(i=0; i<8; i++){
+ for(j=1; j<7; j++){
+ xy = j * stride + i;
+ yz = j * 8 + i;
+ res = (int)src[yz-1*8] + ((int)(src[yz+0*8]) * 2) + (int)src[yz+1*8];
+ res +=2;
+ res >>=2;
+ dest[xy] = (uint8_t)res;
+ }
+ }
+}
+
+static void h261_h_loop_filter_c(uint8_t *dest,uint8_t *src, int stride){
+ int i,j,xy,yz;
+ int res;
+ for(i=1; i<7; i++){
+ for(j=0; j<8; j++){
+ xy = j * stride + i;
+ yz = j * 8 + i;
+ res = (int)src[yz-1] + ((int)(src[yz]) *2) + (int)src[yz+1];
+ res+=2;
+ res>>=2;
+ dest[xy] = (uint8_t)res;
+ }
+ }
+}
+
static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
int s, i;
@@ -3295,6 +3325,9 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->h263_h_loop_filter= h263_h_loop_filter_c;
c->h263_v_loop_filter= h263_v_loop_filter_c;
+ c->h261_h_loop_filter= h261_h_loop_filter_c;
+ c->h261_v_loop_filter= h261_v_loop_filter_c;
+
c->try_8x8basis= try_8x8basis_c;
c->add_8x8basis= add_8x8basis_c;