Commit 48d1b9a1 authored by Loren Merritt's avatar Loren Merritt

fix convergence of snow iterative_me

Originally committed as revision 4876 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 3de79d0d
......@@ -3145,6 +3145,8 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con
*/
rate += get_block_bits(s, mb_x + (i&1) - (i>>1), mb_y + (i>>1), 1);
}
if(mb_x == b_stride-2)
rate += get_block_bits(s, mb_x + 1, mb_y + 1, 1);
}
return distortion + rate*penalty_factor;
}
......@@ -3389,7 +3391,12 @@ static void iterative_me(SnowContext *s){
color[i]= get_dc(s, mb_x, mb_y, i);
// get previous score (cant be cached due to OBMC)
check_block_inter(s, mb_x, mb_y, block->mx, block->my, 0, *obmc_edged, &best_rd);
if(pass > 0 && (block->type&BLOCK_INTRA)){
int color0[3]= {block->color[0], block->color[1], block->color[2]};
check_block(s, mb_x, mb_y, color0, 1, *obmc_edged, &best_rd);
}else
check_block_inter(s, mb_x, mb_y, block->mx, block->my, 0, *obmc_edged, &best_rd);
check_block_inter(s, mb_x, mb_y, 0, 0, 0, *obmc_edged, &best_rd);
check_block_inter(s, mb_x, mb_y, tb->mx, tb->my, 0, *obmc_edged, &best_rd);
check_block_inter(s, mb_x, mb_y, lb->mx, lb->my, 0, *obmc_edged, &best_rd);
......
......@@ -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
b7e88c743458e60d59d83554d1e1ace5 *./data/a-snow.avi
1191118 ./data/a-snow.avi
2e0cda9acd71d339d72372a22591500a *./data/out.yuv
9d31a15d72fa93361ebad395033b66c2 *./data/a-snow.avi
1198972 ./data/a-snow.avi
1a4a23e8171798328db571cce2654df4 *./data/out.yuv
stddev: 2.90 PSNR:38.87 bytes:7602176
11fd61ee7e67ef7a7b2a3df973691305 *./data/a-snow53.avi
3533710 ./data/a-snow53.avi
......
......@@ -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
7345af7da71320bf87d3c950252b4341 *./data/a-snow.avi
286798 ./data/a-snow.avi
cc5ef1eda02091fbf9a85887bad47bc4 *./data/out.yuv
1f3c76fe9ea602f5a70e8fa25a1bafcb *./data/a-snow.avi
286446 ./data/a-snow.avi
ca9feebced78b9193b8fea6bd4a4ca90 *./data/out.yuv
stddev: 2.32 PSNR:40.80 bytes:7602176
3f20642bb789dfb75ae3e8c03f9b425c *./data/a-snow53.avi
2725570 ./data/a-snow53.avi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment