diff options
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index b8201d1f40..5b9a9b90e2 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1577,102 +1577,6 @@ void ff_mpv_common_end(MpegEncContext *s) s->linesize = s->uvlinesize = 0; } -av_cold void ff_init_rl(RLTable *rl, - uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) -{ - int8_t max_level[MAX_RUN + 1], max_run[MAX_LEVEL + 1]; - uint8_t index_run[MAX_RUN + 1]; - int last, run, level, start, end, i; - - /* If table is static, we can quit if rl->max_level[0] is not NULL */ - if (static_store && rl->max_level[0]) - return; - - /* compute max_level[], max_run[] and index_run[] */ - for (last = 0; last < 2; last++) { - if (last == 0) { - start = 0; - end = rl->last; - } else { - start = rl->last; - end = rl->n; - } - - memset(max_level, 0, MAX_RUN + 1); - memset(max_run, 0, MAX_LEVEL + 1); - memset(index_run, rl->n, MAX_RUN + 1); - for (i = start; i < end; i++) { - run = rl->table_run[i]; - level = rl->table_level[i]; - if (index_run[run] == rl->n) - index_run[run] = i; - if (level > max_level[run]) - max_level[run] = level; - if (run > max_run[level]) - max_run[level] = run; - } - if (static_store) - rl->max_level[last] = static_store[last]; - else - rl->max_level[last] = av_malloc(MAX_RUN + 1); - memcpy(rl->max_level[last], max_level, MAX_RUN + 1); - if (static_store) - rl->max_run[last] = static_store[last] + MAX_RUN + 1; - else - rl->max_run[last] = av_malloc(MAX_LEVEL + 1); - memcpy(rl->max_run[last], max_run, MAX_LEVEL + 1); - if (static_store) - rl->index_run[last] = static_store[last] + MAX_RUN + MAX_LEVEL + 2; - else - rl->index_run[last] = av_malloc(MAX_RUN + 1); - memcpy(rl->index_run[last], index_run, MAX_RUN + 1); - } -} - -av_cold void ff_init_vlc_rl(RLTable *rl, unsigned static_size) -{ - int i, q; - VLC_TYPE table[1500][2] = {{0}}; - VLC vlc = { .table = table, .table_allocated = static_size }; - av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC); - - for (q = 0; q < 32; q++) { - int qmul = q * 2; - int qadd = (q - 1) | 1; - - if (q == 0) { - qmul = 1; - qadd = 0; - } - for (i = 0; i < vlc.table_size; i++) { - int code = vlc.table[i][0]; - int len = vlc.table[i][1]; - int level, run; - - if (len == 0) { // illegal code - run = 66; - level = MAX_LEVEL; - } else if (len < 0) { // more bits needed - run = 0; - level = code; - } else { - if (code == rl->n) { // esc - run = 66; - level = 0; - } else { - run = rl->table_run[code] + 1; - level = rl->table_level[code] * qmul + qadd; - if (code >= rl->last) run += 192; - } - } - rl->rl_vlc[q][i].len = len; - rl->rl_vlc[q][i].level = level; - rl->rl_vlc[q][i].run = run; - } - } -} - static void release_unused_pictures(AVCodecContext *avctx, Picture *picture) { int i; |