[MPlayer-dev-eng] Another likely bug: libac3/imdct.c line 585 or so, etc...

Stephen Davies steve at daviesfam.org
Mon Nov 26 12:44:42 CET 2001


Where imdct.c is downmixing to stereo post idct, this code appears
for case "7" (3/2 format):

                        for (i = 0; i < 256; i++) {
                                left_tmp = dm_par->unit * *left++  + dm_par->clev * *center  + dm_par->slev * *left_sur++;
                                right_tmp= dm_par->unit * *right++ + dm_par->clev * *center++ + dm_par->slev * *right_sur++;
                                *s16_samples++ = (int16_t)(left_tmp + *delay_left);
                                *s16_samples++ = (int16_t)(right_tmp + *delay_right);
                                *delay_left++ = dm_par->unit * *delay1_left++  + dm_par->clev * *delay1_center  + dm_par->slev * *delay1_sl++;
                                *delay_right++ = dm_par->unit * *delay1_right++ + dm_par->clev * *center++ + dm_par->slev * *delay1_sr++;
                        }

I'm pretty sure there's a mistake here in the last line: that *center++
should be *delay1_center++.  That's fits the logic, and currently its
inconsistent with the left channel handling.

Similar code appears for other cases - each occurrence of center is wrong.

I suspect that this code isn't run often as it needs an ac3 frame where
some channels are using one 512 point idct, others 2 256 point ones.

Do you agree?  I'll fix in my surround patch unless anyone thinks my
understanding is wrong...

Steve




More information about the MPlayer-dev-eng mailing list