diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-07 16:37:45 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-11 18:24:16 +0100 |
commit | ee8704916de79158da8a48a9ea5be819e83d23ba (patch) | |
tree | 12eb36d289a35d5bd48940d5aa093936d1b9c96c | |
parent | 19cac8e301419dcde31526d15196a952ddf2c4c7 (diff) | |
download | ffmpeg-ee8704916de79158da8a48a9ea5be819e83d23ba.tar.gz |
mpegvideo: reindent
-rw-r--r-- | libavcodec/mpegvideo.c | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 1fb7a074ff..9048179c74 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; |