~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/vp5.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * @file
3
 
 * VP5 compatible video decoder
4
 
 *
 
1
/*
5
2
 * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>
6
3
 *
7
4
 * This file is part of Libav.
21
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
19
 */
23
20
 
 
21
/**
 
22
 * @file
 
23
 * VP5 compatible video decoder
 
24
 */
 
25
 
24
26
#include <stdlib.h>
25
27
#include <string.h>
26
28
 
116
118
                model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
117
119
}
118
120
 
119
 
static void vp5_parse_coeff_models(VP56Context *s)
 
121
static int vp5_parse_coeff_models(VP56Context *s)
120
122
{
121
123
    VP56RangeCoder *c = &s->c;
122
124
    VP56Model *model = s->modelp;
160
162
                for (ctx=0; ctx<6; ctx++)
161
163
                    for (node=0; node<5; node++)
162
164
                        model->coeff_acct[pt][ct][cg][ctx][node] = av_clip(((model->coeff_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
 
165
    return 0;
163
166
}
164
167
 
165
168
static void vp5_parse_coeff(VP56Context *s)
182
185
        model1 = model->coeff_dccv[pt];
183
186
        model2 = model->coeff_dcct[pt][ctx];
184
187
 
185
 
        for (coeff_idx=0; coeff_idx<64; ) {
 
188
        coeff_idx = 0;
 
189
        for (;;) {
186
190
            if (vp56_rac_get_prob(c, model2[0])) {
187
191
                if (vp56_rac_get_prob(c, model2[2])) {
188
192
                    if (vp56_rac_get_prob(c, model2[3])) {
219
223
                ct = 0;
220
224
                s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 0;
221
225
            }
 
226
            coeff_idx++;
 
227
            if (coeff_idx >= 64)
 
228
                break;
222
229
 
223
 
            cg = vp5_coeff_groups[++coeff_idx];
 
230
            cg = vp5_coeff_groups[coeff_idx];
224
231
            ctx = s->coeff_ctx[vp56_b6to4[b]][coeff_idx];
225
232
            model1 = model->coeff_ract[pt][ct][cg];
226
233
            model2 = cg > 2 ? model1 : model->coeff_acct[pt][ct][cg][ctx];
267
274
}
268
275
 
269
276
AVCodec ff_vp5_decoder = {
270
 
    "vp5",
271
 
    AVMEDIA_TYPE_VIDEO,
272
 
    CODEC_ID_VP5,
273
 
    sizeof(VP56Context),
274
 
    vp5_decode_init,
275
 
    NULL,
276
 
    ff_vp56_free,
277
 
    ff_vp56_decode_frame,
278
 
    CODEC_CAP_DR1,
 
277
    .name           = "vp5",
 
278
    .type           = AVMEDIA_TYPE_VIDEO,
 
279
    .id             = CODEC_ID_VP5,
 
280
    .priv_data_size = sizeof(VP56Context),
 
281
    .init           = vp5_decode_init,
 
282
    .close          = ff_vp56_free,
 
283
    .decode         = ff_vp56_decode_frame,
 
284
    .capabilities   = CODEC_CAP_DR1,
279
285
    .long_name = NULL_IF_CONFIG_SMALL("On2 VP5"),
280
286
};