[Flac-dev] libFLAC internals

Miroslav Lichvar lichvarm at phoenix.inf.upol.cz
Fri Feb 21 09:13:19 PST 2003

On Thu, Feb 20, 2003 at 05:46:50PM -0600, Brady Patterson wrote:
> I'm working on Altivec versions of some of the libFLAC functions.  I figured
> the best candidates would be those that had MMX/SSE/3dnow versions, and I
> picked FLAC__lpc_restore_signal() to do first, since it's relatively simple.
> In stepping through some runs, it appears that 'order' mod 4 is always 0.  Is
> that guaranteed, either by the format or by higher functions in the reference
> decoder?

No, 1 <= order <= 32. There is -l option :).

> Also, what assumptions can I make about the alignment of 'data' and
> 'qlp_coeff'?  It would be really nice if these were both doubleword-aligned.

Everything should be 4 byte aligned, residual is 8 byte aligned on GNU
libc based system. If this isn't good enough (and it isn't for SSE2),
we will have to replace appropriate malloc calls. However, you can
copy qlp_coeffs on stack for better alignment.

> Finally, in a more general context, is there an easy way to build for
> profiling, or do I have to edit the makefiles?  I'm using gcc and gprof.

IIRC powerpc has performance counters, if you want the best code, use

For gprof profiling patch configure.in and build flac with
--enable-static --enable-profile

> AC_ARG_ENABLE(profile,
> [  --enable-profile               Turn on profiling],
> [case "${enableval}" in
> 	yes) profile=true ;;
> 	no)  profile=false ;;
> 	*) AC_MSG_ERROR(bad value ${enableval} for --enable-profile) ;;
> esac],[profile=false])
> if test x$profile = xtrue; then
> 	if test x$GCC = xyes; then
> 		CFLAGS="`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'` -pg"
> 	else
> 	fi
> fi

Miroslav Lichvar

More information about the Flac-dev mailing list