libavcodec/h264.c:78: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `ff_h264_hl_decode_mb`.

libavcodec/h264.c:65:5: Unknown value from: __infer_skip
63.     sl->mb_xy = mb_x + mb_y * h->mb_stride;
64.     memset(sl->non_zero_count_cache, 0, sizeof(sl->non_zero_count_cache));
65.     assert(ref >= 0);
        ^
66.     /* FIXME: It is possible albeit uncommon that slice references
67.      * differ between slices. We take the easy approach and ignore

libavcodec/h264.c:78:5: Call
76.                    pack16to32((*mv)[0][0][0], (*mv)[0][0][1]), 4);
77.     assert(!FRAME_MBAFF(h));
78.     ff_h264_hl_decode_mb(h, &h->slice_ctx[0]);
        ^
79. }
80. 

libavcodec/h264_mb.c:812:1: Parameter `sl->list_count`
  810. #include "h264_mb_template.c"
  811. 
  812. void ff_h264_hl_decode_mb(const H264Context *h, H264SliceContext *sl)
       ^
  813. {
  814.     const int mb_xy   = sl->mb_xy;

libavcodec/h264_mb.c:823:13: Call
  821.             hl_decode_mb_444_complex(h, sl);
  822.         else
  823.             hl_decode_mb_444_simple_8(h, sl);
                   ^
  824.     } else if (is_complex) {
  825.         hl_decode_mb_complex(h, sl);

libavcodec/h264_mb_template.c:275:1: Parameter `sl->list_count`
    273. #include "h264_mc_template.c"
    274. 
    275. static av_noinline void FUNC(hl_decode_mb_444)(const H264Context *h, H264SliceContext *sl)
         ^
    276. {
    277.     const int mb_x    = sl->mb_x;

libavcodec/h264_mb_template.c:358:13: Call
    356.                                linesize, 0, 1, SIMPLE, PIXEL_SHIFT);
    357.         } else {
    358.             FUNC(hl_motion_444)(h, sl, dest[0], dest[1], dest[2],
                     ^
    359.                       h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
    360.                       h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,

libavcodec/h264_mc_template.c:64:1: Parameter `sl->list_count`
      62. }
      63. 
      64. static void MCFUNC(hl_motion)(const H264Context *h, H264SliceContext *sl,
          ^
      65.                               uint8_t *dest_y,
      66.                               uint8_t *dest_cb, uint8_t *dest_cr,

libavcodec/h264_mc_template.c:80:9: Call
      78. 
      79.     if (HAVE_THREADS && (h->avctx->active_thread_type & FF_THREAD_FRAME))
      80.         await_references(h, sl);
                  ^
      81.     prefetch_motion(h, sl, 0, PIXEL_SHIFT, CHROMA_IDC);
      82. 

libavcodec/h264_mb.c:96:1: <LHS trace>
94.  * @param h the H264 context
95.  */
96. static void await_references(const H264Context *h, H264SliceContext *sl)
    ^
