Revision b538791b libavcodec/snow.c

View differences:

libavcodec/snow.c
393 393

  
394 394
#define LOG2_MB_SIZE 4
395 395
#define MB_SIZE (1<<LOG2_MB_SIZE)
396
#define ENCODER_EXTRA_BITS 4
396 397

  
397 398
typedef struct x_and_coeff{
398 399
    int16_t x;
......
3402 3403
    const int w= b->width;
3403 3404
    const int h= b->height;
3404 3405
    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
3405
    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
3406
    const int qmul= qexp[qlog&(QROOT-1)]<<((qlog>>QSHIFT) + ENCODER_EXTRA_BITS);
3406 3407
    int x,y, thres1, thres2;
3407 3408
//    START_TIMER
3408 3409

  
......
4194 4195
                    s->spatial_dwt_buffer[y*w + x]= (s->spatial_dwt_buffer[y*w + x] + (1<<(FRAC_BITS-1))-1)>>FRAC_BITS;
4195 4196
                }
4196 4197
            }
4198
        }else{
4199
            for(y=0; y<h; y++){
4200
                for(x=0; x<w; x++){
4201
                    s->spatial_dwt_buffer[y*w + x]<<=ENCODER_EXTRA_BITS;
4202
                }
4203
            }
4197 4204
        }
4198 4205

  
4199 4206
        ff_spatial_dwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count);

Also available in: Unified diff