diff options
author | Clément Bœsch <clement@stupeflix.com> | 2016-06-20 11:37:49 +0200 |
---|---|---|
committer | Clément Bœsch <clement@stupeflix.com> | 2016-06-20 11:47:40 +0200 |
commit | d98ca4b14c673db8eb3cc124e42ff7a660da9109 (patch) | |
tree | a7055ec793ab9300d2c78847fa38b899fa2b6a0d /libavcodec | |
parent | 38a2d9aeec083000d3bf14f94a2b4effd8ae2769 (diff) | |
parent | 99c554efc8b09c3f1bb2fb41c3da5431085f7470 (diff) | |
download | ffmpeg-d98ca4b14c673db8eb3cc124e42ff7a660da9109.tar.gz |
Merge commit '99c554efc8b09c3f1bb2fb41c3da5431085f7470'
* commit '99c554efc8b09c3f1bb2fb41c3da5431085f7470':
h264: eliminate low_delay
ff_print_debug_info2() is adjusted to allow a NULL pointer as low_delay.
It's only useful for MPEG codecs with the exception of H264.
Merged-by: Clément Bœsch <clement@stupeflix.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 9 | ||||
-rw-r--r-- | libavcodec/h264.h | 1 | ||||
-rw-r--r-- | libavcodec/h264_slice.c | 16 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 3 |
4 files changed, 3 insertions, 26 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index aea6f4955c..bf8e12d022 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -368,10 +368,6 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - /* set defaults */ - if (!avctx->has_b_frames) - h->low_delay = 1; - ret = ff_thread_once(&h264_vlc_init, ff_h264_decode_init_vlc); if (ret != 0) { av_log(avctx, AV_LOG_ERROR, "pthread_once has failed."); @@ -401,7 +397,6 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) if (h->ps.sps && h->ps.sps->bitstream_restriction_flag && h->avctx->has_b_frames < h->ps.sps->num_reorder_frames) { h->avctx->has_b_frames = h->ps.sps->num_reorder_frames; - h->low_delay = 0; } avctx->internal->allocate_progress = 1; @@ -631,7 +626,6 @@ static void decode_postinit(H264Context *h, int setup_finished) h->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT) { h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, sps->num_reorder_frames); } - h->low_delay = !h->avctx->has_b_frames; for (i = 0; 1; i++) { if(i == MAX_DELAYED_PIC_COUNT || cur->poc < h->last_pocs[i]){ @@ -655,7 +649,6 @@ static void decode_postinit(H264Context *h, int setup_finished) } else if(h->avctx->has_b_frames < out_of_order && !sps->bitstream_restriction_flag){ av_log(h->avctx, AV_LOG_INFO, "Increasing reorder buffer to %d\n", out_of_order); h->avctx->has_b_frames = out_of_order; - h->low_delay = 0; } pics = 0; @@ -1353,7 +1346,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, h->next_output_pic->mb_type, h->next_output_pic->qscale_table, h->next_output_pic->motion_val, - &h->low_delay, + NULL, h->mb_width, h->mb_height, h->mb_stride, 1); } } diff --git a/libavcodec/h264.h b/libavcodec/h264.h index f5a2a90bb1..7b0555e362 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -494,7 +494,6 @@ typedef struct H264Context { int droppable; int coded_picture_number; - int low_delay; int context_initialized; int flags; diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index d8da424762..c303051090 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -386,7 +386,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->first_field = h1->first_field; h->picture_structure = h1->picture_structure; h->droppable = h1->droppable; - h->low_delay = h1->low_delay; h->backup_width = h1->backup_width; h->backup_height = h1->backup_height; h->backup_pix_fmt = h1->backup_pix_fmt; @@ -408,7 +407,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->enable_er = h1->enable_er; h->workaround_bugs = h1->workaround_bugs; - h->low_delay = h1->low_delay; h->droppable = h1->droppable; // extradata/NAL handling @@ -1218,20 +1216,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl) if (h->bit_depth_luma != h->ps.sps->bit_depth_luma || h->chroma_format_idc != h->ps.sps->chroma_format_idc) needs_reinit = 1; - - if (h->flags & AV_CODEC_FLAG_LOW_DELAY || - (h->ps.sps->bitstream_restriction_flag && - !h->ps.sps->num_reorder_frames)) { - if (h->avctx->has_b_frames > 1 || h->delayed_pic[0]) - av_log(h->avctx, AV_LOG_WARNING, "Delayed frames seen. " - "Reenabling low delay requires a codec flush.\n"); - else - h->low_delay = 1; - } - - if (h->avctx->has_b_frames < 2) - h->avctx->has_b_frames = !h->low_delay; - } pps = h->ps.pps; diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 80d5386ad0..ecb585f95a 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1757,7 +1757,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_ const int mv_stride = (mb_width << mv_sample_log2) + (avctx->codec->id == AV_CODEC_ID_H264 ? 0 : 1); - *low_delay = 0; // needed to see the vectors without trashing the buffers + if (low_delay) + *low_delay = 0; // needed to see the vectors without trashing the buffers avcodec_get_chroma_sub_sample(avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift); |