Mercurial > libavformat.hg
changeset 2338:4a06a51ceb70 libavformat
move lsb2full to common file
author | michael |
---|---|
date | Thu, 09 Aug 2007 18:37:28 +0000 |
parents | be2b786dc550 |
children | 2c8579bcd287 |
files | nut.c nut.h nutdec.c |
diffstat | 3 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/nut.c Thu Aug 09 17:18:59 2007 +0000 +++ b/nut.c Thu Aug 09 18:37:28 2007 +0000 @@ -35,3 +35,10 @@ AV_ROUND_DOWN); } } + +int64_t ff_lsb2full(StreamContext *stream, int64_t lsb){ + int64_t mask = (1<<stream->msb_pts_shift)-1; + int64_t delta= stream->last_pts - mask/2; + return ((lsb - delta)&mask) + delta; +} +
--- a/nut.h Thu Aug 09 17:18:59 2007 +0000 +++ b/nut.h Thu Aug 09 18:37:28 2007 +0000 @@ -94,5 +94,6 @@ unsigned long av_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len); void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val); +int64_t ff_lsb2full(StreamContext *stream, int64_t lsb); #endif /* AVFORMAT_NUT_H */
--- a/nutdec.c Thu Aug 09 17:18:59 2007 +0000 +++ b/nutdec.c Thu Aug 09 18:37:28 2007 +0000 @@ -155,12 +155,6 @@ } } -static int64_t lsb2full(StreamContext *stream, int64_t lsb){ - int64_t mask = (1<<stream->msb_pts_shift)-1; - int64_t delta= stream->last_pts - mask/2; - return ((lsb - delta)&mask) + delta; -} - static int nut_probe(AVProbeData *p){ int i; uint64_t code= 0; @@ -655,7 +649,7 @@ int coded_pts= get_v(bc); //FIXME check last_pts validity? if(coded_pts < (1<<stc->msb_pts_shift)){ - *pts=lsb2full(stc, coded_pts); + *pts=ff_lsb2full(stc, coded_pts); }else *pts=coded_pts - (1<<stc->msb_pts_shift); }else