From 7af0d906e33439eb4d1c765e8d410f47058c6502 Mon Sep 17 00:00:00 2001 From: Attila Nagy Date: Tue, 22 Feb 2011 10:29:23 +0200 Subject: Remove temporal alt ref from realtime only build It is not used in realtime mode. Reduces memory footprint. Change-Id: I7f163225762368df5457cfd413050161d3704a3f --- vp8/encoder/onyx_if.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index f7c2c4aea..e1a1ed64d 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -261,35 +261,31 @@ static void setup_features(VP8_COMP *cpi) void vp8_dealloc_compressor_data(VP8_COMP *cpi) { - vpx_free(cpi->tplist); + vpx_free(cpi->tplist); cpi->tplist = NULL; // Delete last frame MV storage buffers - vpx_free(cpi->lfmv); - + vpx_free(cpi->lfmv); cpi->lfmv = 0; - vpx_free(cpi->lf_ref_frame_sign_bias); - + vpx_free(cpi->lf_ref_frame_sign_bias); cpi->lf_ref_frame_sign_bias = 0; - vpx_free(cpi->lf_ref_frame); - + vpx_free(cpi->lf_ref_frame); cpi->lf_ref_frame = 0; // Delete sementation map - vpx_free(cpi->segmentation_map); - + vpx_free(cpi->segmentation_map); cpi->segmentation_map = 0; - vpx_free(cpi->active_map); - + vpx_free(cpi->active_map); cpi->active_map = 0; +#if !(CONFIG_REALTIME_ONLY) // Delete first pass motion map - vpx_free(cpi->fp_motion_map); - + vpx_free(cpi->fp_motion_map); cpi->fp_motion_map = 0; +#endif vp8_de_alloc_frame_buffers(&cpi->common); @@ -311,21 +307,17 @@ void vp8_dealloc_compressor_data(VP8_COMP *cpi) cpi->tok = 0; // Structure used to monitor GF usage - vpx_free(cpi->gf_active_flags); - + vpx_free(cpi->gf_active_flags); cpi->gf_active_flags = 0; - vpx_free(cpi->mb.pip); - + vpx_free(cpi->mb.pip); cpi->mb.pip = 0; #if !(CONFIG_REALTIME_ONLY) - vpx_free(cpi->total_stats); - + vpx_free(cpi->total_stats); cpi->total_stats = 0; - vpx_free(cpi->this_frame_stats); - + vpx_free(cpi->this_frame_stats); cpi->this_frame_stats = 0; #endif } @@ -2161,9 +2153,11 @@ 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 -- cgit v1.2.3 From 6da2018789e08158197be02d83c0cfe9e826fb13 Mon Sep 17 00:00:00 2001 From: Attila Nagy Date: Fri, 25 Feb 2011 08:38:07 +0200 Subject: Remove a second check for invalid ptr in vp8_get_compressed_data Check is done first when function si entered. Change-Id: Ief0d0cbd4860aaf492b78728f8d22f24029b1174 --- vp8/encoder/onyx_if.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index f7c2c4aea..4ac45b1b0 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -5227,23 +5227,6 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon if (cpi->compressor_speed == 2) { vp8_check_gf_quality(cpi); - } - - if (!cpi) - { -#if HAVE_ARMV7 -#if CONFIG_RUNTIME_CPU_DETECT - if (cm->rtcd.flags & HAS_NEON) -#endif - { - vp8_pop_neon(store_reg); - } -#endif - return 0; - } - - if (cpi->compressor_speed == 2) - { vpx_usec_timer_start(&tsctimer); vpx_usec_timer_start(&ticktimer); } -- cgit v1.2.3 From d8fc974ac0b698e53173477ecdafcc9300ca5ea8 Mon Sep 17 00:00:00 2001 From: Attila Nagy Date: Fri, 25 Feb 2011 08:21:45 +0200 Subject: Avoid double copying of key frames into alt and golden buffer Change-Id: I726976a297a593a35ed6cba3c660e372562f7b27 --- vp8/encoder/onyx_if.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index f7c2c4aea..e6c83a125 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -3130,8 +3130,11 @@ static void update_golden_frame_and_stats(VP8_COMP *cpi) // Update the Golden frame reconstruction buffer if signalled and the GF usage counts. if (cm->refresh_golden_frame) { - // Update the golden frame buffer - vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]); + if (cm->frame_type != KEY_FRAME) + { + // Update the golden frame buffer + vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]); + } // Select an interval before next GF if (!cpi->auto_gold) @@ -4748,16 +4751,19 @@ static void encode_frame_to_data_rate if (cpi->oxcf.error_resilient_mode) { - // Is this an alternate reference update - if (cpi->common.refresh_alt_ref_frame) - vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]); + if (cm->frame_type != KEY_FRAME) + { + // Is this an alternate reference update + if (cm->refresh_alt_ref_frame) + vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->alt_fb_idx]); - if (cpi->common.refresh_golden_frame) - vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]); + if (cm->refresh_golden_frame) + vp8_yv12_copy_frame_ptr(cm->frame_to_show, &cm->yv12_fb[cm->gld_fb_idx]); + } } else { - if (cpi->oxcf.play_alternate && cpi->common.refresh_alt_ref_frame && (cpi->common.frame_type != KEY_FRAME)) + if (cpi->oxcf.play_alternate && cm->refresh_alt_ref_frame && (cm->frame_type != KEY_FRAME)) // Update the alternate reference frame and stats as appropriate. update_alt_ref_frame_and_stats(cpi); else -- cgit v1.2.3