[FFmpeg-cvslog] mpegvideo: reindent

Anton Khirnov git at videolan.org
Wed Mar 13 13:12:03 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Mar  7 16:37:45 2013 +0100| [ee8704916de79158da8a48a9ea5be819e83d23ba] | committer: Anton Khirnov

mpegvideo: reindent

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee8704916de79158da8a48a9ea5be819e83d23ba
---

 libavcodec/mpegvideo.c |  168 ++++++++++++++++++++++++------------------------
 1 file changed, 84 insertions(+), 84 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 1fb7a07..9048179 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1515,26 +1515,26 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
     s->mb_skipped = 0;
 
     /* mark & release old frames */
-        if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
-            s->last_picture_ptr != s->next_picture_ptr &&
-            s->last_picture_ptr->f.data[0]) {
-            ff_mpeg_unref_picture(s, s->last_picture_ptr);
-        }
+    if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
+        s->last_picture_ptr != s->next_picture_ptr &&
+        s->last_picture_ptr->f.data[0]) {
+        ff_mpeg_unref_picture(s, s->last_picture_ptr);
+    }
 
-        /* release forgotten pictures */
-        /* if (mpeg124/h263) */
-        if (!s->encoding) {
-            for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-                if (&s->picture[i] != s->last_picture_ptr &&
-                    &s->picture[i] != s->next_picture_ptr &&
-                    s->picture[i].reference && !s->picture[i].needs_realloc) {
-                    if (!(avctx->active_thread_type & FF_THREAD_FRAME))
-                        av_log(avctx, AV_LOG_ERROR,
-                               "releasing zombie picture\n");
-                    ff_mpeg_unref_picture(s, &s->picture[i]);
-                }
+    /* release forgotten pictures */
+    /* if (mpeg124/h263) */
+    if (!s->encoding) {
+        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
+            if (&s->picture[i] != s->last_picture_ptr &&
+                &s->picture[i] != s->next_picture_ptr &&
+                s->picture[i].reference && !s->picture[i].needs_realloc) {
+                if (!(avctx->active_thread_type & FF_THREAD_FRAME))
+                    av_log(avctx, AV_LOG_ERROR,
+                           "releasing zombie picture\n");
+                ff_mpeg_unref_picture(s, &s->picture[i]);
             }
         }
+    }
 
     if (!s->encoding) {
         ff_release_unused_pictures(s, 1);
@@ -1600,79 +1600,79 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
             s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
             s->pict_type, s->droppable);
 
-        if ((s->last_picture_ptr == NULL ||
-             s->last_picture_ptr->f.data[0] == NULL) &&
-            (s->pict_type != AV_PICTURE_TYPE_I ||
-             s->picture_structure != PICT_FRAME)) {
-            int h_chroma_shift, v_chroma_shift;
-            av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
-                                             &h_chroma_shift, &v_chroma_shift);
-            if (s->pict_type != AV_PICTURE_TYPE_I)
-                av_log(avctx, AV_LOG_ERROR,
-                       "warning: first frame is no keyframe\n");
-            else if (s->picture_structure != PICT_FRAME)
-                av_log(avctx, AV_LOG_INFO,
-                       "allocate dummy last picture for field based first keyframe\n");
-
-            /* Allocate a dummy frame */
-            i = ff_find_unused_picture(s, 0);
-            if (i < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-                return i;
-            }
-            s->last_picture_ptr = &s->picture[i];
-            if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
-                s->last_picture_ptr = NULL;
-                return -1;
-            }
-
-            memset(s->last_picture_ptr->f.data[0], 0,
-                   avctx->height * s->last_picture_ptr->f.linesize[0]);
-            memset(s->last_picture_ptr->f.data[1], 0x80,
-                   (avctx->height >> v_chroma_shift) *
-                   s->last_picture_ptr->f.linesize[1]);
-            memset(s->last_picture_ptr->f.data[2], 0x80,
-                   (avctx->height >> v_chroma_shift) *
-                   s->last_picture_ptr->f.linesize[2]);
-
-            ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0);
-            ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 1);
+    if ((s->last_picture_ptr == NULL ||
+         s->last_picture_ptr->f.data[0] == NULL) &&
+        (s->pict_type != AV_PICTURE_TYPE_I ||
+         s->picture_structure != PICT_FRAME)) {
+        int h_chroma_shift, v_chroma_shift;
+        av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
+                                         &h_chroma_shift, &v_chroma_shift);
+        if (s->pict_type != AV_PICTURE_TYPE_I)
+            av_log(avctx, AV_LOG_ERROR,
+                   "warning: first frame is no keyframe\n");
+        else if (s->picture_structure != PICT_FRAME)
+            av_log(avctx, AV_LOG_INFO,
+                   "allocate dummy last picture for field based first keyframe\n");
+
+        /* Allocate a dummy frame */
+        i = ff_find_unused_picture(s, 0);
+        if (i < 0) {
+            av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
+            return i;
         }
