| 1505 | } |
| 1506 | |
| 1507 | static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int start_y, int end_y){ |
| 1508 | const int w= b->width; |
| 1509 | const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16); |
| 1510 | const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); |
| 1511 | const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; |
| 1512 | int x,y; |
| 1513 | |
| 1514 | if(s->qlog == LOSSLESS_QLOG) return; |
| 1515 | |
| 1516 | for(y=start_y; y<end_y; y++){ |
| 1517 | // DWTELEM * line = slice_buffer_get_line_from_address(sb, src + (y * stride)); |
| 1518 | IDWTELEM * line = slice_buffer_get_line(sb, (y * b->stride_line) + b->buf_y_offset) + b->buf_x_offset; |
| 1519 | for(x=0; x<w; x++){ |
| 1520 | int i= line[x]; |
| 1521 | if(i<0){ |
| 1522 | line[x]= -((-i*qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias |
| 1523 | }else if(i>0){ |
| 1524 | line[x]= (( i*qmul + qadd)>>(QEXPSHIFT)); |
| 1525 | } |
| 1526 | } |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){ |
| 1531 | const int w= b->width; |
no test coverage detected