From ed40ff9e2dfb261db4ab1dd5d5f984a2b59cf936 Mon Sep 17 00:00:00 2001 From: Adrian Grange Date: Thu, 10 Mar 2011 11:32:48 -0800 Subject: Removed firstpass motion map The firstpass motion map consists of an 8-bit flag for each MB indicating how strongly the firstpass code believes it should be filtered during the second pass ARNR filtering. For long or large format material the motion map can become extremely large and hamper the operation of the encoding process. This change removes the motion map altogether, leaving the second pass to rely on the magnitude of the motion compensated error to determine the filter weight to use for the MB during ARNR filtering. Tests on the derf set indicate that the effect of this change is neutral, with some small wins and losses. The motion map has therefore been removed based on a cost/benefit evaluation. Change-Id: I53e07d236f5ce09a6f0c54e7c4ffbb490fb870f6 --- vp8/encoder/onyx_if.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 797e18b30..8c477ef34 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -281,12 +281,6 @@ void vp8_dealloc_compressor_data(VP8_COMP *cpi) vpx_free(cpi->active_map); cpi->active_map = 0; -#if !(CONFIG_REALTIME_ONLY) - // Delete first pass motion map - vpx_free(cpi->fp_motion_map); - cpi->fp_motion_map = 0; -#endif - vp8_de_alloc_frame_buffers(&cpi->common); vp8_yv12_de_alloc_frame_buffer(&cpi->last_frame_uf); @@ -1360,11 +1354,11 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi) #if !(CONFIG_REALTIME_ONLY) vpx_free(cpi->total_stats); - cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs)); + cpi->total_stats = vpx_calloc(1, sizeof(FIRSTPASS_STATS)); vpx_free(cpi->this_frame_stats); - cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs)); + cpi->this_frame_stats = vpx_calloc(1, sizeof(FIRSTPASS_STATS)); if(!cpi->total_stats || !cpi->this_frame_stats) vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, @@ -1543,8 +1537,6 @@ void vp8_init_config(VP8_PTR ptr, VP8_CONFIG *oxcf) #if VP8_TEMPORAL_ALT_REF - cpi->use_weighted_temporal_filter = 0; - { int i; @@ -1927,12 +1919,6 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) vpx_memset(cpi->active_map , 1, (cpi->common.mb_rows * cpi->common.mb_cols)); cpi->active_map_enabled = 0; -#if !(CONFIG_REALTIME_ONLY) - // Create the first pass motion map structure and set to 0 - // Allocate space for maximum of 15 buffers - CHECK_MEM_ERROR(cpi->fp_motion_map, vpx_calloc(15*cpi->common.MBs, 1)); -#endif - #if 0 // Experimental code for lagged and one pass // Initialise one_pass GF frames stats @@ -2082,7 +2068,7 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) } else if (cpi->pass == 2) { - size_t packet_sz = vp8_firstpass_stats_sz(cpi->common.MBs); + size_t packet_sz = sizeof(FIRSTPASS_STATS); int packets = oxcf->two_pass_stats_in.sz / packet_sz; cpi->stats_in = oxcf->two_pass_stats_in.buf; -- cgit v1.2.3