-        if ((s->next_picture_ptr == NULL ||
-             s->next_picture_ptr->f.data[0] == NULL) &&
-            s->pict_type == AV_PICTURE_TYPE_B) {
-            /* Allocate a dummy frame */
-            i = ff_find_unused_picture(s, 0);
-            if (i < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-                return i;
-            }
-            s->next_picture_ptr = &s->picture[i];
-            if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
-                s->next_picture_ptr = NULL;
-                return -1;
-            }
-            ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 0);
-            ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1);
+        s->last_picture_ptr = &s->picture[i];
+        if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
+            s->last_picture_ptr = NULL;
+            return -1;
         }
 
-        if (s->last_picture_ptr) {
-            ff_mpeg_unref_picture(s, &s->last_picture);
-            if (s->last_picture_ptr->f.data[0] &&
-                (ret = ff_mpeg_ref_picture(s, &s->last_picture,
-                                           s->last_picture_ptr)) < 0)
-                return ret;
+        memset(s->last_picture_ptr->f.data[0], 0,
+               avctx->height * s->last_picture_ptr->f.linesize[0]);
+        memset(s->last_picture_ptr->f.data[1], 0x80,
+               (avctx->height >> v_chroma_shift) *
+               s->last_picture_ptr->f.linesize[1]);
+        memset(s->last_picture_ptr->f.data[2], 0x80,
+               (avctx->height >> v_chroma_shift) *
+               s->last_picture_ptr->f.linesize[2]);
+
+        ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0);
+        ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 1);
+    }
+    if ((s->next_picture_ptr == NULL ||
+         s->next_picture_ptr->f.data[0] == NULL) &&
+        s->pict_type == AV_PICTURE_TYPE_B) {
+        /* Allocate a dummy frame */
+        i = ff_find_unused_picture(s, 0);
+        if (i < 0) {
+            av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
+            return i;
         }
-        if (s->next_picture_ptr) {
-            ff_mpeg_unref_picture(s, &s->next_picture);
-            if (s->next_picture_ptr->f.data[0] &&
-                (ret = ff_mpeg_ref_picture(s, &s->next_picture,
-                                           s->next_picture_ptr)) < 0)
-                return ret;
+        s->next_picture_ptr = &s->picture[i];
+        if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
+            s->next_picture_ptr = NULL;
+            return -1;
         }
+        ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 0);
+        ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1);
+    }
+
+    if (s->last_picture_ptr) {
+        ff_mpeg_unref_picture(s, &s->last_picture);
+        if (s->last_picture_ptr->f.data[0] &&
+            (ret = ff_mpeg_ref_picture(s, &s->last_picture,
+                                       s->last_picture_ptr)) < 0)
+            return ret;
+    }
+    if (s->next_picture_ptr) {
+        ff_mpeg_unref_picture(s, &s->next_picture);
+        if (s->next_picture_ptr->f.data[0] &&
+            (ret = ff_mpeg_ref_picture(s, &s->next_picture,
+                                       s->next_picture_ptr)) < 0)
+            return ret;
+    }
 
-        assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr &&
-                                                     s->last_picture_ptr->f.data[0]));
+    assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr &&
+                                                 s->last_picture_ptr->f.data[0]));
 
     if (s->picture_structure!= PICT_FRAME) {
         int i;



More information about the ffmpeg-cvslog mailing list