Originally committed as revision 24297 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -39,10 +39,10 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, · 38 unmodified lines | |||
| 39 | { | 39 | { |
| 40 | TMVContext *tmv = avctx->priv_data; | 40 | TMVContext *tmv = avctx->priv_data; |
| 41 | const uint8_t *src = avpkt->data; | 41 | const uint8_t *src = avpkt->data; |
| 42 | uint8_t *dst, *dst_char; | 42 | uint8_t *dst; |
| 43 | unsigned char_cols = avctx->width >> 3; | 43 | unsigned char_cols = avctx->width >> 3; |
| 44 | unsigned char_rows = avctx->height >> 3; | 44 | unsigned char_rows = avctx->height >> 3; |
| 45 | unsigned x, y, mask, char_y, fg, bg, c; | 45 | unsigned x, y, fg, bg, c; |
| 46 | 46 | ||
| 47 | if (tmv->pic.data[0]) | 47 | if (tmv->pic.data[0]) |
| 48 | avctx->release_buffer(avctx, &tmv->pic); | 48 | avctx->release_buffer(avctx, &tmv->pic); |
| @@ -68,17 +68,11 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, · 19 unmodified lines | |||
| 68 | 68 | ||
| 69 | for (y = 0; y < char_rows; y++) { | 69 | for (y = 0; y < char_rows; y++) { |
| 70 | for (x = 0; x < char_cols; x++) { | 70 | for (x = 0; x < char_cols; x++) { |
| 71 | c = *src++ * 8; | 71 | c = *src++; |
| 72 | bg = *src >> 4; | 72 | bg = *src >> 4; |
| 73 | fg = *src++ & 0xF; | 73 | fg = *src++ & 0xF; |
| 74 | 74 | ff_draw_pc_font(dst + x * 8, tmv->pic.linesize[0], | |
| 75 | dst_char = dst + x * 8; | 75 | ff_cga_font, 8, c, fg, bg); |
| 76 | for (char_y = 0; char_y < 8; char_y++) { | ||
| 77 | for (mask = 0x80; mask; mask >>= 1) { | ||
| 78 | *dst_char++ = ff_cga_font[c + char_y] & mask ? fg : bg; | ||
| 79 | } | ||
| 80 | dst_char += tmv->pic.linesize[0] - 8; | ||
| 81 | } | ||
| 82 | } | 76 | } |
| 83 | dst += tmv->pic.linesize[0] * 8; | 77 | dst += tmv->pic.linesize[0] * 8; |
| 84 | } | 78 | } |