Hi,
On Sun, Aug 7, 2011 at 4:29 PM, Justin Ruggles <[email protected]> wrote:
> ---
> libavcodec/ac3enc.h | 2 ++
> libavcodec/ac3enc_fixed.c | 1 +
> libavcodec/ac3enc_template.c | 24 ++++++++++++++++++------
> 3 files changed, 21 insertions(+), 6 deletions(-)
[..]
> -static inline float calc_cpl_coord(float energy_ch, float energy_cpl)
> +static inline CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType
> energy_cpl)
> {
> +#if CONFIG_AC3ENC_FLOAT
> float coord = 0.125;
> if (energy_cpl > 0)
> coord *= sqrtf(energy_ch / energy_cpl);
> return FFMIN(coord, COEF_MAX);
> +#else
> + return 1048576;
> +#endif
That doesn't look the same at all?
> + LOCAL_ALIGNED_16(CoefType, cpl_coords, [AC3_MAX_BLOCKS],
> [AC3_MAX_CHANNELS][16]);
> #if CONFIG_AC3ENC_FLOAT
> - LOCAL_ALIGNED_16(float, cpl_coords, [AC3_MAX_BLOCKS],
> [AC3_MAX_CHANNELS][16]);
> LOCAL_ALIGNED_16(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS],
> [AC3_MAX_CHANNELS][16]);
> +#else
> +#define fixed_cpl_coords cpl_coords
> +#endif
Ehw. That is a little icky and will lead to a hard-to-debug conflict
later on. I'm wondering if you could use something like a struct
(float encoder) vs union (fixed-point encoder) here instead, i.e.:
#if CONFIG_AC3ENC_FLOAT
struct {
#else
union {
#endif
LOCAL_ALIGNED_16(CoefType, cpl_coords, [AC3_MAX_BLOCKS],
[AC3_MAX_CHANNELS][16]);
LOCAL_ALIGNED_16(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS],
[AC3_MAX_CHANNELS][16]);
} someprefix;
Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel