Commit 0b499c9b authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Martin Storsjö

h264: Make it possible to compile without error_resilience

Error resilience is enabled by the h264 decoder, unless explicitly
disabled. --disable-everything --enable-decoder=h264 will produce
a h264 decoder with error resilience enabled, while
--disable-everything --enable-decoder=h264 --disable-error-resilience
will produce a h264 decoder with error resilience disabled.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent f1e93986
......@@ -122,6 +122,7 @@ Component options:
--disable-w32threads disable Win32 threads [auto]
--disable-network disable network support [no]
--disable-dct disable DCT code
--disable-error-resilience disable error resilience code
--disable-lsp disable LSP code
--disable-lzo disable LZO decoder code
--disable-mdct disable MDCT code
......@@ -1091,6 +1092,7 @@ CONFIG_LIST="
$PROGRAM_LIST
dct
doc
error_resilience
fft
gpl
gray
......@@ -1349,7 +1351,6 @@ CONFIG_EXTRA="
aandcttables
ac3dsp
audio_frame_queue
error_resilience
gcrypt
golomb
gplv3
......@@ -1544,7 +1545,8 @@ h263_decoder_select="error_resilience h263_parser mpegvideo"
h263_encoder_select="aandcttables mpegvideoenc"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_suggest="error_resilience"
huffyuv_encoder_select="huffman"
iac_decoder_select="fft mdct sinewin"
imc_decoder_select="fft mdct sinewin"
......@@ -1601,8 +1603,8 @@ shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
svq1_decoder_select="mpegvideo"
svq1_encoder_select="aandcttables mpegvideoenc"
svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
svq3_decoder_suggest="zlib"
svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
svq3_decoder_suggest="error_resilience zlib"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
......@@ -1691,7 +1693,7 @@ wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# parsers
h264_parser_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
mpeg4video_parser_select="error_resilience mpegvideo"
mpegvideo_parser_select="error_resilience mpegvideo"
vc1_parser_select="mpegvideo"
......
......@@ -1314,6 +1314,7 @@ static int context_init(H264Context *h)
h->ref_cache[1][scan8[7] + 1] =
h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
if (CONFIG_ERROR_RESILIENCE) {
/* init ER */
er->avctx = h->avctx;
er->dsp = &h->dsp;
......@@ -1353,6 +1354,7 @@ static int context_init(H264Context *h)
er->dc_val[2] = er->dc_val[1] + c_size;
for (i = 0; i < yc_size; i++)
h->dc_val_base[i] = 1024;
}
return 0;
......@@ -1768,6 +1770,7 @@ static int h264_frame_start(H264Context *h)
if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
return ret;
if (CONFIG_ERROR_RESILIENCE)
ff_er_frame_start(&h->er);
assert(h->linesize && h->uvlinesize);
......@@ -2801,7 +2804,7 @@ static int field_end(H264Context *h, int in_setup)
* past end by one (callers fault) and resync_mb_y != 0
* causes problems for the first MB line, too.
*/
if (!FIELD_PICTURE(h)) {
if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h)) {
h->er.cur_pic = h->cur_pic_ptr;
h->er.last_pic = h->ref_count[0] ? &h->ref_list[0][0] : NULL;
h->er.next_pic = h->ref_count[1] ? &h->ref_list[1][0] : NULL;
......@@ -4090,10 +4093,12 @@ static void decode_finish_row(H264Context *h)
static void er_add_slice(H264Context *h, int startx, int starty,
int endx, int endy, int status)
{
#if CONFIG_ERROR_RESILIENCE
ERContext *er = &h->er;
er->ref_count = h->ref_count[0];
ff_er_add_slice(er, startx, starty, endx, endy, status);
#endif
}
static int decode_slice(struct AVCodecContext *avctx, void *arg)
......
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