comparison interplayvideo.c @ 10711:d2c20d24abbd libavcodec

Change main loop in Interplay Video decoder, so variables x and y really mean coordinates, not offsets.
author kostya
date Sun, 27 Dec 2009 08:15:19 +0000
parents 09227c145beb
children 277bf9801257
comparison
equal deleted inserted replaced
10710:923f828d1e2c 10711:d2c20d24abbd
584 s->line_inc = s->stride - 8; 584 s->line_inc = s->stride - 8;
585 s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride 585 s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride
586 + s->avctx->width - 8; 586 + s->avctx->width - 8;
587 587
588 init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8); 588 init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8);
589 for (y = 0; y < (s->stride * s->avctx->height); y += s->stride * 8) { 589 for (y = 0; y < s->avctx->height; y += 8) {
590 for (x = y; x < y + s->avctx->width; x += 8) { 590 for (x = 0; x < s->avctx->width; x += 8) {
591 opcode = get_bits(&gb, 4); 591 opcode = get_bits(&gb, 4);
592 592
593 debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n", 593 debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
594 x - y, y / s->stride, opcode, s->stream_ptr); 594 x, y, opcode, s->stream_ptr);
595 595
596 s->pixel_ptr = s->current_frame.data[0] + x; 596 s->pixel_ptr = s->current_frame.data[0] + x
597 + y*s->current_frame.linesize[0];
597 ret = ipvideo_decode_block[opcode](s); 598 ret = ipvideo_decode_block[opcode](s);
598 if (ret != 0) { 599 if (ret != 0) {
599 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n", 600 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n",
600 frame, x - y, y / s->stride); 601 frame, x, y);
601 return; 602 return;
602 } 603 }
603 } 604 }
604 } 605 }
605 if (s->stream_end - s->stream_ptr > 1) { 606 if (s->stream_end - s->stream_ptr > 1) {