From db6d0a5bd2447b764d67bcd66741e8044a3d7c3f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 10 May 2015 00:57:06 +0200 Subject: [PATCH] avcodec/snowenc: Fix used reference MV in fullpel iterative ME This very very slightly improves quality, no measurable speed change Signed-off-by: Michael Niedermayer --- libavcodec/snowenc.c | 10 ++++++---- tests/ref/vsynth/vsynth1-snow | 6 +++--- tests/ref/vsynth/vsynth1-snow-hpel | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index a30c618004..a8f4106355 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1112,13 +1112,15 @@ static void iterative_me(SnowContext *s){ /* fullpel ME */ //FIXME avoid subpel interpolation / round to nearest integer do{ + int newx = block->mx; + int newy = block->my; dia_change=0; for(i=0; iavctx->dia_size, 1); i++){ for(j=0; jmx+4*(i-j), block->my+(4*j), obmc_edged, &best_rd); - dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), obmc_edged, &best_rd); - dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), obmc_edged, &best_rd); - dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), obmc_edged, &best_rd); + dia_change |= check_block_inter(s, mb_x, mb_y, newx+4*(i-j), newy+(4*j), obmc_edged, &best_rd); + dia_change |= check_block_inter(s, mb_x, mb_y, newx-4*(i-j), newy-(4*j), obmc_edged, &best_rd); + dia_change |= check_block_inter(s, mb_x, mb_y, newx+4*(i-j), newy-(4*j), obmc_edged, &best_rd); + dia_change |= check_block_inter(s, mb_x, mb_y, newx-4*(i-j), newy+(4*j), obmc_edged, &best_rd); } } }while(dia_change); diff --git a/tests/ref/vsynth/vsynth1-snow b/tests/ref/vsynth/vsynth1-snow index 2f0f582da7..24c41674e1 100644 --- a/tests/ref/vsynth/vsynth1-snow +++ b/tests/ref/vsynth/vsynth1-snow @@ -1,4 +1,4 @@ -e4de85f539ef50b08d2a1dc7e57c7f49 *tests/data/fate/vsynth1-snow.avi -136080 tests/data/fate/vsynth1-snow.avi -91021b7d6d7908648fe78cc1975af8c4 *tests/data/fate/vsynth1-snow.out.rawvideo +61915927233f94db766dd968e750d6a8 *tests/data/fate/vsynth1-snow.avi +136324 tests/data/fate/vsynth1-snow.avi +443a1fbdfea490453e790b7e99c0c8df *tests/data/fate/vsynth1-snow.out.rawvideo stddev: 22.77 PSNR: 20.98 MAXDIFF: 172 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth1-snow-hpel b/tests/ref/vsynth/vsynth1-snow-hpel index 2d3401ccba..1c0691e33f 100644 --- a/tests/ref/vsynth/vsynth1-snow-hpel +++ b/tests/ref/vsynth/vsynth1-snow-hpel @@ -1,4 +1,4 @@ -a9e99877f757a99816fd82461d047812 *tests/data/fate/vsynth1-snow-hpel.avi -138704 tests/data/fate/vsynth1-snow-hpel.avi -d6845c8f1310e041afdcebc6bbfc449b *tests/data/fate/vsynth1-snow-hpel.out.rawvideo +a49202654daa09408565be55b2a18010 *tests/data/fate/vsynth1-snow-hpel.avi +138684 tests/data/fate/vsynth1-snow-hpel.avi +00a7d96a4829e4babbe496bb0d1a1cdc *tests/data/fate/vsynth1-snow-hpel.out.rawvideo stddev: 22.74 PSNR: 20.99 MAXDIFF: 171 bytes: 7603200/ 7603200