int i;
h->avctx = avctx;
+ h->backup_width = -1;
+ h->backup_height = -1;
+ h->backup_pix_fmt = AV_PIX_FMT_NONE;
+ h->current_sps_id = -1;
+ h->cur_chroma_format_idc = -1;
h->picture_structure = PICT_FRAME;
- h->slice_context_count = 1;
h->workaround_bugs = avctx->workaround_bugs;
h->flags = avctx->flags;
h->poc.prev_poc_msb = 1 << 16;
AVCodecContext *const avctx = h->avctx;
unsigned context_count = 0;
int nals_needed = 0; ///< number of NALs that need decoding before the next frame thread starts
+ int idr_cleared=0;
int i, ret = 0;
- if(!h->slice_context_count)
- h->slice_context_count= 1;
- h->max_contexts = h->slice_context_count;
+ h->nal_unit_type= 0;
+
+ h->max_contexts = h->nb_slice_ctx;
if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
h->current_slice = 0;
if (!h->first_field)
#include "rectangle.h"
#include "videodsp.h"
-#define H264_MAX_PICTURE_COUNT 32
+#define H264_MAX_PICTURE_COUNT 36
- #define H264_MAX_THREADS 32
#define MAX_SPS_COUNT 32
#define MAX_PPS_COUNT 256
*/
int max_contexts;
- int slice_context_count;
-
+ /**
+ * 1 if the single thread fallback warning has already been
+ * displayed, 0 otherwise.
+ */
+ int single_decode_warning;
+
/** @} */
/**
ret = ff_h264_slice_context_init(h, &h->slice_ctx[0]);
if (ret < 0) {
av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
- return ret;
+ goto fail;
}
} else {
- for (i = 0; i < h->slice_context_count; i++) {
+ for (i = 0; i < h->nb_slice_ctx; i++) {
H264SliceContext *sl = &h->slice_ctx[i];
sl->h264 = h;