Mercurial > libavcodec.hg
comparison mpeg12.c @ 383:e6b64bc3bc87 libavcodec
- repeat_pict meaning changed, now it signals the extra delay for the
decoded frame.
- extra_delay = (repeat_pict / 2) * (1/fps)
| author | pulento |
|---|---|
| date | Tue, 14 May 2002 19:56:42 +0000 |
| parents | 0d73175fbded |
| children | ddb1be8aa479 |
comparison
equal
deleted
inserted
replaced
| 382:b1663b0ffbbc | 383:e6b64bc3bc87 |
|---|---|
| 1336 s->chroma_420_type = get_bits1(&s->gb); | 1336 s->chroma_420_type = get_bits1(&s->gb); |
| 1337 s->progressive_frame = get_bits1(&s->gb); | 1337 s->progressive_frame = get_bits1(&s->gb); |
| 1338 /* composite display not parsed */ | 1338 /* composite display not parsed */ |
| 1339 dprintf("intra_dc_precision=%d\n", s->intra_dc_precision); | 1339 dprintf("intra_dc_precision=%d\n", s->intra_dc_precision); |
| 1340 dprintf("picture_structure=%d\n", s->picture_structure); | 1340 dprintf("picture_structure=%d\n", s->picture_structure); |
| 1341 dprintf("top field first=%d\n", s->top_field_first); | |
| 1342 dprintf("repeat first field=%d\n", s->repeat_first_field); | |
| 1341 dprintf("conceal=%d\n", s->concealment_motion_vectors); | 1343 dprintf("conceal=%d\n", s->concealment_motion_vectors); |
| 1342 dprintf("intra_vlc_format=%d\n", s->intra_vlc_format); | 1344 dprintf("intra_vlc_format=%d\n", s->intra_vlc_format); |
| 1343 dprintf("alternate_scan=%d\n", s->alternate_scan); | 1345 dprintf("alternate_scan=%d\n", s->alternate_scan); |
| 1344 dprintf("frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct); | 1346 dprintf("frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct); |
| 1345 dprintf("progressive_frame=%d\n", s->progressive_frame); | 1347 dprintf("progressive_frame=%d\n", s->progressive_frame); |
| 1585 return 0; | 1587 return 0; |
| 1586 } | 1588 } |
| 1587 | 1589 |
| 1588 buf_ptr = buf; | 1590 buf_ptr = buf; |
| 1589 buf_end = buf + buf_size; | 1591 buf_end = buf + buf_size; |
| 1590 | 1592 |
| 1591 if (s->repeat_field % 2 == 1 && avctx->repeat_pict) { | 1593 #if 0 |
| 1594 if (s->repeat_field % 2 == 1) { | |
| 1592 s->repeat_field++; | 1595 s->repeat_field++; |
| 1593 //fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number, | 1596 //fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number, |
| 1594 // s2->picture_number, s->repeat_field); | 1597 // s2->picture_number, s->repeat_field); |
| 1595 *data_size = sizeof(AVPicture); | 1598 if (avctx->flags & CODEC_FLAG_REPEAT_FIELD) { |
| 1596 goto the_end; | 1599 *data_size = sizeof(AVPicture); |
| 1597 } | 1600 goto the_end; |
| 1598 | 1601 } |
| 1602 } | |
| 1603 #endif | |
| 1599 while (buf_ptr < buf_end) { | 1604 while (buf_ptr < buf_end) { |
| 1600 buf_start = buf_ptr; | 1605 buf_start = buf_ptr; |
| 1601 /* find start next code */ | 1606 /* find start next code */ |
| 1602 code = find_start_code(&buf_ptr, buf_end, &s->header_state); | 1607 code = find_start_code(&buf_ptr, buf_end, &s->header_state); |
| 1603 if (code >= 0) { | 1608 if (code >= 0) { |
| 1643 ret = mpeg_decode_slice(avctx, picture, | 1648 ret = mpeg_decode_slice(avctx, picture, |
| 1644 start_code, s->buffer, input_size); | 1649 start_code, s->buffer, input_size); |
| 1645 if (ret == 1) { | 1650 if (ret == 1) { |
| 1646 /* got a picture: exit */ | 1651 /* got a picture: exit */ |
| 1647 /* first check if we must repeat the frame */ | 1652 /* first check if we must repeat the frame */ |
| 1653 avctx->repeat_pict = 0; | |
| 1654 #if 0 | |
| 1648 if (s2->progressive_frame && s2->repeat_first_field) { | 1655 if (s2->progressive_frame && s2->repeat_first_field) { |
| 1649 //fprintf(stderr,"\nRepeat this frame: %d! pict: %d",avctx->frame_number,s2->picture_number); | 1656 //fprintf(stderr,"\nRepeat this frame: %d! pict: %d",avctx->frame_number,s2->picture_number); |
| 1650 s2->repeat_first_field = 0; | 1657 //s2->repeat_first_field = 0; |
| 1651 s2->progressive_frame = 0; | 1658 //s2->progressive_frame = 0; |
| 1652 if (++s->repeat_field > 2) | 1659 if (++s->repeat_field > 2) |
| 1653 s->repeat_field = 0; | 1660 s->repeat_field = 0; |
| 1661 avctx->repeat_pict = 1; | |
| 1654 } | 1662 } |
| 1663 #endif | |
| 1664 if (s2->repeat_first_field) { | |
| 1665 if (s2->progressive_sequence) { | |
| 1666 if (s2->top_field_first) | |
| 1667 avctx->repeat_pict = 4; | |
| 1668 else | |
| 1669 avctx->repeat_pict = 2; | |
| 1670 } else if (s2->progressive_frame) { | |
| 1671 avctx->repeat_pict = 1; | |
| 1672 } | |
| 1673 } | |
| 1655 *data_size = sizeof(AVPicture); | 1674 *data_size = sizeof(AVPicture); |
| 1656 goto the_end; | 1675 goto the_end; |
| 1657 } | 1676 } |
| 1658 } | 1677 } |
| 1659 break; | 1678 break; |