97. {
98.     const int mb_xy   = sl->mb_xy;

libavcodec/h264_mb.c:96:1: Parameter `sl->list_count`
        94.  * @param h the H264 context
        95.  */
        96. static void await_references(const H264Context *h, H264SliceContext *sl)
            ^
        97. {
        98.     const int mb_xy   = sl->mb_xy;

libavcodec/h264_mb.c:166:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_h264_hl_decode_mb` 
        164.     }
        165. 
        166.     for (list = sl->list_count - 1; list >= 0; list--)
                      ^
        167.         for (ref = 0; ref < 48 && nrefs[list]; ref++) {
        168.             int row = refs[list][ref];

static void await_references(const H264Context *h, H264SliceContext *sl)
{
    const int mb_xy   = sl->mb_xy;
    const int mb_type = h->cur_pic.mb_type[mb_xy];
    int refs[2][48];
    int nrefs[2] = { 0 };
    int ref, list;
    memset(refs, -1, sizeof(refs));
    if (IS_16X16(mb_type)) {
        get_lowest_part_y(h, sl, refs, 0, 16, 0,
                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
    } else if (IS_16X8(mb_type)) {
        get_lowest_part_y(h, sl, refs, 0, 8, 0,
                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
        get_lowest_part_y(h, sl, refs, 8, 8, 8,
                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
    } else if (IS_8X16(mb_type)) {
        get_lowest_part_y(h, sl, refs, 0, 16, 0,
                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
        get_lowest_part_y(h, sl, refs, 4, 16, 0,
                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
    } else {
        int i;
        assert(IS_8X8(mb_type));
        for (i = 0; i < 4; i++) {
            const int sub_mb_type = sl->sub_mb_type[i];
            const int n           = 4 * i;
            int y_offset          = (i & 2) << 2;
            if (IS_SUB_8X8(sub_mb_type)) {
                get_lowest_part_y(h, sl, refs, n, 8, y_offset,
                                  IS_DIR(sub_mb_type, 0, 0),
                                  IS_DIR(sub_mb_type, 0, 1),
                                  nrefs);
            } else if (IS_SUB_8X4(sub_mb_type)) {
                get_lowest_part_y(h, sl, refs, n, 4, y_offset,
                                  IS_DIR(sub_mb_type, 0, 0),
                                  IS_DIR(sub_mb_type, 0, 1),
                                  nrefs);
                get_lowest_part_y(h, sl, refs, n + 2, 4, y_offset + 4,
                                  IS_DIR(sub_mb_type, 0, 0),
                                  IS_DIR(sub_mb_type, 0, 1),
                                  nrefs);
            } else if (IS_SUB_4X8(sub_mb_type)) {
                get_lowest_part_y(h, sl, refs, n, 8, y_offset,
                                  IS_DIR(sub_mb_type, 0, 0),
                                  IS_DIR(sub_mb_type, 0, 1),
                                  nrefs);
                get_lowest_part_y(h, sl, refs, n + 1, 8, y_offset,
                                  IS_DIR(sub_mb_type, 0, 0),
                                  IS_DIR(sub_mb_type, 0, 1),
                                  nrefs);
            } else {
                int j;
                assert(IS_SUB_4X4(sub_mb_type));
                for (j = 0; j < 4; j++) {
                    int sub_y_offset = y_offset + 2 * (j & 2);
                    get_lowest_part_y(h, sl, refs, n + j, 4, sub_y_offset,
                                      IS_DIR(sub_mb_type, 0, 0),
                                      IS_DIR(sub_mb_type, 0, 1),
                                      nrefs);
                }
            }
        }
    }
    for (list = sl->list_count - 1; list >= 0; list--)
        for (ref = 0; ref < 48 && nrefs[list]; ref++) {
            int row = refs[list][ref];
            if (row >= 0) {
                H264Ref *ref_pic  = &sl->ref_list[list][ref];
                int ref_field         = ref_pic->reference - 1;
                int ref_field_picture = ref_pic->parent->field_picture;
                int pic_height        = 16 * h->mb_height >> ref_field_picture;
                row <<= MB_MBAFF(sl);
                nrefs[list]--;
                if (!FIELD_PICTURE(h) && ref_field_picture) {
                    ff_thread_await_progress(&ref_pic->parent->tf,
                                             FFMIN((row >> 1) - !(row & 1),
                                                   pic_height - 1),
                                             1);
                    ff_thread_await_progress(&ref_pic->parent->tf,
                                             FFMIN((row >> 1), pic_height - 1),
                                             0);
                } else if (FIELD_PICTURE(h) && !ref_field_picture) {
                    ff_thread_await_progress(&ref_pic->parent->tf,
                                             FFMIN(row * 2 + ref_field,
                                                   pic_height - 1),
                                             0);
                } else if (FIELD_PICTURE(h)) {
                    ff_thread_await_progress(&ref_pic->parent->tf,
                                             FFMIN(row, pic_height - 1),
                                             ref_field);
                } else {
                    ff_thread_await_progress(&ref_pic->parent->tf,
                                             FFMIN(row, pic_height - 1),
                                             0);
                }
            }
        }
}
['static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,\n                              int (*mv)[2][4][2],\n                              int mb_x, int mb_y, int mb_intra, int mb_skipped)\n{\n    H264Context *h = opaque;\n    H264SliceContext *sl = &h->slice_ctx[0];\n    sl->mb_x = mb_x;\n    sl->mb_y = mb_y;\n    sl->mb_xy = mb_x + mb_y * h->mb_stride;\n    memset(sl->non_zero_count_cache, 0, sizeof(sl->non_zero_count_cache));\n    assert(ref >= 0);\n    if (ref >= sl->ref_count[0])\n        ref = 0;\n    fill_rectangle(&h->cur_pic.ref_index[0][4 * sl->mb_xy],\n                   2, 2, 2, ref, 1);\n    fill_rectangle(&sl->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);\n    fill_rectangle(sl->mv_cache[0][scan8[0]], 4, 4, 8,\n                   pack16to32((*mv)[0][0][0], (*mv)[0][0][1]), 4);\n    assert(!FRAME_MBAFF(h));\n    ff_h264_hl_decode_mb(h, &h->slice_ctx[0]);\n}', 'void ff_h264_hl_decode_mb(const H264Context *h, H264SliceContext *sl)\n{\n    const int mb_xy   = sl->mb_xy;\n    const int mb_type = h->cur_pic.mb_type[mb_xy];\n    int is_complex    = CONFIG_SMALL || sl->is_complex ||\n                        IS_INTRA_PCM(mb_type) || sl->qscale == 0;\n    if (CHROMA444(h)) {\n        if (is_complex || h->pixel_shift)\n            hl_decode_mb_444_complex(h, sl);\n        else\n            hl_decode_mb_444_simple_8(h, sl);\n    } else if (is_complex) {\n        hl_decode_mb_complex(h, sl);\n    } else if (h->pixel_shift) {\n        hl_decode_mb_simple_16(h, sl);\n    } else\n        hl_decode_mb_simple_8(h, sl);\n}', 'static av_noinline void FUNC(hl_decode_mb_444)(const H264Context *h, H264SliceContext *sl)\n{\n    const int mb_x    = sl->mb_x;\n    const int mb_y    = sl->mb_y;\n    const int mb_xy   = sl->mb_xy;\n    const int mb_type = h->cur_pic.mb_type[mb_xy];\n    uint8_t *dest[3];\n    int linesize;\n    int i, j, p;\n    const int *block_offset = &h->block_offset[0];\n    const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->sps.transform_bypass);\n    const int plane_count      = (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) ? 3 : 1;\n    for (p = 0; p < plane_count; p++) {\n        dest[p] = h->cur_pic.f.data[p] +\n                  ((mb_x << PIXEL_SHIFT) + mb_y * sl->linesize) * 16;\n        h->vdsp.prefetch(dest[p] + (sl->mb_x & 3) * 4 * sl->linesize + (64 << PIXEL_SHIFT),\n                         sl->linesize, 4);\n    }\n    h->list_counts[mb_xy] = sl->list_count;\n    if (!SIMPLE && MB_FIELD(sl)) {\n        linesize     = sl->mb_linesize = sl->mb_uvlinesize = sl->linesize * 2;\n        block_offset = &h->block_offset[48];\n        if (mb_y & 1)\n            for (p = 0; p < 3; p++)\n                dest[p] -= sl->linesize * 15;\n        if (FRAME_MBAFF(h)) {\n            int list;\n            for (list = 0; list < sl->list_count; list++) {\n                if (!USES_LIST(mb_type, list))\n                    continue;\n                if (IS_16X16(mb_type)) {\n                    int8_t *ref = &sl->ref_cache[list][scan8[0]];\n                    fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (sl->mb_y & 1), 1);\n                } else {\n                    for (i = 0; i < 16; i += 4) {\n                        int ref = sl->ref_cache[list][scan8[i]];\n                        if (ref >= 0)\n                            fill_rectangle(&sl->ref_cache[list][scan8[i]], 2, 2,\n                                           8, (16 + ref) ^ (sl->mb_y & 1), 1);\n                    }\n                }\n            }\n        }\n    } else {\n        linesize = sl->mb_linesize = sl->mb_uvlinesize = sl->linesize;\n    }\n    if (!SIMPLE && IS_INTRA_PCM(mb_type)) {\n        if (PIXEL_SHIFT) {\n            const int bit_depth = h->sps.bit_depth_luma;\n            GetBitContext gb;\n            init_get_bits(&gb, sl->intra_pcm_ptr, 768 * bit_depth);\n            for (p = 0; p < plane_count; p++)\n                for (i = 0; i < 16; i++) {\n                    uint16_t *tmp = (uint16_t *)(dest[p] + i * linesize);\n                    for (j = 0; j < 16; j++)\n                        tmp[j] = get_bits(&gb, bit_depth);\n                }\n        } else {\n            for (p = 0; p < plane_count; p++)\n                for (i = 0; i < 16; i++)\n                    memcpy(dest[p] + i * linesize,\n                           sl->intra_pcm_ptr + p * 256 + i * 16, 16);\n        }\n    } else {\n        if (IS_INTRA(mb_type)) {\n            if (sl->deblocking_filter)\n                xchg_mb_border(h, sl, dest[0], dest[1], dest[2], linesize,\n                               linesize, 1, 1, SIMPLE, PIXEL_SHIFT);\n            for (p = 0; p < plane_count; p++)\n                hl_decode_mb_predict_luma(h, sl, mb_type, 1, SIMPLE,\n                                          transform_bypass, PIXEL_SHIFT,\n                                          block_offset, linesize, dest[p], p);\n            if (sl->deblocking_filter)\n                xchg_mb_border(h, sl, dest[0], dest[1], dest[2], linesize,\n                               linesize, 0, 1, SIMPLE, PIXEL_SHIFT);\n        } else {\n            FUNC(hl_motion_444)(h, sl, dest[0], dest[1], dest[2],\n                      h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,\n                      h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,\n                      h->h264dsp.weight_h264_pixels_tab,\n                      h->h264dsp.biweight_h264_pixels_tab);\n        }\n        for (p = 0; p < plane_count; p++)\n            hl_decode_mb_idct_luma(h, sl, mb_type, 1, SIMPLE, transform_bypass,\n                                   PIXEL_SHIFT, block_offset, linesize,\n                                   dest[p], p);\n    }\n}', 'static void MCFUNC(hl_motion)(const H264Context *h, H264SliceContext *sl,\n                              uint8_t *dest_y,\n                              uint8_t *dest_cb, uint8_t *dest_cr,\n                              qpel_mc_func(*qpix_put)[16],\n                              const h264_chroma_mc_func(*chroma_put),\n                              qpel_mc_func(*qpix_avg)[16],\n                              const h264_chroma_mc_func(*chroma_avg),\n                              const h264_weight_func *weight_op,\n                              const h264_biweight_func *weight_avg)\n{\n    const int mb_xy   = sl->mb_xy;\n    const int mb_type = h->cur_pic.mb_type[mb_xy];\n    assert(IS_INTER(mb_type));\n    if (HAVE_THREADS && (h->avctx->active_thread_type & FF_THREAD_FRAME))\n        await_references(h, sl);\n    prefetch_motion(h, sl, 0, PIXEL_SHIFT, CHROMA_IDC);\n    if (IS_16X16(mb_type)) {\n        mc_part(h, sl, 0, 1, 16, 0, dest_y, dest_cb, dest_cr, 0, 0,\n                qpix_put[0], chroma_put[0], qpix_avg[0], chroma_avg[0],\n                weight_op, weight_avg,\n                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));\n    } else if (IS_16X8(mb_type)) {\n        mc_part(h, sl, 0, 0, 8, 8 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr, 0, 0,\n                qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],\n                weight_op, weight_avg,\n                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));\n        mc_part(h, sl, 8, 0, 8, 8 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr, 0, 4,\n                qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],\n                weight_op, weight_avg,\n                IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));\n    } else if (IS_8X16(mb_type)) {\n        mc_part(h, sl, 0, 0, 16, 8 * sl->mb_linesize, dest_y, dest_cb, dest_cr, 0, 0,\n                qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],\n                &weight_op[1], &weight_avg[1],\n                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));\n        mc_part(h, sl, 4, 0, 16, 8 * sl->mb_linesize, dest_y, dest_cb, dest_cr, 4, 0,\n                qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],\n                &weight_op[1], &weight_avg[1],\n                IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));\n    } else {\n        int i;\n        assert(IS_8X8(mb_type));\n        for (i = 0; i < 4; i++) {\n            const int sub_mb_type = sl->sub_mb_type[i];\n            const int n  = 4 * i;\n            int x_offset = (i & 1) << 2;\n            int y_offset = (i & 2) << 1;\n            if (IS_SUB_8X8(sub_mb_type)) {\n                mc_part(h, sl, n, 1, 8, 0, dest_y, dest_cb, dest_cr,\n                        x_offset, y_offset,\n                        qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],\n                        &weight_op[1], &weight_avg[1],\n                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n            } else if (IS_SUB_8X4(sub_mb_type)) {\n                mc_part(h, sl, n, 0, 4, 4 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr,\n                        x_offset, y_offset,\n                        qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],\n                        &weight_op[1], &weight_avg[1],\n                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n                mc_part(h, sl, n + 2, 0, 4, 4 << PIXEL_SHIFT,\n                        dest_y, dest_cb, dest_cr, x_offset, y_offset + 2,\n                        qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],\n                        &weight_op[1], &weight_avg[1],\n                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n            } else if (IS_SUB_4X8(sub_mb_type)) {\n                mc_part(h, sl, n, 0, 8, 4 * sl->mb_linesize,\n                        dest_y, dest_cb, dest_cr, x_offset, y_offset,\n                        qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],\n                        &weight_op[2], &weight_avg[2],\n                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n                mc_part(h, sl, n + 1, 0, 8, 4 * sl->mb_linesize,\n                        dest_y, dest_cb, dest_cr, x_offset + 2, y_offset,\n                        qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],\n                        &weight_op[2], &weight_avg[2],\n                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n            } else {\n                int j;\n                assert(IS_SUB_4X4(sub_mb_type));\n                for (j = 0; j < 4; j++) {\n                    int sub_x_offset = x_offset + 2 * (j & 1);\n                    int sub_y_offset = y_offset + (j & 2);\n                    mc_part(h, sl, n + j, 1, 4, 0,\n                            dest_y, dest_cb, dest_cr, sub_x_offset, sub_y_offset,\n                            qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],\n                            &weight_op[2], &weight_avg[2],\n                            IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));\n                }\n            }\n        }\n    }\n    prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);\n}', 'static void await_references(const H264Context *h, H264SliceContext *sl)\n{\n    const int mb_xy   = sl->mb_xy;\n    const int mb_type = h->cur_pic.mb_type[mb_xy];\n    int refs[2][48];\n    int nrefs[2] = { 0 };\n    int ref, list;\n    memset(refs, -1, sizeof(refs));\n    if (IS_16X16(mb_type)) {\n        get_lowest_part_y(h, sl, refs, 0, 16, 0,\n                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);\n    } else if (IS_16X8(mb_type)) {\n        get_lowest_part_y(h, sl, refs, 0, 8, 0,\n                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);\n        get_lowest_part_y(h, sl, refs, 8, 8, 8,\n                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);\n    } else if (IS_8X16(mb_type)) {\n        get_lowest_part_y(h, sl, refs, 0, 16, 0,\n                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);\n        get_lowest_part_y(h, sl, refs, 4, 16, 0,\n                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);\n    } else {\n        int i;\n        assert(IS_8X8(mb_type));\n        for (i = 0; i < 4; i++) {\n            const int sub_mb_type = sl->sub_mb_type[i];\n            const int n           = 4 * i;\n            int y_offset          = (i & 2) << 2;\n            if (IS_SUB_8X8(sub_mb_type)) {\n                get_lowest_part_y(h, sl, refs, n, 8, y_offset,\n                                  IS_DIR(sub_mb_type, 0, 0),\n                                  IS_DIR(sub_mb_type, 0, 1),\n                                  nrefs);\n            } else if (IS_SUB_8X4(sub_mb_type)) {\n                get_lowest_part_y(h, sl, refs, n, 4, y_offset,\n                                  IS_DIR(sub_mb_type, 0, 0),\n                                  IS_DIR(sub_mb_type, 0, 1),\n                                  nrefs);\n                get_lowest_part_y(h, sl, refs, n + 2, 4, y_offset + 4,\n                                  IS_DIR(sub_mb_type, 0, 0),\n                                  IS_DIR(sub_mb_type, 0, 1),\n                                  nrefs);\n            } else if (IS_SUB_4X8(sub_mb_type)) {\n                get_lowest_part_y(h, sl, refs, n, 8, y_offset,\n                                  IS_DIR(sub_mb_type, 0, 0),\n                                  IS_DIR(sub_mb_type, 0, 1),\n                                  nrefs);\n                get_lowest_part_y(h, sl, refs, n + 1, 8, y_offset,\n                                  IS_DIR(sub_mb_type, 0, 0),\n                                  IS_DIR(sub_mb_type, 0, 1),\n                                  nrefs);\n            } else {\n                int j;\n                assert(IS_SUB_4X4(sub_mb_type));\n                for (j = 0; j < 4; j++) {\n                    int sub_y_offset = y_offset + 2 * (j & 2);\n                    get_lowest_part_y(h, sl, refs, n + j, 4, sub_y_offset,\n                                      IS_DIR(sub_mb_type, 0, 0),\n                                      IS_DIR(sub_mb_type, 0, 1),\n                                      nrefs);\n                }\n            }\n        }\n    }\n    for (list = sl->list_count - 1; list >= 0; list--)\n        for (ref = 0; ref < 48 && nrefs[list]; ref++) {\n            int row = refs[list][ref];\n            if (row >= 0) {\n                H264Ref *ref_pic  = &sl->ref_list[list][ref];\n                int ref_field         = ref_pic->reference - 1;\n                int ref_field_picture = ref_pic->parent->field_picture;\n                int pic_height        = 16 * h->mb_height >> ref_field_picture;\n                row <<= MB_MBAFF(sl);\n                nrefs[list]--;\n                if (!FIELD_PICTURE(h) && ref_field_picture) {\n                    ff_thread_await_progress(&ref_pic->parent->tf,\n                                             FFMIN((row >> 1) - !(row & 1),\n                                                   pic_height - 1),\n                                             1);\n                    ff_thread_await_progress(&ref_pic->parent->tf,\n                                             FFMIN((row >> 1), pic_height - 1),\n                                             0);\n                } else if (FIELD_PICTURE(h) && !ref_field_picture) {\n                    ff_thread_await_progress(&ref_pic->parent->tf,\n                                             FFMIN(row * 2 + ref_field,\n                                                   pic_height - 1),\n                                             0);\n                } else if (FIELD_PICTURE(h)) {\n                    ff_thread_await_progress(&ref_pic->parent->tf,\n                                             FFMIN(row, pic_height - 1),\n                                             ref_field);\n                } else {\n                    ff_thread_await_progress(&ref_pic->parent->tf,\n                                             FFMIN(row, pic_height - 1),\n                                             0);\n                }\n            }\n        }\n}']