From 48c28fc42c8c1ca46f30ff0fc4f13e3afd4a25b7 Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Tue, 11 Jan 2011 13:01:24 +0100 Subject: Remove unused local variables Removing unused local variables causing compiler warnings in Visual Studio. Change-Id: I0e2096303be1fdbc01428a6e57cca9796bb32c8a --- vp8/common/postproc.c | 3 ++- vp8/decoder/decodframe.c | 1 - vp8/decoder/threading.c | 5 +---- vp8/encoder/encodeframe.c | 2 -- vp8/encoder/encodemb.c | 1 - vp8/encoder/firstpass.c | 3 --- vp8/encoder/onyx_if.c | 6 ++++-- vp8/encoder/quantize.c | 1 - 8 files changed, 7 insertions(+), 15 deletions(-) (limited to 'vp8') diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index 15b1c2c89..d30068ef5 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -680,7 +680,6 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) { - char message[512]; int q = oci->filter_level * 10 / 6; int flags = ppflags->post_proc_flag; int deblock_level = ppflags->deblocking_level; @@ -744,6 +743,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t #if CONFIG_POSTPROC_VISUALIZER if (flags & VP8D_DEBUG_TXT_FRAME_INFO) { + char message[512]; sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", (oci->frame_type == KEY_FRAME), oci->refresh_golden_frame, @@ -823,6 +823,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t if (flags & VP8D_DEBUG_TXT_RATE_INFO) { + char message[512]; sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate); vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); } diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 4702faeed..9305a0556 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -485,7 +485,6 @@ static void setup_token_decoder(VP8D_COMP *pbi, static void stop_token_decoder(VP8D_COMP *pbi) { - int i; VP8_COMMON *pc = &pbi->common; if (pc->multi_token_partition != ONE_PARTITION) diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index fea4e1cc1..dac990a26 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -451,7 +451,6 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi) #if CONFIG_MULTITHREAD int core_count = 0; int ithread; - int i; pbi->b_multithreaded_rd = 0; pbi->allocated_decoding_thread_count = 0; @@ -721,7 +720,6 @@ void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl) /*int mb_row; int mb_col; int baseline_filter_level[MAX_MB_SEGMENTS];*/ - int filter_level; int alt_flt_enabled = mbd->segmentation_enabled; int i; @@ -769,7 +767,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) int ibc = 0; int num_part = 1 << pbi->common.multi_token_partition; - int i, j; + int i; volatile int *last_row_current_mb_col = NULL; int nsync = pbi->sync_range; @@ -809,7 +807,6 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd) for (mb_row = 0; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1)) { - int i; xd->current_bc = &pbi->mbc[mb_row%num_part]; diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index e27e2e64e..2a89c59f4 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -408,7 +408,6 @@ unsigned int vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x) int sum; unsigned int a; unsigned int b; - unsigned int d; /* TODO: This could also be done over smaller areas (8x8), but that would * require extensive changes elsewhere, as lambda is assumed to be fixed * over an entire MB in most of the code. @@ -629,7 +628,6 @@ void vp8_encode_frame(VP8_COMP *cpi) VP8_COMMON *const cm = & cpi->common; MACROBLOCKD *const xd = & x->e_mbd; - int i; TOKENEXTRA *tp = cpi->tok; int segment_counts[MAX_MB_SEGMENTS]; int totalrate; diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index 464d4a236..efcea745b 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -273,7 +273,6 @@ void vp8_optimize_b(MACROBLOCK *mb, int ib, int type, int x; int sz; int next; - int path; int rdmult; int rddiv; int final_eob; diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index 4d259c676..75502ccc9 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -262,7 +262,6 @@ extern size_t vp8_firstpass_stats_sz(unsigned int mb_count) * macroblock. */ size_t stats_sz; - FIRSTPASS_STATS stats; stats_sz = sizeof(FIRSTPASS_STATS) + mb_count; stats_sz = (stats_sz + 7) & ~7; @@ -389,8 +388,6 @@ unsigned char *vp8_fpmm_get_pos(VP8_COMP *cpi) } void vp8_fpmm_reset_pos(VP8_COMP *cpi, unsigned char *target_pos) { - int Offset; - cpi->fp_motion_map_stats = target_pos; } diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 2d9e8011b..4da1a566f 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -3792,8 +3792,6 @@ static void encode_frame_to_data_rate if (cpi->pass == 2 || (cm->current_video_frame > 150)) { int Q; - int i; - int bpm_target; //int tmp; vp8_clear_system_state(); @@ -4828,7 +4826,9 @@ extern void vp8_pop_neon(INT64 *store); #endif int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time) { +#if HAVE_ARMV7 INT64 store_reg[8]; +#endif VP8_COMP *cpi = (VP8_COMP *) ptr; VP8_COMMON *cm = &cpi->common; struct vpx_usec_timer timer; @@ -4931,7 +4931,9 @@ int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CON } int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush) { +#if HAVE_ARMV7 INT64 store_reg[8]; +#endif VP8_COMP *cpi = (VP8_COMP *) ptr; VP8_COMMON *cm = &cpi->common; struct vpx_usec_timer tsctimer; diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index a67299487..be9f26c7f 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -70,7 +70,6 @@ void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d) void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d) { int i, rc, eob; - int zbin; int x, y, z, sz; short *coeff_ptr = b->coeff; short *round_ptr = b->round; -- cgit v1.2.3 From 1546e6a8c9b34db4925781234300cadf0f2c7ecd Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Mon, 10 Jan 2011 17:21:55 -0500 Subject: Add no_skip_block4x4_search flag in SPLITMV mode Add a flag to always enable block4x4 search for speed=0 (good quality) to guarantee no quality loss for speed0. Change-Id: Ie04bbc25f7e6a33a7bfa30e05775d33148731c81 --- vp8/encoder/onyx_if.c | 2 ++ vp8/encoder/onyx_int.h | 1 + vp8/encoder/rdopt.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'vp8') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 2d9e8011b..9fdf61864 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -592,6 +592,7 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->iterative_sub_pixel = 1; sf->optimize_coefficients = 1; sf->use_fastquant_for_pick = 0; + sf->no_skip_block4x4_search = 1; sf->first_step = 0; sf->max_step_search_steps = MAX_MVSEARCH_STEPS; @@ -794,6 +795,7 @@ void vp8_set_speed_features(VP8_COMP *cpi) sf->first_step = 1; sf->max_step_search_steps = MAX_MVSEARCH_STEPS; + sf->no_skip_block4x4_search = 0; } if (Speed > 1) diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 05e8c4e6a..6bffd982f 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -183,6 +183,7 @@ typedef struct int optimize_coefficients; int use_fastquant_for_pick; + int no_skip_block4x4_search; } SPEED_FEATURES; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 366b8759a..e751b0961 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -1375,7 +1375,8 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x, } /* If 8x8 is better than 16x8/8x16, then do 4x4 search */ - if (bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */ + /* Not skip 4x4 if speed=0 (good quality) */ + if (cpi->sf.no_skip_block4x4_search || bsi.segment_num == BLOCK_8X8) /* || (sv_segment_rd8x8-bsi.segment_rd) < sv_segment_rd8x8>>5) */ { bsi.mvp = &bsi.sv_mvp[0]; vp8_rd_check_segment(cpi, x, &bsi, BLOCK_4X4); -- cgit v1.2.3 From f50f2fd2a73f2c5ee3f10ad077e780398df17cd7 Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 11 Jan 2011 11:22:29 -0500 Subject: use unaligned load source buffer is not guaranteed to be aligned for odd size buffers Change-Id: Id0b1fd40ba3bd6c994bcfada788feccd2b53c5a9 --- vp8/encoder/x86/temporal_filter_apply_sse2.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8') diff --git a/vp8/encoder/x86/temporal_filter_apply_sse2.asm b/vp8/encoder/x86/temporal_filter_apply_sse2.asm index 0127b012e..f2adcccba 100644 --- a/vp8/encoder/x86/temporal_filter_apply_sse2.asm +++ b/vp8/encoder/x86/temporal_filter_apply_sse2.asm @@ -84,7 +84,7 @@ temporal_filter_apply_load_8: jmp temporal_filter_apply_load_finished temporal_filter_apply_load_16: - movdqa xmm0, [rsi] ; src (frame1) + movdqu xmm0, [rsi] ; src (frame1) lea rsi, [rsi + rbp] ; += stride movdqa xmm1, xmm0 punpcklbw xmm0, xmm7 ; src[ 0- 7] -- cgit v1.2.3 From 55acda98f7f9d4e745e8b6ab02848d6da015b65b Mon Sep 17 00:00:00 2001 From: Paul Wilkins Date: Wed, 12 Jan 2011 17:08:42 +0000 Subject: Limit key frame quantizer for forced key frames. Where a key frame occurs because of a minimum interval selected by the user, then these forced key frames ideally need to be more closely matched in quality to the surrounding frame. Change-Id: Ia55b1f047e77dc7fbd78379c45869554f25b3df7 --- vp8/encoder/firstpass.c | 11 +++++++++-- vp8/encoder/onyx_if.c | 22 ++++++++++++++++++---- vp8/encoder/onyx_int.h | 3 ++- 3 files changed, 29 insertions(+), 7 deletions(-) (limited to 'vp8') diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index 75502ccc9..c59613838 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -980,10 +980,10 @@ static int estimate_max_q(VP8_COMP *cpi, double section_err, int section_target_ // Restriction on active max q for constrained quality mode. if ( (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) && (Q < cpi->cq_target_quality) ) - //(Q < cpi->oxcf.cq_target_quality) ) + //(Q < cpi->oxcf.cq_level;) ) { Q = cpi->cq_target_quality; - //Q = cpi->oxcf.cq_target_quality; + //Q = cpi->oxcf.cq_level; } // Adjust maxq_min_limit and maxq_max_limit limits based on @@ -2286,6 +2286,9 @@ void vp8_find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) cpi->common.frame_type = KEY_FRAME; + // is this a forced key frame by interval + cpi->this_key_frame_forced = cpi->next_key_frame_forced; + // Clear the alt ref active flag as this can never be active on a key frame cpi->source_alt_ref_active = FALSE; @@ -2348,7 +2351,11 @@ void vp8_find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) kf_group_err /= 2.0; kf_group_intra_err /= 2.0; kf_group_coded_err /= 2.0; + + cpi->next_key_frame_forced = TRUE; } + else + cpi->next_key_frame_forced = FALSE; // Special case for the last frame of the file if (cpi->stats_in >= cpi->stats_in_end) diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 1284a2aa8..65925d9f9 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -2272,6 +2272,8 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) cpi->frames_since_key = 8; // Give a sensible default for the first frame. cpi->key_frame_frequency = cpi->oxcf.key_freq; + cpi->this_key_frame_forced = FALSE; + cpi->next_key_frame_forced = FALSE; cpi->source_alt_ref_pending = FALSE; cpi->source_alt_ref_active = FALSE; @@ -3817,10 +3819,22 @@ static void encode_frame_to_data_rate // KEY FRAMES else { - if (cpi->gfu_boost > 600) - cpi->active_best_quality = kf_low_motion_minq[Q]; - else - cpi->active_best_quality = kf_high_motion_minq[Q]; + // Special case for key frames forced because we have reached + // the maximum key frame interval. Here force the Q to a range + // close to but just below the ambient Q to reduce the risk + // of popping + if ( cpi->this_key_frame_forced ) + { + cpi->active_worst_quality = cpi->avg_frame_qindex * 7/8; + cpi->active_best_quality = cpi->avg_frame_qindex * 2/3; + } + else + { + if (cpi->gfu_boost > 600) + cpi->active_best_quality = kf_low_motion_minq[Q]; + else + cpi->active_best_quality = kf_high_motion_minq[Q]; + } } } else diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 6bffd982f..6b07e2f22 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -317,7 +317,8 @@ typedef struct unsigned int frames_since_key; unsigned int key_frame_frequency; - unsigned int next_key; + unsigned int this_key_frame_forced; + unsigned int next_key_frame_forced; unsigned int mode_check_freq[MAX_MODES]; unsigned int mode_test_hit_counts[MAX_MODES]; -- cgit v1.2.3