Ticket #676: patchticket676.diff

File patchticket676.diff, 2.6 KB (added by Carl Eugen Hoyos, 15 years ago)
  • libavcodec/interplayvideo.c

    diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
    index c8aa8bf..45f2f85 100644
    a b typedef struct IpvideoContext {  
    6868    int line_inc;
    6969    int stride;
    7070    int upper_motion_limit_offset;
     71    int width, height;
    7172
    7273    uint32_t pal[256];
    7374} IpvideoContext;
    static void ipvideo_decode_opcodes(IpvideoContext *s)  
    975976        s->mv_end = s->buf + s->size;
    976977    }
    977978    s->line_inc = s->stride - 8;
    978     s->upper_motion_limit_offset = (s->avctx->height - 8) * s->current_frame.linesize[0]
    979                                   + (s->avctx->width - 8) * (1 + s->is_16bpp);
     979    s->upper_motion_limit_offset = (s->height - 8) * s->current_frame.linesize[0]
     980                                  + (s->width - 8) * (1 + s->is_16bpp);
    980981
    981982    init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8);
    982     for (y = 0; y < s->avctx->height; y += 8) {
    983         for (x = 0; x < s->avctx->width; x += 8) {
     983    for (y = 0; y < s->height; y += 8) {
     984        for (x = 0; x < s->width; x += 8) {
    984985            opcode = get_bits(&gb, 4);
    985986
    986987            av_dlog(NULL, "  block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
    static av_cold int ipvideo_decode_init(AVCodecContext *avctx)  
    10191020
    10201021    dsputil_init(&s->dsp, avctx);
    10211022
     1023    s->width = avctx->width;
     1024    s->height = avctx->height;
     1025
    10221026    /* decoding map contains 4 bits of information per 8x8 block */
    10231027    s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
    10241028
    static int ipvideo_decode_frame(AVCodecContext *avctx,  
    10571061    if (!s->is_16bpp) {
    10581062        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
    10591063        if (pal) {
     1064            s->decoding_map_size = s->avctx->width * s->avctx->height / (8 * 8 * 2);
     1065            s->width = s->avctx->width;
     1066            s->height = s->avctx->height;
    10601067            s->current_frame.palette_has_changed = 1;
    10611068            memcpy(s->pal, pal, AVPALETTE_SIZE);
    10621069        }
  • libavformat/ipmovie.c

    diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
    index 562b19a..2fa8cb0 100644
    a b static int ipmovie_read_packet(AVFormatContext *s,  
    601601    int ret;
    602602
    603603    ret = process_ipmovie_chunk(ipmovie, pb, pkt);
     604    s->streams[0]->codec->width = ipmovie->video_width;
     605    s->streams[0]->codec->height = ipmovie->video_height;
     606//    s->streams[0]->codec->bits_per_coded_sample = ipmovie->video_bpp;
    604607    if (ret == CHUNK_BAD)
    605608        ret = AVERROR_INVALIDDATA;
    606609    else if (ret == CHUNK_EOF)