Mercurial > libavcodec.hg
comparison libamr.c @ 9355:54bc8a2727b0 libavcodec
Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows
passing of packet-specific flags from demuxer to decoder, such as the keyframe
flag, which appears necessary to playback corePNG P-frames.
Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread
"Google Summer of Code participation" on the mailinglist.
author | rbultje |
---|---|
date | Tue, 07 Apr 2009 15:59:50 +0000 |
parents | 043574c5c153 |
children | 93da33bb271e |
comparison
equal
deleted
inserted
replaced
9354:174309386512 | 9355:54bc8a2727b0 |
---|---|
243 return 0; | 243 return 0; |
244 } | 244 } |
245 | 245 |
246 static int amr_nb_decode_frame(AVCodecContext * avctx, | 246 static int amr_nb_decode_frame(AVCodecContext * avctx, |
247 void *data, int *data_size, | 247 void *data, int *data_size, |
248 const uint8_t * buf, int buf_size) | 248 AVPacket *avpkt) |
249 { | 249 { |
250 const uint8_t *buf = avpkt->data; | |
251 int buf_size = avpkt->size; | |
250 AMRContext *s = avctx->priv_data; | 252 AMRContext *s = avctx->priv_data; |
251 const uint8_t*amrData=buf; | 253 const uint8_t*amrData=buf; |
252 int offset=0; | 254 int offset=0; |
253 UWord8 toc, q, ft; | 255 UWord8 toc, q, ft; |
254 Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */ | 256 Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */ |
652 return 0; | 654 return 0; |
653 } | 655 } |
654 | 656 |
655 static int amr_wb_decode_frame(AVCodecContext * avctx, | 657 static int amr_wb_decode_frame(AVCodecContext * avctx, |
656 void *data, int *data_size, | 658 void *data, int *data_size, |
657 const uint8_t * buf, int buf_size) | 659 AVPacket *avpkt) |
658 { | 660 { |
661 const uint8_t *buf = avpkt->data; | |
662 int buf_size = avpkt->size; | |
659 AMRWBContext *s = avctx->priv_data; | 663 AMRWBContext *s = avctx->priv_data; |
660 const uint8_t*amrData=buf; | 664 const uint8_t*amrData=buf; |
661 int mode; | 665 int mode; |
662 int packet_size; | 666 int packet_size; |
663 static const uint8_t block_size[16] = {18, 23, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1}; | 667 static const uint8_t block_size[16] = {18, 23, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1}; |