mpegvideo: move REBASE_PICTURE where it is used
authorVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 9 Dec 2014 16:47:53 +0000 (16:47 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 15 Dec 2014 14:46:34 +0000 (15:46 +0100)
Drop an unused #undef from h264 decoder.

libavcodec/h264_slice.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

index 42d0c95..9169ff4 100644 (file)
@@ -422,7 +422,7 @@ static void clone_tables(H264Context *dst, H264Context *src, int i)
 }
 
 #define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
-#undef REBASE_PICTURE
+
 #define REBASE_PICTURE(pic, new_ctx, old_ctx)             \
     ((pic && pic >= old_ctx->DPB &&                       \
       pic < old_ctx->DPB + H264_MAX_PICTURE_COUNT) ?          \
index e6a48cd..44cf8c5 100644 (file)
@@ -961,6 +961,11 @@ do {\
     UPDATE_PICTURE(last_picture);
     UPDATE_PICTURE(next_picture);
 
+#define REBASE_PICTURE(pic, new_ctx, old_ctx)                                 \
+    ((pic && pic >= old_ctx->picture &&                                       \
+      pic < old_ctx->picture + MAX_PICTURE_COUNT) ?                           \
+        &new_ctx->picture[pic - old_ctx->picture] : NULL)
+
     s->last_picture_ptr    = REBASE_PICTURE(s1->last_picture_ptr,    s, s1);
     s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1);
     s->next_picture_ptr    = REBASE_PICTURE(s1->next_picture_ptr,    s, s1);
index f1047a0..ac077b3 100644 (file)
@@ -659,11 +659,6 @@ typedef struct MpegEncContext {
     AVFrame *tmp_frames[MAX_B_FRAMES + 2];
 } MpegEncContext;
 
-#define REBASE_PICTURE(pic, new_ctx, old_ctx)             \
-    ((pic && pic >= old_ctx->picture &&                   \
-      pic < old_ctx->picture + MAX_PICTURE_COUNT) ?  \
-        &new_ctx->picture[pic - old_ctx->picture] : NULL)
-
 /* mpegvideo_enc common options */
 #define FF_MPV_FLAG_SKIP_RD      0x0001
 #define FF_MPV_FLAG_STRICT_GOP   0x0002