Revision f66e4f5f libavcodec/snow.c

View differences:

libavcodec/snow.c
1810 1810
static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){
1811 1811
    const int w= b->width;
1812 1812
    int y;
1813
    const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
1813
    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
1814 1814
    int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
1815 1815
    int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
1816 1816
    int new_index = 0;
......
2898 2898
    }
2899 2899
    *b= backup;
2900 2900

  
2901
    return clip(((ab<<LOG2_OBMC_MAX) + aa/2)/aa, 0, 255); //FIXME we shouldnt need cliping
2901
    return av_clip(((ab<<LOG2_OBMC_MAX) + aa/2)/aa, 0, 255); //FIXME we shouldnt need cliping
2902 2902
}
2903 2903

  
2904 2904
static inline int get_block_bits(SnowContext *s, int x, int y, int w){
......
3407 3407
    const int level= b->level;
3408 3408
    const int w= b->width;
3409 3409
    const int h= b->height;
3410
    const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
3410
    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
3411 3411
    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
3412 3412
    int x,y, thres1, thres2;
3413 3413
//    START_TIMER
......
3466 3466

  
3467 3467
static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int start_y, int end_y){
3468 3468
    const int w= b->width;
3469
    const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
3469
    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
3470 3470
    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
3471 3471
    const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
3472 3472
    int x,y;
......
3494 3494
static void dequantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride){
3495 3495
    const int w= b->width;
3496 3496
    const int h= b->height;
3497
    const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
3497
    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
3498 3498
    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
3499 3499
    const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
3500 3500
    int x,y;
......
3869 3869
            const int w= b->width;
3870 3870
            const int h= b->height;
3871 3871
            const int stride= b->stride;
3872
            const int qlog= clip(2*QROOT + b->qlog, 0, QROOT*16);
3872
            const int qlog= av_clip(2*QROOT + b->qlog, 0, QROOT*16);
3873 3873
            const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
3874 3874
            const int qdiv= (1<<16)/qmul;
3875 3875
            int x, y;

Also available in: Unified diff