| 1448 | } |
| 1449 | |
| 1450 | static av_always_inline void predict_slice(SnowContext *s, IDWTELEM *buf, int plane_index, int add, int mb_y){ |
| 1451 | Plane *p= &s->plane[plane_index]; |
| 1452 | const int mb_w= s->b_width << s->block_max_depth; |
| 1453 | const int mb_h= s->b_height << s->block_max_depth; |
| 1454 | int x, y, mb_x; |
| 1455 | int block_size = MB_SIZE >> s->block_max_depth; |
| 1456 | int block_w = plane_index ? block_size/2 : block_size; |
| 1457 | const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth]; |
| 1458 | const int obmc_stride= plane_index ? block_size : 2*block_size; |
| 1459 | int ref_stride= s->current_picture.linesize[plane_index]; |
| 1460 | uint8_t *dst8= s->current_picture.data[plane_index]; |
| 1461 | int w= p->width; |
| 1462 | int h= p->height; |
| 1463 | |
| 1464 | if(s->keyframe || (s->avctx->debug&512)){ |
| 1465 | if(mb_y==mb_h) |
| 1466 | return; |
| 1467 | |
| 1468 | if(add){ |
| 1469 | for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++){ |
| 1470 | for(x=0; x<w; x++){ |
| 1471 | int v= buf[x + y*w] + (128<<FRAC_BITS) + (1<<(FRAC_BITS-1)); |
| 1472 | v >>= FRAC_BITS; |
| 1473 | if(v&(~255)) v= ~(v>>31); |
| 1474 | dst8[x + y*ref_stride]= v; |
| 1475 | } |
| 1476 | } |
| 1477 | }else{ |
| 1478 | for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++){ |
| 1479 | for(x=0; x<w; x++){ |
| 1480 | buf[x + y*w]-= 128<<FRAC_BITS; |
| 1481 | } |
| 1482 | } |
| 1483 | } |
| 1484 | |
| 1485 | return; |
| 1486 | } |
| 1487 | |
| 1488 | for(mb_x=0; mb_x<=mb_w; mb_x++){ |
| 1489 | add_yblock(s, 0, NULL, buf, dst8, obmc, |
| 1490 | block_w*mb_x - block_w/2, |
| 1491 | block_w*mb_y - block_w/2, |
| 1492 | block_w, block_w, |
| 1493 | w, h, |
| 1494 | w, ref_stride, obmc_stride, |
| 1495 | mb_x - 1, mb_y - 1, |
| 1496 | add, 1, plane_index); |
| 1497 | } |
| 1498 | } |
| 1499 | |
| 1500 | static av_always_inline void predict_plane(SnowContext *s, IDWTELEM *buf, int plane_index, int add){ |
| 1501 | const int mb_h= s->b_height << s->block_max_depth; |
no test coverage detected