40 #define VP6_MAX_HUFF_SIZE 12
48 int parse_filter_info = 0;
54 int separated_coeff = buf[0] & 1;
60 sub_version = buf[1] >> 3;
69 coeff_offset =
AV_RB16(buf+2) - 2;
107 coeff_offset =
AV_RB16(buf+1) - 2;
123 if (parse_filter_info) {
144 buf_size -= coeff_offset;
170 for (pos=1; pos<64; pos++)
199 for (comp=0; comp<2; comp++) {
206 for (comp=0; comp<2; comp++)
207 for (node=0; node<7; node++)
211 for (comp=0; comp<2; comp++)
212 for (node=0; node<8; node++)
220 const Node *
a = va, *
b = vb;
221 return (a->
count - b->count)*16 + (b->sym - a->
sym);
232 for (i=0; i<size-1; i++) {
233 a = tmp[i].
count * coeff_model[i] >> 8;
234 b = tmp[i].
count * (255 - coeff_model[i]) >> 8;
235 nodes[map[2*i ]].
count = a + !
a;
236 nodes[map[2*i+1]].
count = b + !
b;
250 int node, cg, ctx, pos;
254 memset(def_prob, 0x80,
sizeof(def_prob));
256 for (pt=0; pt<2; pt++)
257 for (node=0; node<11; node++)
266 for (pos=1; pos<64; pos++)
272 for (cg=0; cg<2; cg++)
273 for (node=0; node<14; node++)
277 for (ct=0; ct<3; ct++)
278 for (pt=0; pt<2; pt++)
279 for (cg=0; cg<6; cg++)
280 for (node=0; node<11; node++)
289 for (pt=0; pt<2; pt++) {
296 for (ct=0; ct<3; ct++)
297 for (cg = 0; cg < 6; cg++)
306 for (pt=0; pt<2; pt++)
307 for (ctx=0; ctx<3; ctx++)
308 for (node=0; node<5; node++)
324 for (comp=0; comp<2; comp++) {
328 static const uint8_t prob_order[] = {0, 1, 2, 7, 6, 5, 4};
329 for (i=0; i<
sizeof(prob_order); i++) {
330 int j = prob_order[i];
373 int coeff, sign, coeff_idx;
377 for (b=0; b<6; b++) {
382 for (coeff_idx = 0;;) {
384 if (coeff_idx<2 && s->nb_null[coeff_idx][pt]) {
394 int pt = (coeff_idx >= 6);
401 }
else if (coeff == 11) {
408 coeff2 +=
get_bits(&s->
gb, coeff <= 9 ? coeff - 4 : 11);
409 ct = 1 + (coeff2 > 1);
411 coeff2 = (coeff2 ^ -sign) + sign;
432 uint8_t *model1, *model2, *model3;
433 int coeff, sign, coeff_idx;
434 int b, i, cg, idx, ctx;
437 for (b=0; b<6; b++) {
470 coeff = (coeff ^ -sign) + sign;
486 for (run=9, i=0; i<6; i++)
504 int sum = 0, square_sum = 0;
507 for (y=0; y<8; y+=2) {
508 for (x=0; x<8; x+=2) {
510 square_sum += src[x]*src[x];
514 return (16*square_sum - sum*sum) >> 8;
518 int delta,
const int16_t *weights)
522 for (y=0; y<8; y++) {
523 for (x=0; x<8; x++) {
524 dst[x] = av_clip_uint8(( src[x-delta ] * weights[0]
525 + src[x ] * weights[1]
526 + src[x+delta ] * weights[2]
527 + src[x+2*delta] * weights[3] + 64) >> 7);
535 int stride,
int h_weight,
int v_weight)
543 int offset1,
int offset2,
int stride,
547 int x8 = mv.
x &
mask;
548 int y8 = mv.
y &
mask;
567 if ((y8 && (offset2-offset1)*s->
flip<0) || (!y8 && offset1 > offset2)) {
609 for (i = 0; i < 6; ++i)
650 for (pt=0; pt<2; pt++) {
653 for (ct=0; ct<3; ct++)
654 for (cg=0; cg<6; cg++)