View Single Post
Old 23rd April 2007, 15:32   #20  |  Link
plugh
A hollow voice says
 
Join Date: Sep 2006
Posts: 269
Continuing my comparisons between msvc to gcc,
I tried various relevant encoder options to probe
the "vhq for b-frames" behavioural difference.

The results were inconclusive.
So I decided to try a differant tack.

Note that I am using a Duron 1.8GHz
that has mmx, xmm, sse, 3dne, 3dne2

Using encode options vhq-b=on, vhq=1, 4mv=off
(this is _a_ case where msvc and gcc builds differ)
Code:
Using a normal 'optimized' msvc build, compare

h263,default	h263,mmxonly	identical
mpeg,default	mpeg,mmxonly	differant

Using a build with estimation_rd_based_bvop.c compiled noopt

h263,default	h263,mmxonly	identical
mpeg,default	mpeg,mmxonly	differant
So far so good. Horizontal differences, while not ideal,
*may* simply indicate an accuracy difference between the
mmx asm routines, and the default mixed, non-orthogonal,
set used on my processor.

Now if there is NO optimization sensitivity on the relevant
C code paths, then comparing the above 8 encodes *vertically*
should give me all identical comparison results. They don't!
Code:
identical	identical
DIFFERANT	identical
To make this clear, whether this module is optimized or not
*should* have no effect on its results. The vertical comparisons
*should* all be 'identical'. But it appears there is an interaction
between the optimization status of this module and the default mix
of asm routines used on my processor. This is not good.

For what it's worth, the relevant asm routines are:

quant_mpeg_inter_xmm and dequant_mpeg_inter_3dne
--vs--
quant_mpeg_inter_mmx and dequant_mpeg_inter_mmx
(and perhaps fdct_mmx_skal vs fdct_xmm_skal )

These are called from within two 'large' static inline routines.
Block_CalcBits_BVOP and Block_CalcBits_BVOP_direct

These two inline routines are virtually identical (only ONE line
is differant), and they are invoked multiple times both within
and outside of loops. My gut tells me that the various compiler
optimizers are having a field day with this.

Where to go from here? Beats me - perhaps someone 'out there'
can look at those asm routines and the relevant C code and figure
out why there is an interaction with the C compiler's optimizer...

Last edited by plugh; 23rd April 2007 at 16:07.
plugh is offline   Reply With Quote