Hi,

On Wed, Mar 7, 2012 at 1:38 AM, Benjamin Larsson <benja...@southpole.se> wrote:
> On 03/06/2012 10:45 PM, Ronald S. Bultje wrote:
>>
>> From: "Ronald S. Bultje"<rsbul...@gmail.com>
>>
>> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
>> CC: libav-sta...@libav.org
>> ---
>>  libavcodec/cookdata.h |   22 ++++++++++++++++------
>>  1 file changed, 16 insertions(+), 6 deletions(-)
>
>
> Nice, I like the solution, but it definitely needs a comment in the source.

Will add.

> And why do you add a 1 in the beginning just to offset the table later ?

The decoupling uses this code:

 830     idx = (1 << p->js_vlc_bits) - 1;
 831     for (i = p->js_subband_start; i < p->subbands; i++) {
 832         cpl_tmp = cplband[i];
 833         idx -= decouple_tab[cpl_tmp];
 834         cplscale = q->cplscales[p->js_vlc_bits - 2];  // choose
decoupler table
 835         f1 = cplscale[decouple_tab[cpl_tmp]];
 836         f2 = cplscale[idx - 1];

Example, if vlc_bits == 5, then idx in line 830 is 31, so if
decouple_tab is X, then it uses f1_idx=X and f2_idx=31-X-1, e.g. if
f1=31, then f2=-1. I could either offset the indexing tables
(decouple_tab) by one, or offset the cplscale tables by one, the
second looked simpler. It's admittedly a little hacky, so I can it the
other way around also.

Ronald
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to