Revision d3ac6ed6 libavcodec/snow.c

View differences:

libavcodec/snow.c
25 25

  
26 26
#include "mpegvideo.h"
27 27

  
28
#include <zlib.h>
29

  
28 30
#undef NDEBUG
29 31
#include <assert.h>
30 32

  
......
3301 3303
    const int b_height= s->b_height << s->block_max_depth;
3302 3304
    const int b_stride= b_width;
3303 3305
    int color[3];
3306
    const int first_crc_pass= 12;
3307
    uint32_t crcs[50];
3304 3308

  
3305 3309
    for(pass=0; pass<50; pass++){
3306 3310
        int change= 0;
......
3435 3439
            }
3436 3440
        }
3437 3441
        av_log(NULL, AV_LOG_ERROR, "pass:%d changed:%d\n", pass, change);
3442

  
3443
        if(pass >= first_crc_pass){
3444
            int i;
3445
            //FIXME can we hash just the blocks that were analysed?
3446
            crcs[pass]= crc32(crc32(0,NULL,0), (void*)s->block, b_stride*b_height*sizeof(BlockNode));
3447
            for(i=pass-1; i>=first_crc_pass; i--){
3448
                if(crcs[i] == crcs[pass]){
3449
                    change= 0;
3450
                    break;
3451
                }
3452
            }
3453
        }
3438 3454
        if(!change)
3439 3455
            break;
3440 3456
    }

Also available in: Unified diff