#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
+#include "bytestream.h"
//#undef NDEBUG
//#include <assert.h>
int i;
for(i=0; i<256; i++){
- f->mv[i] = mv[i][0] + mv[i][1]*f->current_picture.linesize[0]/2;
+ if(f->version)
+ f->mv[i] = mv[i][0] + mv[i][1] *f->current_picture.linesize[0]/2;
+ else
+ f->mv[i] = (i&15) - 8 + ((i>>4)-8)*f->current_picture.linesize[0]/2;
}
}
log2w--;
decode_p_block(f, dst , src , log2w, log2h, stride);
decode_p_block(f, dst + (1<<log2w), src + (1<<log2w), log2w, log2h, stride);
+ }else if(code == 3 && f->version==0){
+ mcdc(dst, src, log2w, h, stride, 1, 0);
}else if(code == 4){
src += f->mv[ *f->bytestream++ ];
mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++));
unsigned int color[4], bits;
memset(color, 0, sizeof(color));
//warning following is purely guessed ...
- color[0]= AV_RN16(buf); buf+=2; //FIXME use bytestream
- color[1]= AV_RN16(buf); buf+=2;
+ color[0]= bytestream_get_le16(&buf);
+ color[1]= bytestream_get_le16(&buf);
if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
color[2]= mix(color[0], color[1]);
color[3]= mix(color[1], color[0]);
- bits= AV_RL32(buf); buf+= 4;
+ bits= bytestream_get_le32(&buf);
for(y2=0; y2<16; y2++){
for(x2=0; x2<16; x2++){
int index= 2*(x2>>2) + 8*(y2>>2);
common_init(avctx);
init_vlcs(f);
- avctx->pix_fmt= PIX_FMT_RGB565;
+ if(f->version) avctx->pix_fmt= PIX_FMT_RGB565;
+ else avctx->pix_fmt= PIX_FMT_RGB555;
return 0;
}