h->previous_mba = h->current_mba;
if(HAS_CBP(h->mtype)){
+ assert(cbp>0);
put_bits(&s->pb,h261_cbp_tab[cbp-1][1],h261_cbp_tab[cbp-1][0]);
}
for(i=0; i<6; i++) {
static VLC h261_mv_vlc;
static VLC h261_cbp_vlc;
-void init_vlc_rl(RLTable *rl, int use_static);
-
static void h261_decode_init_vlc(H261Context *h){
static int done = 0;
}
/* temporal reference */
- s->picture_number = get_bits(&s->gb, 5); /* picture timestamp */
+ i= get_bits(&s->gb, 5); /* picture timestamp */
+ if(i < (s->picture_number&31))
+ i += 32;
+ s->picture_number = (s->picture_number&~31) + i;
+
+ s->avctx->time_base= (AVRational){1001, 30000};
+ s->current_picture.pts= s->picture_number;
+
/* PTYPE starts here */
skip_bits1(&s->gb); /* split screen off */
return -1;
}
+#ifdef CONFIG_H261_PARSER
static int h261_find_frame_end(ParseContext *pc, AVCodecContext* avctx, const uint8_t *buf, int buf_size){
int vop_found, i, j;
uint32_t state;
state= (state<<8) | buf[i];
for(j=0; j<8; j++){
if(((state>>j)&0xFFFFF) == 0x00010){
- i++;
vop_found=1;
break;
}
*poutbuf_size = buf_size;
return next;
}
+#endif
/**
* returns the number of bytes consumed for building the current frame
AVFrame *pict = data;
#ifdef DEBUG
- printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
- printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
+ av_log(avctx, AV_LOG_DEBUG, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
+ av_log(avctx, AV_LOG_DEBUG, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
#endif
s->flags= avctx->flags;
s->flags2= avctx->flags2;
*pict= *(AVFrame*)s->current_picture_ptr;
ff_print_debug_info(s, pict);
- /* Return the Picture timestamp as the frame number */
- /* we substract 1 because it is added on utils.c */
- avctx->frame_number = s->picture_number - 1;
-
*data_size = sizeof(AVFrame);
return get_consumed_bytes(s, buf_size);
MPV_encode_init,
MPV_encode_picture,
MPV_encode_end,
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
};
#endif
CODEC_CAP_DR1,
};
+#ifdef CONFIG_H261_PARSER
AVCodecParser h261_parser = {
{ CODEC_ID_H261 },
sizeof(ParseContext),
h261_parse,
ff_parse_close,
};
+#endif