comparison vp6.c @ 11665:85ee3d14b906 libavcodec

VP56: move vp56_edge_filter to new VP56DSPContext Using macro templates allows the vp[56]_adjust functions to be inlined instead of called through function pointers. The new function pointers enable optimised implementations of the filters. 4% faster VP6 decoding on Cortex-A8.
author mru
date Fri, 30 Apr 2010 21:30:22 +0000
parents 7dd2a45249a9
children 3f5b35e5f4de
comparison
equal deleted inserted replaced
11664:3da317f52661 11665:85ee3d14b906
479 s->left_block[vp56_b6to4[b]].not_null_dc = 479 s->left_block[vp56_b6to4[b]].not_null_dc =
480 s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0]; 480 s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];
481 } 481 }
482 } 482 }
483 483
484 static int vp6_adjust(int v, int t)
485 {
486 int V = v, s = v >> 31;
487 V ^= s;
488 V -= s;
489 if (V-t-1 >= (unsigned)(t-1))
490 return v;
491 V = 2*t - V;
492 V += s;
493 V ^= s;
494 return V;
495 }
496
497 static int vp6_block_variance(uint8_t *src, int stride) 484 static int vp6_block_variance(uint8_t *src, int stride)
498 { 485 {
499 int sum = 0, square_sum = 0; 486 int sum = 0, square_sum = 0;
500 int y, x; 487 int y, x;
501 488
590 577
591 vp56_init(avctx, avctx->codec->id == CODEC_ID_VP6, 578 vp56_init(avctx, avctx->codec->id == CODEC_ID_VP6,
592 avctx->codec->id == CODEC_ID_VP6A); 579 avctx->codec->id == CODEC_ID_VP6A);
593 s->vp56_coord_div = vp6_coord_div; 580 s->vp56_coord_div = vp6_coord_div;
594 s->parse_vector_adjustment = vp6_parse_vector_adjustment; 581 s->parse_vector_adjustment = vp6_parse_vector_adjustment;
595 s->adjust = vp6_adjust;
596 s->filter = vp6_filter; 582 s->filter = vp6_filter;
597 s->default_models_init = vp6_default_models_init; 583 s->default_models_init = vp6_default_models_init;
598 s->parse_vector_models = vp6_parse_vector_models; 584 s->parse_vector_models = vp6_parse_vector_models;
599 s->parse_coeff_models = vp6_parse_coeff_models; 585 s->parse_coeff_models = vp6_parse_coeff_models;
600 s->parse_header = vp6_parse_header; 586 s->parse_header = vp6_parse_header;