さきゅばす/いんきゅばす用ffmpeg
Revision | 716c1f7b2ad02a906ad1e47182492554b668f3dc (tree) |
---|---|
Zeit | 2011-09-12 13:07:58 |
Autor | Michael Niedermayer <michaelni@gmx....> |
Commiter | Michael Niedermayer |
h264: improve MAX_SLICES too small check so it gives less false positives.
Fixes Ticket273
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
@@ -3016,7 +3016,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ | ||
3016 | 3016 | |
3017 | 3017 | h0->last_slice_type = slice_type; |
3018 | 3018 | h->slice_num = ++h0->current_slice; |
3019 | - if(h->slice_num >= MAX_SLICES){ | |
3019 | + | |
3020 | + if(h->slice_num) | |
3021 | + h0->slice_row[(h->slice_num-1)&(MAX_SLICES-1)]= s->resync_mb_y; | |
3022 | + if ( h0->slice_row[h->slice_num&(MAX_SLICES-1)] + 3 >= s->resync_mb_y | |
3023 | + && h0->slice_row[h->slice_num&(MAX_SLICES-1)] <= s->resync_mb_y | |
3024 | + && h->slice_num >= MAX_SLICES) { | |
3025 | + //in case of ASO this check needs to be updated depending on how we decide to assign slice numbers in this case | |
3020 | 3026 | av_log(s->avctx, AV_LOG_WARNING, "Possibly too many slices (%d >= %d), increase MAX_SLICES and recompile if there are artifacts\n", h->slice_num, MAX_SLICES); |
3021 | 3027 | } |
3022 | 3028 |
@@ -580,6 +580,8 @@ typedef struct H264Context{ | ||
580 | 580 | int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs |
581 | 581 | |
582 | 582 | int cur_chroma_format_idc; |
583 | + | |
584 | + int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low | |
583 | 585 | }H264Context; |
584 | 586 | |
585 | 587 |