Commit d98ca4b1 authored by Clément Bœsch's avatar Clément Bœsch

Merge commit '99c554ef'

* commit '99c554ef':
  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: 's avatarClément Bœsch <clement@stupeflix.com>
parents 38a2d9ae 99c554ef
......@@ -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);
}
}
......
......@@ -494,7 +494,6 @@ typedef struct H264Context {
int droppable;
int coded_picture_number;
int low_delay;
int context_initialized;
int flags;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment