Help - Search - Members - Calendar
Full Version: How to convert the macro's in HE aac code
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - Tech
mpk_india
#define arm_mul(x, y, SCALEBITS) \
({ \
uint32_t __hi; \
uint32_t __lo; \
uint32_t __result; \
asm("smull %0, %1, %3, %4\n\t" \
"movs %0, %0, lsr %5\n\t" \
"adc %2, %0, %1, lsl %6" \
: "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
: "%r" (x), "r" (y), \
"M" (SCALEBITS), "M" (32 - (SCALEBITS)) \
: "cc"); \
__result; \
})

static INLINE void ComplexMult(real_t *y1, real_t *y2,
real_t x1, real_t x2, real_t c1, real_t c2)
{
int32_t tmp, yt1, yt2;
asm("smull %0, %1, %4, %6\n\t"
"smlal %0, %1, %5, %7\n\t"
"rsb %3, %4, #0\n\t"
"smull %0, %2, %5, %6\n\t"
"smlal %0, %2, %3, %7"
: "=&r" (tmp), "=&r" (yt1), "=&r" (yt2), "=r" (x1)
: "3" (x1), "r" (x2), "r" (c1), "r" (c2)
: "cc" );
*y1 = yt1 << (FRAC_SIZE-FRAC_BITS);
*y2 = yt2 << (FRAC_SIZE-FRAC_BITS);
}

Can anyone how this macro functions in HE AAC..As register in arm instruction mentioned as %1..%2..I really do not understand how this operate..I think passing parameters converted to these %0..some say %6..but what sequence it follows i do not understand..Can anyone suggest some documents regarding this..

Regards,

Madhav





jido
You want to use that code on a PC?

I would make a wild guess

static void ComplexMult(double* y1, double* y2, double x1, double x2, double c1, double c2)
{
*y1 = x1 * c1 - x2 * c2;
*y2 = x1 * c2 + x2 * c1;
}

You get the idea....
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.