Revision cd2769c1 libavcodec/vp56.h

View differences:

libavcodec/vp56.h
214 214

  
215 215
#ifndef vp56_rac_get_prob
216 216
#define vp56_rac_get_prob vp56_rac_get_prob
217
static inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
217
static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
218 218
{
219 219
    unsigned int code_word = vp56_rac_renorm(c);
220 220
    unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
......
246 246
    return 0;
247 247
}
248 248

  
249
static inline int vp56_rac_get(VP56RangeCoder *c)
249
static av_always_inline int vp56_rac_get(VP56RangeCoder *c)
250 250
{
251 251
    unsigned int code_word = vp56_rac_renorm(c);
252 252
    /* equiprobable */
......
265 265
}
266 266

  
267 267
// rounding is different than vp56_rac_get, is vp56_rac_get wrong?
268
static inline int vp8_rac_get(VP56RangeCoder *c)
268
static av_always_inline int vp8_rac_get(VP56RangeCoder *c)
269 269
{
270 270
    return vp56_rac_get_prob(c, 128);
271 271
}
272 272

  
273
static inline int vp56_rac_gets(VP56RangeCoder *c, int bits)
273
static int vp56_rac_gets(VP56RangeCoder *c, int bits)
274 274
{
275 275
    int value = 0;
276 276

  
......
281 281
    return value;
282 282
}
283 283

  
284
static inline int vp8_rac_get_uint(VP56RangeCoder *c, int bits)
284
static int vp8_rac_get_uint(VP56RangeCoder *c, int bits)
285 285
{
286 286
    int value = 0;
287 287

  
......
293 293
}
294 294

  
295 295
// fixme: add 1 bit to all the calls to this?
296
static inline int vp8_rac_get_sint(VP56RangeCoder *c, int bits)
296
static int vp8_rac_get_sint(VP56RangeCoder *c, int bits)
297 297
{
298 298
    int v;
299 299

  
......
309 309
}
310 310

  
311 311
// P(7)
312
static inline int vp56_rac_gets_nn(VP56RangeCoder *c, int bits)
312
static int vp56_rac_gets_nn(VP56RangeCoder *c, int bits)
313 313
{
314 314
    int v = vp56_rac_gets(c, 7) << 1;
315 315
    return v + !v;
316 316
}
317 317

  
318
static inline int vp8_rac_get_nn(VP56RangeCoder *c)
318
static int vp8_rac_get_nn(VP56RangeCoder *c)
319 319
{
320 320
    int v = vp8_rac_get_uint(c, 7) << 1;
321 321
    return v + !v;
322 322
}
323 323

  
324
static inline int vp56_rac_get_tree(VP56RangeCoder *c,
325
                                    const VP56Tree *tree,
326
                                    const uint8_t *probs)
324
static av_always_inline
325
int vp56_rac_get_tree(VP56RangeCoder *c,
326
                      const VP56Tree *tree,
327
                      const uint8_t *probs)
327 328
{
328 329
    while (tree->val > 0) {
329 330
        if (vp56_rac_get_prob(c, probs[tree->prob_idx]))
......
339 340
 * on a node other than the root node, needed for coeff decode where this is
340 341
 * used to save a bit after a 0 token (by disallowing EOB to immediately follow.)
341 342
 */
342
static inline int vp8_rac_get_tree_with_offset(VP56RangeCoder *c, const int8_t (*tree)[2],
343
                                               const uint8_t *probs, int i)
343
static av_always_inline
344
int vp8_rac_get_tree_with_offset(VP56RangeCoder *c, const int8_t (*tree)[2],
345
                                 const uint8_t *probs, int i)
344 346
{
345 347
    do {
346 348
        i = tree[i][vp56_rac_get_prob(c, probs[i])];
......
351 353

  
352 354
// how probabilities are associated with decisions is different I think
353 355
// well, the new scheme fits in the old but this way has one fewer branches per decision
354
static inline int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t (*tree)[2],
355
                                   const uint8_t *probs)
356
static av_always_inline
357
int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t (*tree)[2],
358
                     const uint8_t *probs)
356 359
{
357 360
    return vp8_rac_get_tree_with_offset(c, tree, probs, 0);
358 361
}
359 362

  
360 363
// DCTextra
361
static inline int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob)
364
static av_always_inline int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob)
362 365
{
363 366
    int v = 0;
364 367

  

Also available in: Unified diff