[FFmpeg-devel] [PATCH] ALS decoder

Michael Niedermayer michaelni
Sun Aug 23 23:55:01 CEST 2009


On Sun, Aug 23, 2009 at 11:31:32PM +0200, Thilo Borgmann wrote:
[...]
> >> +/** Reads and decodes a Rice codeword.
> >> + */
> >> +static int64_t decode_rice(GetBitContext *gb, unsigned int k)
> >> +{
> >> +    int     max = gb->size_in_bits - get_bits_count(gb) - k;
> >> +
> >> +    if (k > 1) {
> > [...]
> >> +        q         = get_unary(gb, 0, max);
> > [...]
> >> +    } else {
> >> +        int q;
> >> +        q = get_unary(gb, 0, max);
> > [...]
> > 
> > please factorize this out, also please factorize anything else out
> > if there is something that can be factored out
> I've already had a look at this function looking for things to be
> factored out. If there is anything left, please tell me explicitly. In
> the case of q - it is of different type in the branches. How to factor
> that out?

get_unary() returns int, q is int thats works thus
if later code does 64bit math it could cast explicitly to int64_t and
use a separet 64bit variable if it needs but i think its not needed

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- 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/20090823/f2c22d88/attachment.pgp>



More information about the ffmpeg-devel mailing list