Ticket #6210: patchsheerAYbR.diff

File patchsheerAYbR.diff, 1.4 KB (added by Carl Eugen Hoyos, 9 years ago)
  • libavcodec/sheervideo.c

    diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c
    index e8f008b..9d2da7f 100644
    a b static void decode_aybri(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)  
    21852185            dst_v[x] = get_bits(gb, 8);
    21862186        }
    21872187    } else {
    2188         int pred[4] = { 125, 125, -128, -128 };
     2188        int pred[4] = { 125, s->alt ? 125 : -146, -128, -128 };
    21892189
    21902190        for (x = 0; x < avctx->width; x++) {
    21912191            int a, y, u, v;
    static void decode_aybr(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)  
    22632263            dst_v[x] = get_bits(gb, 8);
    22642264        }
    22652265    } else {
    2266         int pred[4] = { 125, 125, -128, -128 };
     2266        int pred[4] = { 125, s->alt ? 125 : -146, -128, -128 };
    22672267
    22682268        for (x = 0; x < avctx->width; x++) {
    22692269            int a, y, u, v;
    static int decode_frame(AVCodecContext *avctx,  
    29592959        }
    29602960        break;
    29612961    case MKTAG('A', 'Y', 'B', 'R'):
     2962        s->alt = 1;
    29622963    case MKTAG('A', 'Y', 'b', 'R'):
    29632964        avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
    29642965        s->decode_frame = decode_aybr;
    static int decode_frame(AVCodecContext *avctx,  
    29682969        }
    29692970        break;
    29702971    case MKTAG('A', 'y', 'B', 'R'):
     2972        s->alt = 1;
    29712973    case MKTAG('A', 'y', 'b', 'R'):
    29722974        avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
    29732975        s->decode_frame = decode_aybri;