Unified · Split
| @@ -2488,34 +2488,34 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 2487 unmodified lines | ||
| 2488 | 2488 | |
| 2489 | 2489 | s->coeff_vlc = vlcs; |
| 2490 | 2490 | |
| 2491 | − if (!s->theora_tables) { | |
| 2492 | − const uint8_t (*bias_tabs)[32][2]; | |
| 2493 | − | |
| 2494 | − /* init VLC tables */ | |
| 2495 | − bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; | |
| 2496 | − for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { | |
| 2497 | − ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, 32, | |
| 2498 | − &bias_tabs[i][0][1], 2, | |
| 2499 | − &bias_tabs[i][0][0], 2, 1, | |
| 2500 | − 0, 0, avctx); | |
| 2501 | − if (ret < 0) | |
| 2502 | − return ret; | |
| 2503 | − vlcs->vlc_tabs[i] = vlcs->vlcs[i].table; | |
| 2504 | − } | |
| 2505 | − } else { | |
| 2506 | − for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { | |
| 2507 | − const HuffTable *tab = &s->huffman_table[i]; | |
| 2508 | − | |
| 2509 | − ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, tab->nb_entries, | |
| 2510 | − &tab->entries[0].len, sizeof(*tab->entries), | |
| 2511 | − &tab->entries[0].sym, sizeof(*tab->entries), 1, | |
| 2512 | − 0, 0, avctx); | |
| 2513 | − if (ret < 0) | |
| 2514 | − return ret; | |
| 2515 | − vlcs->vlc_tabs[i] = vlcs->vlcs[i].table; | |
| 2491 | + if (!s->theora_tables) { | |
| 2492 | + const uint8_t (*bias_tabs)[32][2]; | |
| 2493 | + | |
| 2494 | + /* init VLC tables */ | |
| 2495 | + bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; | |
| 2496 | + for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { | |
| 2497 | + ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, 32, | |
| 2498 | + &bias_tabs[i][0][1], 2, | |
| 2499 | + &bias_tabs[i][0][0], 2, 1, | |
| 2500 | + 0, 0, avctx); | |
| 2501 | + if (ret < 0) | |
| 2502 | + return ret; | |
| 2503 | + vlcs->vlc_tabs[i] = vlcs->vlcs[i].table; | |
| 2504 | + } | |
| 2505 | + } else { | |
| 2506 | + for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { | |
| 2507 | + const HuffTable *tab = &s->huffman_table[i]; | |
| 2508 | + | |
| 2509 | + ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, tab->nb_entries, | |
| 2510 | + &tab->entries[0].len, sizeof(*tab->entries), | |
| 2511 | + &tab->entries[0].sym, sizeof(*tab->entries), 1, | |
| 2512 | + 0, 0, avctx); | |
| 2513 | + if (ret < 0) | |
| 2514 | + return ret; | |
| 2515 | + vlcs->vlc_tabs[i] = vlcs->vlcs[i].table; | |
| 2516 | + } | |
| 2516 | 2517 | } |
| 2517 | 2518 | } |
| 2518 | − } | |
| 2519 | 2519 | |
| 2520 | 2520 | ff_thread_once(&init_static_once, init_tables_once); |
| 2521 | 2521 | |