Mercurial > libavcodec.hg
comparison mpeg12.c @ 925:7fccaa0d699d libavcodec
AVVideoFrame -> AVFrame
author | michaelni |
---|---|
date | Mon, 09 Dec 2002 12:03:43 +0000 |
parents | 3814e9115672 |
children | 6bcb214d6a17 |
comparison
equal
deleted
inserted
replaced
924:3814e9115672 | 925:7fccaa0d699d |
---|---|
1593 * DECODE_SLICE_ERROR if the slice is damaged<br> | 1593 * DECODE_SLICE_ERROR if the slice is damaged<br> |
1594 * DECODE_SLICE_OK if this slice is ok<br> | 1594 * DECODE_SLICE_OK if this slice is ok<br> |
1595 * DECODE_SLICE_EOP if the end of the picture is reached | 1595 * DECODE_SLICE_EOP if the end of the picture is reached |
1596 */ | 1596 */ |
1597 static int mpeg_decode_slice(AVCodecContext *avctx, | 1597 static int mpeg_decode_slice(AVCodecContext *avctx, |
1598 AVVideoFrame *pict, | 1598 AVFrame *pict, |
1599 int start_code, | 1599 int start_code, |
1600 UINT8 *buf, int buf_size) | 1600 UINT8 *buf, int buf_size) |
1601 { | 1601 { |
1602 Mpeg1Context *s1 = avctx->priv_data; | 1602 Mpeg1Context *s1 = avctx->priv_data; |
1603 MpegEncContext *s = &s1->mpeg_enc_ctx; | 1603 MpegEncContext *s = &s1->mpeg_enc_ctx; |
1701 s->qscale >>=1; | 1701 s->qscale >>=1; |
1702 | 1702 |
1703 MPV_frame_end(s); | 1703 MPV_frame_end(s); |
1704 | 1704 |
1705 if (s->pict_type == B_TYPE || s->low_delay) { | 1705 if (s->pict_type == B_TYPE || s->low_delay) { |
1706 *pict= *(AVVideoFrame*)&s->current_picture; | 1706 *pict= *(AVFrame*)&s->current_picture; |
1707 } else { | 1707 } else { |
1708 s->picture_number++; | 1708 s->picture_number++; |
1709 /* latency of 1 frame for I and P frames */ | 1709 /* latency of 1 frame for I and P frames */ |
1710 /* XXX: use another variable than picture_number */ | 1710 /* XXX: use another variable than picture_number */ |
1711 if (s->picture_number == 1) { | 1711 if (s->picture_number == 1) { |
1712 return DECODE_SLICE_OK; | 1712 return DECODE_SLICE_OK; |
1713 } else { | 1713 } else { |
1714 *pict= *(AVVideoFrame*)&s->last_picture; | 1714 *pict= *(AVFrame*)&s->last_picture; |
1715 } | 1715 } |
1716 } | 1716 } |
1717 return DECODE_SLICE_EOP; | 1717 return DECODE_SLICE_EOP; |
1718 } else { | 1718 } else { |
1719 return DECODE_SLICE_OK; | 1719 return DECODE_SLICE_OK; |
1837 UINT8 *buf, int buf_size) | 1837 UINT8 *buf, int buf_size) |
1838 { | 1838 { |
1839 Mpeg1Context *s = avctx->priv_data; | 1839 Mpeg1Context *s = avctx->priv_data; |
1840 UINT8 *buf_end, *buf_ptr, *buf_start; | 1840 UINT8 *buf_end, *buf_ptr, *buf_start; |
1841 int len, start_code_found, ret, code, start_code, input_size; | 1841 int len, start_code_found, ret, code, start_code, input_size; |
1842 AVVideoFrame *picture = data; | 1842 AVFrame *picture = data; |
1843 MpegEncContext *s2 = &s->mpeg_enc_ctx; | 1843 MpegEncContext *s2 = &s->mpeg_enc_ctx; |
1844 | 1844 |
1845 dprintf("fill_buffer\n"); | 1845 dprintf("fill_buffer\n"); |
1846 | 1846 |
1847 *data_size = 0; | 1847 *data_size = 0; |
1848 | 1848 |
1849 /* special case for last picture */ | 1849 /* special case for last picture */ |
1850 if (buf_size == 0) { | 1850 if (buf_size == 0) { |
1851 if (s2->picture_number > 0) { | 1851 if (s2->picture_number > 0) { |
1852 *picture= *(AVVideoFrame*)&s2->next_picture; | 1852 *picture= *(AVFrame*)&s2->next_picture; |
1853 | 1853 |
1854 *data_size = sizeof(AVVideoFrame); | 1854 *data_size = sizeof(AVFrame); |
1855 } | 1855 } |
1856 return 0; | 1856 return 0; |
1857 } | 1857 } |
1858 | 1858 |
1859 buf_ptr = buf; | 1859 buf_ptr = buf; |