# HG changeset patch # User mhoffman # Date 1184592283 0 # Node ID 59ec490fe985f521ee6881ed61f1e8163b33fd43 # Parent b41036edcf2e0547de281c46134595364f12dee6 fixpoint: move cplscales to context structure and provide hook for data format conversion diff -r b41036edcf2e -r 59ec490fe985 cook.c --- a/cook.c Mon Jul 16 12:32:41 2007 +0000 +++ b/cook.c Mon Jul 16 13:24:43 2007 +0000 @@ -144,6 +144,8 @@ float decode_buffer_1[1024]; float decode_buffer_2[1024]; float decode_buffer_0[1060]; /* static allocation for joint decode */ + + float *cplscales[5]; } COOKContext; /* debug functions */ @@ -262,6 +264,18 @@ return 0; } +static float *maybe_reformat_buffer32 (COOKContext *q, float *ptr, int n) +{ + if (1) + return ptr; +} + +static int init_cplscales_table (COOKContext *q) { + int i; + for (i=0;i<5;i++) + q->cplscales[i] = maybe_reformat_buffer32 (q, cplscales[i], (1<<(i+2))-1); +} + /*************** init functions end ***********/ /** @@ -843,7 +857,7 @@ for (i=q->js_subband_start ; isubbands ; i++) { cpl_tmp = cplband[i]; idx -=decouple_tab[cpl_tmp]; - cplscale = (float*)cplscales[q->js_vlc_bits-2]; //choose decoupler table + cplscale = q->cplscales[q->js_vlc_bits-2]; //choose decoupler table f1 = cplscale[decouple_tab[cpl_tmp]]; f2 = cplscale[idx-1]; q->decouple (q, i, f1, f2, decode_buffer, mlt_buffer1, mlt_buffer2); @@ -1113,6 +1127,7 @@ init_rootpow2table(q); init_pow2table(q); init_gain_table(q); + init_cplscales_table(q); if (init_cook_vlc_tables(q) != 0) return -1;