]> git.sesse.net Git - ffmpeg/commitdiff
lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo
authorMartin Storsjö <martin@martin.st>
Mon, 25 Mar 2013 12:11:41 +0000 (14:11 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 26 Mar 2013 07:50:02 +0000 (09:50 +0200)
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/cavsdec.c
libavcodec/h264_parser.c
libavcodec/internal.h
libavcodec/mpeg12.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_parser.c
libavcodec/utils.c
libavformat/mpegtsenc.c
libavformat/rtpenc_mpv.c

index b19f09065d5104d9e98fc4a74ff1d62af170737b..c2c6772134a556ca22debba3fb3c57c67bb19973 100644 (file)
@@ -1135,7 +1135,7 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     buf_ptr = buf;
     buf_end = buf + buf_size;
     for(;;) {
-        buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &stc);
+        buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &stc);
         if ((stc & 0xFFFFFE00) || buf_ptr == buf_end)
             return FFMAX(0, buf_ptr - buf);
         input_size = (buf_end - buf_ptr) * 8;
index 8c84d439d8a5a134f785854207e72dd0ea3a5ed4..3c98c847889e25103aa3457218016da424f87234 100644 (file)
@@ -28,6 +28,7 @@
 #include "parser.h"
 #include "h264data.h"
 #include "golomb.h"
+#include "internal.h"
 
 #include <assert.h>
 
@@ -130,7 +131,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
 
     for(;;) {
         int src_length, dst_length, consumed;
-        buf = avpriv_mpv_find_start_code(buf, buf_end, &state);
+        buf = avpriv_find_start_code(buf, buf_end, &state);
         if(buf >= buf_end)
             break;
         --buf;
index 65437edc548e84a0a8d80453de2d2aed02fdb149..f57bedc8cf275b525b17674ce3c4a2a2c244174b 100644 (file)
@@ -30,6 +30,7 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/pixfmt.h"
 #include "avcodec.h"
+#include "config.h"
 
 #define FF_SANE_NB_CHANNELS 63U
 
@@ -161,4 +162,8 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags);
  */
 int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame);
 
+const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,
+                                      const uint8_t *end,
+                                      uint32_t *restrict state);
+
 #endif /* AVCODEC_INTERNAL_H */
index bd018d377fd358f301b2e2f97998c5baf46a8b26..6008f9c5a00878cbe28ac6f62ad8a047db1a353d 100644 (file)
@@ -1709,7 +1709,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
     if (avctx->hwaccel) {
         const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
         int start_code = -1;
-        buf_end = avpriv_mpv_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
+        buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
         if (buf_end < *buf + buf_size)
             buf_end -= 4;
         s->mb_y = mb_y;
@@ -1901,7 +1901,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
             return 0;
 
         start_code = -1;
-        buf = avpriv_mpv_find_start_code(buf, s->gb.buffer_end, &start_code);
+        buf = avpriv_find_start_code(buf, s->gb.buffer_end, &start_code);
         mb_y= (start_code - SLICE_MIN_START_CODE) << field_pic;
         if (s->picture_structure == PICT_BOTTOM_FIELD)
             mb_y++;
@@ -2185,7 +2185,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size,
             }
             state++;
         } else {
-            i = avpriv_mpv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1;
+            i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1;
             if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) {
                 i++;
                 pc->frame_start_found = 4;
@@ -2229,7 +2229,7 @@ static int decode_chunks(AVCodecContext *avctx,
     for (;;) {
         /* find next start code */
         uint32_t start_code = -1;
-        buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code);
+        buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
         if (start_code > 0x1ff) {
             if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) {
                 if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
index ea08c14fed9ecb222a53d4f4ee92d12b48b9e6e6..893b0ed9a5271f5fdebd1d0aa1c2658aa0c49066 100644 (file)
@@ -800,7 +800,6 @@ int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
 int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);
 void ff_MPV_report_decode_progress(MpegEncContext *s);
 int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
-const uint8_t *avpriv_mpv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
 void ff_set_qscale(MpegEncContext * s, int qscale);
 
 void ff_mpeg_er_frame_start(MpegEncContext *s);
index 051796e0c0d445846bea454844358270808494a7..d215a2fe5aa59b5efd4aba599d453d844176a57d 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "parser.h"
 #include "mpegvideo.h"
+#include "internal.h"
 
 struct MpvParseContext {
     ParseContext pc;
@@ -48,7 +49,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
 
     while (buf < buf_end) {
         start_code= -1;
-        buf= avpriv_mpv_find_start_code(buf, buf_end, &start_code);
+        buf= avpriv_find_start_code(buf, buf_end, &start_code);
         bytes_left = buf_end - buf;
         switch(start_code) {
         case PICTURE_START_CODE:
index d8ebda61dc85c84ffacbfacb3ee42d6072c9d860..e64ca11d66d0f2f065e7417c9de8e3dc5875ccc1 100644 (file)
@@ -39,7 +39,6 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "libavutil/opt.h"
-#include "mpegvideo.h"
 #include "thread.h"
 #include "internal.h"
 #include "bytestream.h"
@@ -2199,9 +2198,9 @@ int avcodec_is_open(AVCodecContext *s)
     return !!s->internal;
 }
 
-const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p,
-                                          const uint8_t *end,
-                                          uint32_t * restrict state)
+const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,
+                                      const uint8_t *end,
+                                      uint32_t * restrict state)
 {
     int i;
 
index 44a5e5b08952e25a3e7be881365069f2511339ee..8efd93ef315c8bd650a905311fb96ab61242c9c9 100644 (file)
 #include "libavutil/bswap.h"
 #include "libavutil/crc.h"
 #include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
-#include "libavcodec/mpegvideo.h"
+#include "libavcodec/internal.h"
 #include "avformat.h"
 #include "internal.h"
 #include "mpegts.h"
@@ -1019,7 +1020,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
         }
 
         do {
-            p = avpriv_mpv_find_start_code(p, buf_end, &state);
+            p = avpriv_find_start_code(p, buf_end, &state);
             av_dlog(s, "nal %d\n", state & 0x1f);
         } while (p < buf_end && (state & 0x1f) != 9 &&
                  (state & 0x1f) != 5 && (state & 0x1f) != 1);
index 37dedc33f57dd98f75fc7051d1ce9fd9654faf65..70248c408addb75e571a9cbee393f34cd2e98ffb 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavcodec/mpegvideo.h"
+#include "libavcodec/internal.h"
 #include "avformat.h"
 #include "rtpenc.h"
 
@@ -56,7 +56,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
             r1 = buf1;
             while (1) {
                 start_code = -1;
-                r = avpriv_mpv_find_start_code(r1, end, &start_code);
+                r = avpriv_find_start_code(r1, end, &start_code);
                 if((start_code & 0xFFFFFF00) == 0x100) {
                     /* New start code found */
                     if (start_code == 0x100) {