libavcodec/proresenc.c:560: error: Integer Overflow L2
  ([0, +oo] - [0, 7]):unsigned32 by call to `estimate_acs`.

libavcodec/proresenc.c:560:13: Call
558. 
559.     bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);
560.     bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,
                 ^
561.                          plane_size_factor, ctx->scantable.permutated, qmat);
562. 

libavcodec/proresenc.c:512:1: Global `ff_prores_ac_codebook`
  510. }
  511. 
  512. static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice,
       ^
  513.                         int plane_size_factor,
  514.                         const uint8_t *scan, const int16_t *qmat)

libavcodec/proresenc.c:532:25: Call
  530.             if (level) {
  531.                 abs_level = FFABS(level);
  532.                 bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run);
                               ^
  533.                 bits += estimate_vlc(ff_prores_ac_codebook[lev_cb],
  534.                                      abs_level - 1) + 1;

libavcodec/proresenc.c:473:20: <LHS trace>
471.     if (val >= switch_val) {
472.         val -= switch_val - (1 << exp_order);
473.         exponent = av_log2(val);
                        ^
474. 
475.         return exponent * 2 - exp_order + switch_bits + 1;

libavcodec/proresenc.c:473:20: Call
    471.     if (val >= switch_val) {
    472.         val -= switch_val - (1 << exp_order);
    473.         exponent = av_log2(val);
                            ^
    474. 
    475.         return exponent * 2 - exp_order + switch_bits + 1;

libavutil/intmath.h:53:1: Global `ff_log2_tab`
      51. #ifndef ff_log2
      52. #define ff_log2 ff_log2_c
      53. static av_always_inline av_const int ff_log2_c(unsigned int v)
          ^
      54. {
      55.     int n = 0;

libavutil/intmath.h:64:5: Assignment
      62.         n += 8;
      63.     }
      64.     n += ff_log2_tab[v];
              ^
      65. 
      66.     return n;

libavutil/intmath.h:66:5: Assignment
      64.     n += ff_log2_tab[v];
      65. 
      66.     return n;
              ^
      67. }
      68. #endif

libavcodec/proresenc.c:473:9: Assignment
    471.     if (val >= switch_val) {
    472.         val -= switch_val - (1 << exp_order);
    473.         exponent = av_log2(val);
                 ^
    474. 
    475.         return exponent * 2 - exp_order + switch_bits + 1;

libavcodec/proresenc.c:459:1: <RHS trace>
457. }
458. 
459. static inline int estimate_vlc(unsigned codebook, int val)
     ^
460. {
461.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:459:1: Parameter `codebook`
    457. }
    458. 
    459. static inline int estimate_vlc(unsigned codebook, int val)
         ^
    460. {
    461.     unsigned int rice_order, exp_order, switch_bits, switch_val;

libavcodec/proresenc.c:467:5: Assignment
    465.     switch_bits = (codebook & 3) + 1;
    466.     rice_order  =  codebook >> 5;       /* rice code order */
    467.     exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
             ^
    468. 
    469.     switch_val  = switch_bits << rice_order;

libavcodec/proresenc.c:475:9: Binary operation: ([0, +oo] - [0, 7]):unsigned32 by call to `estimate_acs` 
    473.         exponent = av_log2(val);
    474. 
    475.         return exponent * 2 - exp_order + switch_bits + 1;
                 ^
    476.     } else {
    477.         return (val >> rice_order) + rice_order + 1;

static inline int estimate_vlc(unsigned codebook, int val)
{
    unsigned int rice_order, exp_order, switch_bits, switch_val;
    int exponent;
    switch_bits = (codebook & 3) + 1;
    rice_order  =  codebook >> 5;
    exp_order   = (codebook >> 2) & 7;
    switch_val  = switch_bits << rice_order;
    if (val >= switch_val) {
        val -= switch_val - (1 << exp_order);
        exponent = av_log2(val);
        return exponent * 2 - exp_order + switch_bits + 1;
    } else {
        return (val >> rice_order) + rice_order + 1;
    }
}
['static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,\n                                const uint16_t *src, int linesize,\n                                int mbs_per_slice,\n                                int blocks_per_mb, int plane_size_factor,\n                                const int16_t *qmat, ProresThreadData *td)\n{\n    int blocks_per_slice;\n    int bits;\n    blocks_per_slice = mbs_per_slice * blocks_per_mb;\n    bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);\n    bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,\n                         plane_size_factor, ctx->scantable.permutated, qmat);\n    return FFALIGN(bits, 8);\n}', 'static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice,\n                        int plane_size_factor,\n                        const uint8_t *scan, const int16_t *qmat)\n{\n    int idx, i;\n    int run, level, run_cb, lev_cb;\n    int max_coeffs, abs_level;\n    int bits = 0;\n    max_coeffs = blocks_per_slice << 6;\n    run_cb     = ff_prores_run_to_cb_index[4];\n    lev_cb     = ff_prores_lev_to_cb_index[2];\n    run        = 0;\n    for (i = 1; i < 64; i++) {\n        for (idx = scan[i]; idx < max_coeffs; idx += 64) {\n            level   = blocks[idx] / qmat[scan[i]];\n            *error += FFABS(blocks[idx]) % qmat[scan[i]];\n            if (level) {\n                abs_level = FFABS(level);\n                bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run);\n                bits += estimate_vlc(ff_prores_ac_codebook[lev_cb],\n                                     abs_level - 1) + 1;\n                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];\n                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];\n                run    = 0;\n            } else {\n                run++;\n            }\n        }\n    }\n    return bits;\n}', 'static inline int estimate_vlc(unsigned codebook, int val)\n{\n    unsigned int rice_order, exp_order, switch_bits, switch_val;\n    int exponent;\n    switch_bits = (codebook & 3) + 1;\n    rice_order  =  codebook >> 5;\n    exp_order   = (codebook >> 2) & 7;\n    switch_val  = switch_bits << rice_order;\n    if (val >= switch_val) {\n        val -= switch_val - (1 << exp_order);\n        exponent = av_log2(val);\n        return exponent * 2 - exp_order + switch_bits + 1;\n    } else {\n        return (val >> rice_order) + rice_order + 1;\n    }\n}', 'static av_always_inline av_const int ff_log2_c(unsigned int v)\n{\n    int n = 0;\n    if (v & 0xffff0000) {\n        v >>= 16;\n        n += 16;\n    }\n    if (v & 0xff00) {\n        v >>= 8;\n        n += 8;\n    }\n    n += ff_log2_tab[v];\n    return n;\n}']