if (cur->reference == 0)
cur->reference = DELAYED_PIC_REF;
- out = h->delayed_pic[0];
+ out = h->delayed_pic[0];
out_idx = 0;
for (i = 1; h->delayed_pic[i] &&
!h->delayed_pic[i]->f.key_frame &&
* past end by one (callers fault) and resync_mb_y != 0
* causes problems for the first MB line, too.
*/
- if (CONFIG_ERROR_RESILIENCE &&
- !FIELD_PICTURE(h) && h->current_slice && !h->sps.new) {
+ if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h) && h->current_slice && !h->sps.new) {
h->er.cur_pic = h->cur_pic_ptr;
ff_er_frame_end(&h->er);
}
h->sps.num_units_in_tick, den, 1 << 30);
}
- h->avctx->hwaccel = ff_find_hwaccel(h->avctx->codec->id, h->avctx->pix_fmt);
+ h->avctx->hwaccel = ff_find_hwaccel(h->avctx);
if (reinit)
free_tables(h, 0);
c->height = h->height;
c->linesize = h->linesize;
c->uvlinesize = h->uvlinesize;
- c->chroma_x_shift = h->chroma_x_shift;
- c->chroma_y_shift = h->chroma_y_shift;
+ c->chroma_x_shift = h->chroma_x_shift;
+ c->chroma_y_shift = h->chroma_y_shift;
c->qscale = h->qscale;
c->droppable = h->droppable;
c->data_partitioning = h->data_partitioning;
} else {
/* Shorten frame num gaps so we don't have to allocate reference
* frames just to throw them away */
- if (h->frame_num != h->prev_frame_num && h->prev_frame_num >= 0) {
+ if (h->frame_num != h->prev_frame_num) {
int unwrap_prev_frame_num = h->prev_frame_num;
int max_frame_num = 1 << h->sps.log2_max_frame_num;
}
}
- while (h->frame_num != h->prev_frame_num && h->prev_frame_num >= 0 && !h0->first_field &&
+ while (h->frame_num != h->prev_frame_num && !h0->first_field &&
h->frame_num != (h->prev_frame_num + 1) % (1 << h->sps.log2_max_frame_num)) {
Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
av_log(h->avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
decode_rbsp_trailing(h, ptr + dst_length - 1));
if (h->avctx->debug & FF_DEBUG_STARTCODE)
- av_log(h->avctx, AV_LOG_DEBUG, "NAL %d/%d at %d/%d length %d pass %d\n", hx->nal_unit_type, hx->nal_ref_idc, buf_index, buf_size, dst_length, pass);
+ av_log(h->avctx, AV_LOG_DEBUG,
+ "NAL %d/%d at %d/%d length %d pass %d\n",
+ hx->nal_unit_type, hx->nal_ref_idc, buf_index, buf_size, dst_length, pass);
if (h->is_avc && (nalsize != consumed) && nalsize)
av_log(h->avctx, AV_LOG_DEBUG,
if ((err = decode_slice_header(hx, h)))
break;
- if (h->sei_recovery_frame_cnt >= 0 && (h->frame_num != h->sei_recovery_frame_cnt || hx->slice_type_nos != AV_PICTURE_TYPE_I))
- h->valid_recovery_point = 1;
+ if (h->sei_recovery_frame_cnt >= 0) {
+ if (h->frame_num != h->sei_recovery_frame_cnt || hx->slice_type_nos != AV_PICTURE_TYPE_I)
+ h->valid_recovery_point = 1;
- if ( h->sei_recovery_frame_cnt >= 0
- && ( h->recovery_frame<0
- || ((h->recovery_frame - h->frame_num) & ((1 << h->sps.log2_max_frame_num)-1)) > h->sei_recovery_frame_cnt)) {
- h->recovery_frame = (h->frame_num + h->sei_recovery_frame_cnt) &
- ((1 << h->sps.log2_max_frame_num) - 1);
+ if ( h->recovery_frame < 0
+ || ((h->recovery_frame - h->frame_num) & ((1 << h->sps.log2_max_frame_num)-1)) > h->sei_recovery_frame_cnt) {
+ h->recovery_frame = (h->frame_num + h->sei_recovery_frame_cnt) &
+ ((1 << h->sps.log2_max_frame_num) - 1);
- if (!h->valid_recovery_point)
- h->recovery_frame = h->frame_num;
+ if (!h->valid_recovery_point)
+ h->recovery_frame = h->frame_num;
+ }
}
h->cur_pic_ptr->f.key_frame |=
- (hx->nal_unit_type == NAL_IDR_SLICE);
+ (hx->nal_unit_type == NAL_IDR_SLICE);
if (hx->nal_unit_type == NAL_IDR_SLICE ||
h->recovery_frame == h->frame_num) {