aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-01-12 21:37:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-01-12 21:37:57 +0000
commitc8a596d21045851ddbdc29d0d27397ab0a19674c (patch)
tree2dbf2e995d54633dab8bf9bcf29a2c7ebc30e02e
parent517840c65434b42fb8784ad1ce4a0301d5d6c36d (diff)
downloadffmpeg-c8a596d21045851ddbdc29d0d27397ab0a19674c.tar.gz
bugs found by valgrind
Originally committed as revision 4841 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/snow.c21
-rw-r--r--tests/ffmpeg.regression.ref6
-rw-r--r--tests/rotozoom.regression.ref6
3 files changed, 17 insertions, 16 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c73477a1d1..4b032a9741 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -3116,13 +3116,14 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con
BlockNode *top = y ? &s->block[index-b_stride] : &null_block;
BlockNode *tl = y && x ? &s->block[index-b_stride-1] : left;
BlockNode *tr = y && x+1<b_stride ? &s->block[index-b_stride+1] : tl;
- int dmx= b->mx - mid_pred(left->mx, top->mx, tr->mx);
- int dmy= b->my - mid_pred(left->my, top->my, tr->my);
+ int dmx, dmy;
// int mx_context= av_log2(2*ABS(left->mx - top->mx));
// int my_context= av_log2(2*ABS(left->my - top->my));
if(x<0 || x>=b_stride || y>=b_height)
continue;
+ dmx= b->mx - mid_pred(left->mx, top->mx, tr->mx);
+ dmy= b->my - mid_pred(left->my, top->my, tr->my);
/*
1 0 0
01X 1-2 1
@@ -3206,14 +3207,14 @@ static void iterative_me(SnowContext *s){
BlockNode backup;
const int index= mb_x + mb_y * b_stride;
BlockNode *block= &s->block[index];
- BlockNode *tb = mb_y ? &s->block[index-b_stride ] : &null_block;
- BlockNode *lb = mb_x ? &s->block[index -1] : &null_block;
- BlockNode *rb = mb_x<b_width ? &s->block[index +1] : &null_block;
- BlockNode *bb = mb_y<b_height ? &s->block[index+b_stride ] : &null_block;
- BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : &null_block;
- BlockNode *trb= mb_x<b_width && mb_y ? &s->block[index-b_stride+1] : &null_block;
- BlockNode *blb= mb_x && mb_y<b_height ? &s->block[index+b_stride-1] : &null_block;
- BlockNode *brb= mb_x<b_width && mb_y<b_height ? &s->block[index+b_stride+1] : &null_block;
+ BlockNode *tb = mb_y ? &s->block[index-b_stride ] : &null_block;
+ BlockNode *lb = mb_x ? &s->block[index -1] : &null_block;
+ BlockNode *rb = mb_x+1<b_width ? &s->block[index +1] : &null_block;
+ BlockNode *bb = mb_y+1<b_height ? &s->block[index+b_stride ] : &null_block;
+ BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : &null_block;
+ BlockNode *trb= mb_x+1<b_width && mb_y ? &s->block[index-b_stride+1] : &null_block;
+ BlockNode *blb= mb_x && mb_y+1<b_height ? &s->block[index+b_stride-1] : &null_block;
+ BlockNode *brb= mb_x+1<b_width && mb_y+1<b_height ? &s->block[index+b_stride+1] : &null_block;
const int b_w= (MB_SIZE >> s->block_max_depth);
uint8_t obmc_edged[b_w*2][b_w*2];
diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref
index c266c4a748..7f0cb2f7a4 100644
--- a/tests/ffmpeg.regression.ref
+++ b/tests/ffmpeg.regression.ref
@@ -119,9 +119,9 @@ a7ef4746f27be309138c188e327d3ebe *./data/a-ffv1.avi
2653642 ./data/a-ffv1.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
-14fa515bf25a47fc2ad3d18b726e8e31 *./data/a-snow.avi
-1197138 ./data/a-snow.avi
-e7c746171b092266b0cf55bb5de2a40a *./data/out.yuv
+97c7066617d9e6c86a43a2736b3e9f16 *./data/a-snow.avi
+1190760 ./data/a-snow.avi
+7e4d9c61252ff22b1a0d4e892cc1d957 *./data/out.yuv
stddev: 2.89 PSNR:38.87 bytes:7602176
11fd61ee7e67ef7a7b2a3df973691305 *./data/a-snow53.avi
3533710 ./data/a-snow53.avi
diff --git a/tests/rotozoom.regression.ref b/tests/rotozoom.regression.ref
index 663758591a..ca0151bd77 100644
--- a/tests/rotozoom.regression.ref
+++ b/tests/rotozoom.regression.ref
@@ -119,9 +119,9 @@ d0831a8339491fd680b650f05262e5d9 *./data/a-ffv1.avi
3524768 ./data/a-ffv1.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
-b926518ac399c7af0f218a7115315b4f *./data/a-snow.avi
-286800 ./data/a-snow.avi
-6c59db71d950610f854d05e2cef18609 *./data/out.yuv
+7345af7da71320bf87d3c950252b4341 *./data/a-snow.avi
+286798 ./data/a-snow.avi
+cc5ef1eda02091fbf9a85887bad47bc4 *./data/out.yuv
stddev: 2.32 PSNR:40.80 bytes:7602176
3f20642bb789dfb75ae3e8c03f9b425c *./data/a-snow53.avi
2725570 ./data/a-snow53.avi