Revision 598401ce libavcodec/ffv1.c

View differences:

libavcodec/ffv1.c
364 364
    return ret;
365 365
}
366 366

  
367
static always_inline void encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
367
static inline void encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
368 368
    PlaneContext * const p= &s->plane[plane_index];
369 369
    CABACContext * const c= &s->c;
370 370
    int x;
......
375 375
    for(x=0; x<w; x++){
376 376
        int diff, context;
377 377
        
378
        context= get_context(s, sample[1]+x, sample[0]+x, sample[1]+x);
378
        context= get_context(s, sample[1]+x, sample[0]+x, sample[2]+x);
379 379
        diff= sample[1][x] - predict(sample[1]+x, sample[0]+x);
380 380

  
381 381
        if(context < 0){
......
430 430

  
431 431
static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
432 432
    int x,y;
433
    int_fast16_t sample_buffer[2][w+6];
434
    int_fast16_t *sample[2]= {sample_buffer[0]+3, sample_buffer[1]+3};
433
    int_fast16_t sample_buffer[3][w+6];
434
    int_fast16_t *sample[3]= {sample_buffer[0]+3, sample_buffer[1]+3, sample_buffer[2]+3};
435 435
    s->run_index=0;
436 436
    
437 437
    memset(sample_buffer, 0, sizeof(sample_buffer));
......
440 440
        int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
441 441

  
442 442
        sample[0]= sample[1];
443
        sample[1]= temp;
443
        sample[1]= sample[2];
444
        sample[2]= temp;
444 445
        
445 446
        sample[1][-1]= sample[0][0  ];
446 447
        sample[0][ w]= sample[0][w-1];
......
711 712
    return 0;
712 713
}
713 714

  
714
static always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
715
static inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
715 716
    PlaneContext * const p= &s->plane[plane_index];
716 717
    CABACContext * const c= &s->c;
717 718
    int x;

Also available in: Unified diff