From c15652bce127b3967ec34a95b0cfaa366daddfb3 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Wed, 19 May 2010 15:48:00 -0700 Subject: [PATCH] Fixed an encoder debug/relese mismatch in x86_64-win64-vs8 Visual c++ compiler uses xmm registers for floating point operations for 64 bit architecture, therefore its calling convention requires the preservation of xmm6-xmm15 in any function that have used these registers. However, the sse2 functions, that were originally written for 32 bit windows, may have used xmm6 and xmm7 without preserving the content. In this particular case, the compiler used xmm6 to save the variable "two_pass_min_rate", the value of the variable is mucked up by our sse2 optimized loop filter functions, hence the results of release/debug mismatching. --- vp8/encoder/onyx_if.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index bc3550a..fbdda2c 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -4738,7 +4738,6 @@ void vp8_check_gf_quality(VP8_COMP *cpi) #if !(CONFIG_REALTIME_ONLY) static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) { - double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100); if (!cpi->common.refresh_alt_ref_frame) vp8_second_pass(cpi); @@ -4747,7 +4746,11 @@ static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, cpi->bits_left -= 8 * *size; if (!cpi->common.refresh_alt_ref_frame) + { + double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth + *cpi->oxcf.two_pass_vbrmin_section / 100); cpi->bits_left += (long long)(two_pass_min_rate / cpi->oxcf.frame_rate); + } } #endif -- 2.7.4