From ee3e36315e25d74da1079b4bafe3fd36fc9f3406 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 24 Feb 2009 16:12:47 +0000 Subject: Add ff_h263_find_resync_marker() to find the bit position of the next resync_marker, if any. patch by Gwenole Beauchesne gbeauchesne splitted-desktopcom based on suggested implementation by me Originally committed as revision 17560 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h263.c | 21 +++++++++++++++++++++ libavcodec/mpegvideo.h | 1 + 2 files changed, 22 insertions(+) diff --git a/libavcodec/h263.c b/libavcodec/h263.c index b02b0ad2f4..2a25cdae67 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -3292,6 +3292,27 @@ void ff_mpeg4_clean_buffers(MpegEncContext *s) s->last_mv[1][0][1]= 0; } +/** + * finds the next resync_marker + * @param p pointer to buffer to scan + * @param end pointer to the end of the buffer + * @return pointer to the next resync_marker, or \p end if none was found + */ +const uint8_t *ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t * restrict end) +{ + assert(p < end); + + end-=2; + p++; + for(;p