[FFmpeg-devel] [PATCH] ALS decoder

Michael Niedermayer michaelni
Wed Nov 4 15:41:59 CET 2009


On Sat, Oct 31, 2009 at 12:58:59PM +0100, Thilo Borgmann wrote:
> Revision 24 attached.

[...]
> +        if (opt_order) {
> +            int add_base;
> +
> +            if (sconf->coef_table == 3) {
> +                add_base = 0x7F;
> +
> +                // read coefficient 0

> +                quant_cof[0]  = parcor_scaled_values[get_bits(gb, 7)];
> +                quant_cof[0] *= 32;
> +
> +                // read coefficient 1
> +                quant_cof[1]  = -parcor_scaled_values[get_bits(gb, 7)];
> +                quant_cof[0] *= 32;

is it intended to do this to [0] [0] / [1] [0] ?

also isnt it possible for max_order to be one and thus the quant_cof array
to be too small?


> +
> +                // read coefficients 2 to opt_order
> +                for (k = 2; k < opt_order; k++)
> +                    quant_cof[k] = get_bits(gb, 7);
> +            } else {
> +                int k_max;
> +                add_base = 1;
> +
> +                // read coefficient 0 to 19
> +                k_max = FFMIN(opt_order, 20);
> +                for (k = 0; k < k_max; k++) {
> +                    int rice_param = parcor_rice_table[sconf->coef_table][k][1];
> +                    int offset     = parcor_rice_table[sconf->coef_table][k][0];
> +                    quant_cof[k] = decode_rice(gb, rice_param) + offset;
> +                }
> +
> +                // read coefficients 20 to 126
> +                k_max = FFMIN(opt_order, 127);
> +                for (; k < k_max; k++)
> +                    quant_cof[k] = decode_rice(gb, 2) + (k & 1);
> +
> +                // read coefficients 127 to opt_order
> +                for (; k < opt_order; k++)
> +                    quant_cof[k] = decode_rice(gb, 1);
> +

> +                quant_cof[0]  =  parcor_scaled_values[quant_cof[0] + 64];
> +                quant_cof[0] *= 32;
> +                quant_cof[1]  = -parcor_scaled_values[quant_cof[1] + 64];
> +                quant_cof[1] *= 32;

quant_cof[0] = 32 * parcor_scaled_values[quant_cof[0] + 64];
...


[...]
> +            if (independent_bs) {
> +                if (decode_blocks_ind(ctx, ra_frame, c, div_blocks, js_blocks))
> +                    return -1;
> +

> +                if (independent_bs)
> +                    independent_bs--;

the if() is superflous


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091104/1ac3793f/attachment.pgp>



More information about the ffmpeg-devel mailing list