Logo Search packages:      
Sourcecode: blender version File versions

static void gain_window ( COOKContext *  q,
float *  buffer,
COOKgain *  gain_now,
COOKgain *  gain_previous 
) [static]

timedomain requantization of the timedomain samples

Parameters:
q pointer to the COOKContext
buffer pointer to the timedomain buffer
gain_now current gain structure
gain_previous previous gain structure

Definition at line 797 of file cook.c.

References interpolate().

Referenced by gain_compensate().

                                                {
    int i, index;
    int gain_index[9];
    int tmp_gain_index;

    gain_index[8]=0;
    index = gain_previous->size;
    for (i=7 ; i>=0 ; i--) {
        if(index && gain_previous->qidx_table1[index-1]==i) {
            gain_index[i] = gain_previous->qidx_table2[index-1];
            index--;
        } else {
            gain_index[i]=gain_index[i+1];
        }
    }
    /* This is applied to the to be previous data buffer. */
    for(i=0;i<8;i++){
        interpolate(q, &buffer[q->samples_per_channel+q->gain_size_factor*i],
                    gain_index[i], gain_index[i+1]);
    }

    tmp_gain_index = gain_index[0];
    index = gain_now->size;
    for (i=7 ; i>=0 ; i--) {
        if(index && gain_now->qidx_table1[index-1]==i) {
            gain_index[i]= gain_now->qidx_table2[index-1];
            index--;
        } else {
            gain_index[i]=gain_index[i+1];
        }
    }

    /* This is applied to the to be current block. */
    for(i=0;i<8;i++){
        interpolate(q, &buffer[i*q->gain_size_factor],
                    tmp_gain_index+gain_index[i],
                    tmp_gain_index+gain_index[i+1]);
    }
}


Generated by  Doxygen 1.6.0   Back to index