Commit 365ad004 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  h264: Make it possible to compile without error_resilience

Conflicts:
	configure
	libavcodec/h264.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 62d36abe 0b499c9b
...@@ -133,6 +133,7 @@ Component options: ...@@ -133,6 +133,7 @@ Component options:
--disable-network disable network support [no] --disable-network disable network support [no]
--disable-dct disable DCT code --disable-dct disable DCT code
--disable-dwt disable DWT code --disable-dwt disable DWT code
--disable-error-resilience disable error resilience code
--disable-lsp disable LSP code --disable-lsp disable LSP code
--disable-lzo disable LZO decoder code --disable-lzo disable LZO decoder code
--disable-mdct disable MDCT code --disable-mdct disable MDCT code
...@@ -1226,6 +1227,7 @@ CONFIG_LIST=" ...@@ -1226,6 +1227,7 @@ CONFIG_LIST="
$PROGRAM_LIST $PROGRAM_LIST
dct dct
dwt dwt
error_resilience
fast_unaligned fast_unaligned
fft fft
ftrapv ftrapv
...@@ -1510,7 +1512,6 @@ CONFIG_EXTRA=" ...@@ -1510,7 +1512,6 @@ CONFIG_EXTRA="
ac3dsp ac3dsp
audio_frame_queue audio_frame_queue
dsputil dsputil
error_resilience
frame_thread_encoder frame_thread_encoder
gcrypt gcrypt
golomb golomb
...@@ -1738,6 +1739,7 @@ h263_encoder_select="aandcttables mpegvideoenc" ...@@ -1738,6 +1739,7 @@ h263_encoder_select="aandcttables mpegvideoenc"
h263i_decoder_select="h263_decoder" h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder" h263p_encoder_select="h263_encoder"
h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp" h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_suggest="error_resilience"
huffyuv_decoder_select="dsputil" huffyuv_decoder_select="dsputil"
huffyuv_encoder_select="huffman" huffyuv_encoder_select="huffman"
iac_decoder_select="fft mdct sinewin" iac_decoder_select="fft mdct sinewin"
...@@ -1809,8 +1811,8 @@ sonic_encoder_select="golomb" ...@@ -1809,8 +1811,8 @@ sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb" sonic_ls_encoder_select="golomb"
svq1_decoder_select="hpeldsp" svq1_decoder_select="hpeldsp"
svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc" svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
svq3_decoder_select="dsputil error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp" svq3_decoder_select="dsputil golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
svq3_decoder_suggest="zlib" svq3_decoder_suggest="error_resilience zlib"
tak_decoder_select="dsputil" tak_decoder_select="dsputil"
theora_decoder_select="vp3_decoder" theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib" tiff_decoder_suggest="zlib"
......
...@@ -1351,45 +1351,45 @@ static int context_init(H264Context *h) ...@@ -1351,45 +1351,45 @@ static int context_init(H264Context *h)
h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE; h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
if (CONFIG_ERROR_RESILIENCE) { if (CONFIG_ERROR_RESILIENCE) {
/* init ER */ /* init ER */
er->avctx = h->avctx; er->avctx = h->avctx;
er->dsp = &h->dsp; er->dsp = &h->dsp;
er->decode_mb = h264_er_decode_mb; er->decode_mb = h264_er_decode_mb;
er->opaque = h; er->opaque = h;
er->quarter_sample = 1; er->quarter_sample = 1;
er->mb_num = h->mb_num; er->mb_num = h->mb_num;
er->mb_width = h->mb_width; er->mb_width = h->mb_width;
er->mb_height = h->mb_height; er->mb_height = h->mb_height;
er->mb_stride = h->mb_stride; er->mb_stride = h->mb_stride;
er->b8_stride = h->mb_width * 2 + 1; er->b8_stride = h->mb_width * 2 + 1;
FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int), FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int),
fail); // error ressilience code looks cleaner with this fail); // error ressilience code looks cleaner with this
for (y = 0; y < h->mb_height; y++) for (y = 0; y < h->mb_height; y++)
for (x = 0; x < h->mb_width; x++) for (x = 0; x < h->mb_width; x++)
er->mb_index2xy[x + y * h->mb_width] = x + y * h->mb_stride; er->mb_index2xy[x + y * h->mb_width] = x + y * h->mb_stride;
er->mb_index2xy[h->mb_height * h->mb_width] = (h->mb_height - 1) * er->mb_index2xy[h->mb_height * h->mb_width] = (h->mb_height - 1) *
h->mb_stride + h->mb_width; h->mb_stride + h->mb_width;
FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table, FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table,
mb_array_size * sizeof(uint8_t), fail); mb_array_size * sizeof(uint8_t), fail);
FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail); FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail);
memset(er->mbintra_table, 1, mb_array_size); memset(er->mbintra_table, 1, mb_array_size);
FF_ALLOCZ_OR_GOTO(h->avctx, er->mbskip_table, mb_array_size + 2, fail); FF_ALLOCZ_OR_GOTO(h->avctx, er->mbskip_table, mb_array_size + 2, fail);
FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer, h->mb_height * h->mb_stride, FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer, h->mb_height * h->mb_stride,
fail); fail);
FF_ALLOCZ_OR_GOTO(h->avctx, h->dc_val_base, yc_size * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(h->avctx, h->dc_val_base, yc_size * sizeof(int16_t), fail);
er->dc_val[0] = h->dc_val_base + h->mb_width * 2 + 2; er->dc_val[0] = h->dc_val_base + h->mb_width * 2 + 2;
er->dc_val[1] = h->dc_val_base + y_size + h->mb_stride + 1; er->dc_val[1] = h->dc_val_base + y_size + h->mb_stride + 1;
er->dc_val[2] = er->dc_val[1] + c_size; er->dc_val[2] = er->dc_val[1] + c_size;
for (i = 0; i < yc_size; i++) for (i = 0; i < yc_size; i++)
h->dc_val_base[i] = 1024; h->dc_val_base[i] = 1024;
} }
return 0; return 0;
......
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