You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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: Martin Storsjö <martin@martin.st>
This commit is contained in:
committed by
Martin Storsjö
parent
f1e9398621
commit
0b499c9b06
12
configure
vendored
12
configure
vendored
@@ -122,6 +122,7 @@ Component options:
|
|||||||
--disable-w32threads disable Win32 threads [auto]
|
--disable-w32threads disable Win32 threads [auto]
|
||||||
--disable-network disable network support [no]
|
--disable-network disable network support [no]
|
||||||
--disable-dct disable DCT code
|
--disable-dct disable DCT 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
|
||||||
@@ -1091,6 +1092,7 @@ CONFIG_LIST="
|
|||||||
$PROGRAM_LIST
|
$PROGRAM_LIST
|
||||||
dct
|
dct
|
||||||
doc
|
doc
|
||||||
|
error_resilience
|
||||||
fft
|
fft
|
||||||
gpl
|
gpl
|
||||||
gray
|
gray
|
||||||
@@ -1349,7 +1351,6 @@ CONFIG_EXTRA="
|
|||||||
aandcttables
|
aandcttables
|
||||||
ac3dsp
|
ac3dsp
|
||||||
audio_frame_queue
|
audio_frame_queue
|
||||||
error_resilience
|
|
||||||
gcrypt
|
gcrypt
|
||||||
golomb
|
golomb
|
||||||
gplv3
|
gplv3
|
||||||
@@ -1544,7 +1545,8 @@ h263_decoder_select="error_resilience h263_parser mpegvideo"
|
|||||||
h263_encoder_select="aandcttables mpegvideoenc"
|
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="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"
|
huffyuv_encoder_select="huffman"
|
||||||
iac_decoder_select="fft mdct sinewin"
|
iac_decoder_select="fft mdct sinewin"
|
||||||
imc_decoder_select="fft mdct sinewin"
|
imc_decoder_select="fft mdct sinewin"
|
||||||
@@ -1601,8 +1603,8 @@ shorten_decoder_select="golomb"
|
|||||||
sipr_decoder_select="lsp"
|
sipr_decoder_select="lsp"
|
||||||
svq1_decoder_select="mpegvideo"
|
svq1_decoder_select="mpegvideo"
|
||||||
svq1_encoder_select="aandcttables mpegvideoenc"
|
svq1_encoder_select="aandcttables mpegvideoenc"
|
||||||
svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
|
svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
|
||||||
svq3_decoder_suggest="zlib"
|
svq3_decoder_suggest="error_resilience zlib"
|
||||||
theora_decoder_select="vp3_decoder"
|
theora_decoder_select="vp3_decoder"
|
||||||
tiff_decoder_suggest="zlib"
|
tiff_decoder_suggest="zlib"
|
||||||
tiff_encoder_suggest="zlib"
|
tiff_encoder_suggest="zlib"
|
||||||
@@ -1691,7 +1693,7 @@ wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
|
|||||||
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
|
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
|
||||||
|
|
||||||
# parsers
|
# 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"
|
mpeg4video_parser_select="error_resilience mpegvideo"
|
||||||
mpegvideo_parser_select="error_resilience mpegvideo"
|
mpegvideo_parser_select="error_resilience mpegvideo"
|
||||||
vc1_parser_select="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[7] + 1] =
|
||||||
h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
|
h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
|
||||||
|
|
||||||
|
if (CONFIG_ERROR_RESILIENCE) {
|
||||||
/* init ER */
|
/* init ER */
|
||||||
er->avctx = h->avctx;
|
er->avctx = h->avctx;
|
||||||
er->dsp = &h->dsp;
|
er->dsp = &h->dsp;
|
||||||
@@ -1353,6 +1354,7 @@ static int context_init(H264Context *h)
|
|||||||
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;
|
||||||
|
|
||||||
@@ -1768,6 +1770,7 @@ static int h264_frame_start(H264Context *h)
|
|||||||
if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
|
if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (CONFIG_ERROR_RESILIENCE)
|
||||||
ff_er_frame_start(&h->er);
|
ff_er_frame_start(&h->er);
|
||||||
|
|
||||||
assert(h->linesize && h->uvlinesize);
|
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
|
* past end by one (callers fault) and resync_mb_y != 0
|
||||||
* causes problems for the first MB line, too.
|
* 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.cur_pic = h->cur_pic_ptr;
|
||||||
h->er.last_pic = h->ref_count[0] ? &h->ref_list[0][0] : NULL;
|
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;
|
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,
|
static void er_add_slice(H264Context *h, int startx, int starty,
|
||||||
int endx, int endy, int status)
|
int endx, int endy, int status)
|
||||||
{
|
{
|
||||||
|
#if CONFIG_ERROR_RESILIENCE
|
||||||
ERContext *er = &h->er;
|
ERContext *er = &h->er;
|
||||||
|
|
||||||
er->ref_count = h->ref_count[0];
|
er->ref_count = h->ref_count[0];
|
||||||
ff_er_add_slice(er, startx, starty, endx, endy, status);
|
ff_er_add_slice(er, startx, starty, endx, endy, status);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
||||||
|
Reference in New Issue
Block a user