~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libavcodec/golomb.h

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
4
4
 * Copyright (c) 2004 Alex Beregszaszi
5
5
 *
6
 
 * This library is free software; you can redistribute it and/or
 
6
 * This file is part of FFmpeg.
 
7
 *
 
8
 * FFmpeg is free software; you can redistribute it and/or
7
9
 * modify it under the terms of the GNU Lesser General Public
8
10
 * License as published by the Free Software Foundation; either
9
 
 * version 2 of the License, or (at your option) any later version.
 
11
 * version 2.1 of the License, or (at your option) any later version.
10
12
 *
11
 
 * This library is distributed in the hope that it will be useful,
 
13
 * FFmpeg is distributed in the hope that it will be useful,
12
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
16
 * Lesser General Public License for more details.
15
17
 *
16
18
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this library; if not, write to the Free Software
 
19
 * License along with FFmpeg; if not, write to the Free Software
18
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
21
 *
20
22
 */
435
437
 
436
438
    e= (i>>k) + 1;
437
439
    if(e<limit){
 
440
        while(e > 31) {
 
441
            put_bits(pb, 31, 0);
 
442
            e -= 31;
 
443
        }
438
444
        put_bits(pb, e, 1);
439
445
        if(k)
440
446
            put_bits(pb, k, i&((1<<k)-1));
441
447
    }else{
 
448
        while(limit > 31) {
 
449
            put_bits(pb, 31, 0);
 
450
            limit -= 31;
 
451
        }
442
452
        put_bits(pb, limit  , 1);
443
453
        put_bits(pb, esc_len, i - 1);
444
454
    }