aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-26 14:36:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-26 14:36:00 +0100
commit365ad0042a637a421602d248f1cd9d2dc87d61c4 (patch)
tree52411ba18f8cb4900140a30b22d732c0d3bf84ef
parent62d36abef4b7bf49856b0838bd87f7a23910a391 (diff)
parent0b499c9b06b29b3d3fa23122b493945dbf77f707 (diff)
downloadffmpeg-365ad0042a637a421602d248f1cd9d2dc87d61c4.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: h264: Make it possible to compile without error_resilience Conflicts: configure libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure8
-rw-r--r--libavcodec/h264.c78
2 files changed, 44 insertions, 42 deletions
diff --git a/configure b/configure
index c489ca490e..3aa859cdc8 100755
--- a/configure
+++ b/configure
@@ -133,6 +133,7 @@ Component options:
--disable-network disable network support [no]
--disable-dct disable DCT code
--disable-dwt disable DWT code
+ --disable-error-resilience disable error resilience code
--disable-lsp disable LSP code
--disable-lzo disable LZO decoder code
--disable-mdct disable MDCT code
@@ -1226,6 +1227,7 @@ CONFIG_LIST="
$PROGRAM_LIST
dct
dwt
+ error_resilience
fast_unaligned
fft
ftrapv
@@ -1510,7 +1512,6 @@ CONFIG_EXTRA="
ac3dsp
audio_frame_queue
dsputil
- error_resilience
frame_thread_encoder
gcrypt
golomb
@@ -1738,6 +1739,7 @@ h263_encoder_select="aandcttables mpegvideoenc"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
+h264_decoder_suggest="error_resilience"
huffyuv_decoder_select="dsputil"
huffyuv_encoder_select="huffman"
iac_decoder_select="fft mdct sinewin"
@@ -1809,8 +1811,8 @@ sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
svq1_decoder_select="hpeldsp"
svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
-svq3_decoder_select="dsputil error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
-svq3_decoder_suggest="zlib"
+svq3_decoder_select="dsputil golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
+svq3_decoder_suggest="error_resilience zlib"
tak_decoder_select="dsputil"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index b8ee861d71..51f34c5f1c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1351,45 +1351,45 @@ static int context_init(H264Context *h)
h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
if (CONFIG_ERROR_RESILIENCE) {
- /* init ER */
- er->avctx = h->avctx;
- er->dsp = &h->dsp;
- er->decode_mb = h264_er_decode_mb;
- er->opaque = h;
- er->quarter_sample = 1;
-
- er->mb_num = h->mb_num;
- er->mb_width = h->mb_width;
- er->mb_height = h->mb_height;
- er->mb_stride = h->mb_stride;
- er->b8_stride = h->mb_width * 2 + 1;
-
- FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int),
- fail); // error ressilience code looks cleaner with this
- for (y = 0; y < h->mb_height; y++)
- for (x = 0; x < h->mb_width; x++)
- 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) *
- h->mb_stride + h->mb_width;
-
- FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table,
- mb_array_size * sizeof(uint8_t), fail);
-
- FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail);
- memset(er->mbintra_table, 1, mb_array_size);
-
- 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,
- 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[1] = h->dc_val_base + y_size + h->mb_stride + 1;
- er->dc_val[2] = er->dc_val[1] + c_size;
- for (i = 0; i < yc_size; i++)
- h->dc_val_base[i] = 1024;
+ /* init ER */
+ er->avctx = h->avctx;
+ er->dsp = &h->dsp;
+ er->decode_mb = h264_er_decode_mb;
+ er->opaque = h;
+ er->quarter_sample = 1;
+
+ er->mb_num = h->mb_num;
+ er->mb_width = h->mb_width;
+ er->mb_height = h->mb_height;
+ er->mb_stride = h->mb_stride;
+ er->b8_stride = h->mb_width * 2 + 1;
+
+ FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int),
+ fail); // error ressilience code looks cleaner with this
+ for (y = 0; y < h->mb_height; y++)
+ for (x = 0; x < h->mb_width; x++)
+ 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) *
+ h->mb_stride + h->mb_width;
+
+ FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table,
+ mb_array_size * sizeof(uint8_t), fail);
+
+ FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail);
+ memset(er->mbintra_table, 1, mb_array_size);
+
+ 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,
+ 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[1] = h->dc_val_base + y_size + h->mb_stride + 1;
+ 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;