comparison cook.c @ 12116:0ae85799341a libavcodec

Improve variable names in imlt_window_float() and mlt_compensate_output().
author diego
date Thu, 08 Jul 2010 17:55:37 +0000
parents 495b13d86191
children ee740a4e80c5
comparison
equal deleted inserted replaced
12115:e97aba4d16ea 12116:0ae85799341a
707 707
708 /** 708 /**
709 * Apply transform window, overlap buffers. 709 * Apply transform window, overlap buffers.
710 * 710 *
711 * @param q pointer to the COOKContext 711 * @param q pointer to the COOKContext
712 * @param buffer1 pointer to the mltcoefficients 712 * @param inbuffer pointer to the mltcoefficients
713 * @param gains_ptr current and previous gains 713 * @param gains_ptr current and previous gains
714 * @param previous_buffer pointer to the previous buffer to be used for overlapping 714 * @param previous_buffer pointer to the previous buffer to be used for overlapping
715 */ 715 */
716 716
717 static void imlt_window_float (COOKContext *q, float *buffer1, 717 static void imlt_window_float (COOKContext *q, float *inbuffer,
718 cook_gains *gains_ptr, float *previous_buffer) 718 cook_gains *gains_ptr, float *previous_buffer)
719 { 719 {
720 const float fc = pow2tab[gains_ptr->previous[0] + 63]; 720 const float fc = pow2tab[gains_ptr->previous[0] + 63];
721 int i; 721 int i;
722 /* The weird thing here, is that the two halves of the time domain 722 /* The weird thing here, is that the two halves of the time domain
725 * Almost sounds like a complex conjugate/reverse data/FFT effect. 725 * Almost sounds like a complex conjugate/reverse data/FFT effect.
726 */ 726 */
727 727
728 /* Apply window and overlap */ 728 /* Apply window and overlap */
729 for(i = 0; i < q->samples_per_channel; i++){ 729 for(i = 0; i < q->samples_per_channel; i++){
730 buffer1[i] = buffer1[i] * fc * q->mlt_window[i] - 730 inbuffer[i] = inbuffer[i] * fc * q->mlt_window[i] -
731 previous_buffer[i] * q->mlt_window[q->samples_per_channel - 1 - i]; 731 previous_buffer[i] * q->mlt_window[q->samples_per_channel - 1 - i];
732 } 732 }
733 } 733 }
734 734
735 /** 735 /**
922 * Apply modulated lapped transform, gain compensation, 922 * Apply modulated lapped transform, gain compensation,
923 * clip and convert to integer. 923 * clip and convert to integer.
924 * 924 *
925 * @param q pointer to the COOKContext 925 * @param q pointer to the COOKContext
926 * @param decode_buffer pointer to the mlt coefficients 926 * @param decode_buffer pointer to the mlt coefficients
927 * @param gains array of current/prev gain pointers 927 * @param gains_ptr array of current/prev gain pointers
928 * @param previous_buffer pointer to the previous buffer to be used for overlapping 928 * @param previous_buffer pointer to the previous buffer to be used for overlapping
929 * @param out pointer to the output buffer 929 * @param out pointer to the output buffer
930 * @param chan 0: left or single channel, 1: right channel 930 * @param chan 0: left or single channel, 1: right channel
931 */ 931 */
932 932
933 static inline void 933 static inline void
934 mlt_compensate_output(COOKContext *q, float *decode_buffer, 934 mlt_compensate_output(COOKContext *q, float *decode_buffer,
935 cook_gains *gains, float *previous_buffer, 935 cook_gains *gains_ptr, float *previous_buffer,
936 int16_t *out, int chan) 936 int16_t *out, int chan)
937 { 937 {
938 imlt_gain(q, decode_buffer, gains, previous_buffer); 938 imlt_gain(q, decode_buffer, gains_ptr, previous_buffer);
939 q->saturate_output (q, chan, out); 939 q->saturate_output (q, chan, out);
940 } 940 }
941 941
942 942
943 /** 943 /**