[FFmpeg-devel] [PATCH] ALS decoder

Justin Ruggles justin.ruggles
Thu Aug 20 01:13:16 CEST 2009


Thilo Borgmann wrote:

> Hi,
> 
> the second part of my GSoC project is the decoder itself.
> 
> Refers to 14496-3, subpart 11.
> 


Some small things I missed when reviewing on ffmpeg-soc.

> +/** Computes ceil(log2(x)) using av_log2.
> + */
> +static inline int ceil_log2(int x) {
> +    return x > 0 ? av_log2((x - 1) << 1) : 0;
> +}


That can be x > 1 since the result for x=1 is 0.

> +
> +        // read all residuals
> +        // TODO: decode directly into ctx->raw_samples[] instead of storing the residuals
> +        if (sconf->bgmc_mode) {
> +            // TODO: BGMC mode
> +        } else {
> +            int64_t *current_res = raw_samples;
> +
> +            for (sb = 0; sb < sub_blocks; sb++) {
> +                for (k = start; k < sb_length; k++) {
> +                    current_res[k] = decode_rice(gb, s[sb]);
> +                }
> +                current_res += sb_length;
> +                start = 0;
> +            }
> +         }


It seems you already decode the residuals directly into raw_samples, so
that TODO can be removed?

-Justin



More information about the ffmpeg-devel mailing list