Mercurial > libavcodec.hg
comparison mpeg12.c @ 1697:f3287b5d8d9f libavcodec
vbv_delay
author | michael |
---|---|
date | Wed, 17 Dec 2003 19:53:05 +0000 |
parents | c4a4c28cc556 |
children | 3ba5c493db6f |
comparison
equal
deleted
inserted
replaced
1696:f5af91b8be17 | 1697:f3287b5d8d9f |
---|---|
406 put_bits(&s->pb, 10, (s->picture_number - | 406 put_bits(&s->pb, 10, (s->picture_number - |
407 s->gop_picture_number) & 0x3ff); | 407 s->gop_picture_number) & 0x3ff); |
408 s->fake_picture_number++; | 408 s->fake_picture_number++; |
409 | 409 |
410 put_bits(&s->pb, 3, s->pict_type); | 410 put_bits(&s->pb, 3, s->pict_type); |
411 put_bits(&s->pb, 16, 0xffff); /* non constant bit rate */ | 411 |
412 s->vbv_delay_ptr= s->pb.buf + get_bit_count(&s->pb)/8; | |
413 put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */ | |
412 | 414 |
413 // RAL: Forward f_code also needed for B frames | 415 // RAL: Forward f_code also needed for B frames |
414 if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) { | 416 if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) { |
415 put_bits(&s->pb, 1, 0); /* half pel coordinates */ | 417 put_bits(&s->pb, 1, 0); /* half pel coordinates */ |
416 if(s->codec_id == CODEC_ID_MPEG1VIDEO) | 418 if(s->codec_id == CODEC_ID_MPEG1VIDEO) |
1756 static int mpeg1_decode_picture(AVCodecContext *avctx, | 1758 static int mpeg1_decode_picture(AVCodecContext *avctx, |
1757 uint8_t *buf, int buf_size) | 1759 uint8_t *buf, int buf_size) |
1758 { | 1760 { |
1759 Mpeg1Context *s1 = avctx->priv_data; | 1761 Mpeg1Context *s1 = avctx->priv_data; |
1760 MpegEncContext *s = &s1->mpeg_enc_ctx; | 1762 MpegEncContext *s = &s1->mpeg_enc_ctx; |
1761 int ref, f_code; | 1763 int ref, f_code, vbv_delay; |
1762 | 1764 |
1763 init_get_bits(&s->gb, buf, buf_size*8); | 1765 init_get_bits(&s->gb, buf, buf_size*8); |
1764 | 1766 |
1765 ref = get_bits(&s->gb, 10); /* temporal ref */ | 1767 ref = get_bits(&s->gb, 10); /* temporal ref */ |
1766 s->pict_type = get_bits(&s->gb, 3); | 1768 s->pict_type = get_bits(&s->gb, 3); |
1767 dprintf("pict_type=%d number=%d\n", s->pict_type, s->picture_number); | 1769 dprintf("pict_type=%d number=%d\n", s->pict_type, s->picture_number); |
1768 | 1770 |
1769 skip_bits(&s->gb, 16); | 1771 vbv_delay= get_bits(&s->gb, 16); |
1770 if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) { | 1772 if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) { |
1771 s->full_pel[0] = get_bits1(&s->gb); | 1773 s->full_pel[0] = get_bits1(&s->gb); |
1772 f_code = get_bits(&s->gb, 3); | 1774 f_code = get_bits(&s->gb, 3); |
1773 if (f_code == 0) | 1775 if (f_code == 0) |
1774 return -1; | 1776 return -1; |