libavcodec/h264.c:1046: error: Integer Overflow L2
  ([16, 4294967296] + 1):signed32 by call to `decode_nal_units`.

libavcodec/h264.c:1046:17: Call
1044.     }
1045. 
1046.     buf_index = decode_nal_units(h, buf, buf_size);
                      ^
1047.     if (buf_index < 0)
1048.         return AVERROR_INVALIDDATA;

libavcodec/h264.c:818:11: Call
  816.     }
  817. 
  818.     ret = ff_h2645_packet_split(&h->pkt, buf, buf_size, avctx, h->is_avc,
                 ^
  819.                                 h->nal_length_size, avctx->codec_id);
  820.     if (ret < 0) {

libavcodec/h2645_parse.c:260:15: Call
    258.         nal->size_bits = get_bit_length(nal, skip_trailing_zeros);
    259. 
    260.         ret = init_get_bits(&nal->gb, nal->data, nal->size_bits);
                       ^
    261.         if (ret < 0)
    262.             return ret;

libavcodec/get_bits.h:384:1: Parameter `bit_size`
      382.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
      383.  */
      384. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
           ^
      385.                                 int bit_size)
      386. {

libavcodec/get_bits.h:401:5: Assignment
      399.     s->size_in_bits       = bit_size;
      400. #if !UNCHECKED_BITSTREAM_READER
      401.     s->size_in_bits_plus8 = bit_size + 8;
               ^
      402. #endif
      403.     s->buffer_end         = buffer + buffer_size;

libavcodec/h264.c:1046:17: Call
1044.     }
1045. 
1046.     buf_index = decode_nal_units(h, buf, buf_size);
                      ^
1047.     if (buf_index < 0)
1048.         return AVERROR_INVALIDDATA;

libavcodec/h264.c:804:1: Parameter `*h->cur_pic.qscale_table`
  802. }
  803. 
  804. static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
       ^
  805. {
  806.     AVCodecContext *const avctx = h->avctx;

libavcodec/h264.c:950:15: Call
  948.     }
  949.     if (context_count) {
  950.         ret = ff_h264_execute_decode_slices(h, context_count);
                     ^
  951.         if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
  952.             goto end;

libavcodec/h264_slice.c:2113:1: Parameter `*h->cur_pic.qscale_table`
    2111.  * @param context_count number of contexts to execute
    2112.  */
    2113. int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
          ^
    2114. {
    2115.     AVCodecContext *const avctx = h->avctx;

libavcodec/h264_slice.c:2172:21: Call
    2170.                 for (j = sl->resync_mb_y; j < y_end; j += 1 + FIELD_OR_MBAFF_PICTURE(h)) {
    2171.                     sl->mb_y = j;
    2172.                     loop_filter(h, sl, j > sl->resync_mb_y ? 0 : sl->resync_mb_x,
                              ^
    2173.                                 j == y_end - 1 ? x_end : h->mb_width);
    2174.                 }

libavcodec/h264_slice.c:1788:1: Parameter `*h->cur_pic.qscale_table`
      1786. }
      1787. 
      1788. static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x, int end_x)
            ^
      1789. {
      1790.     uint8_t *dest_y, *dest_cb, *dest_cr;

libavcodec/h264_slice.c:1846:21: Call
      1844.                                       linesize, uvlinesize);
      1845.                 } else {
      1846.                     ff_h264_filter_mb_fast(h, sl, mb_x, mb_y, dest_y, dest_cb,
                                ^
      1847.                                            dest_cr, linesize, uvlinesize);
      1848.                 }

libavcodec/h264_loopfilter.c:419:1: Parameter `*h->cur_pic.qscale_table`
        417. }
        418. 
        419. void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl,
             ^
        420.                             int mb_x, int mb_y, uint8_t *img_y,
        421.                             uint8_t *img_cb, uint8_t *img_cr,

libavcodec/h264_loopfilter.c:434:9: Call
        432. #else
        433.     if(h->pixel_shift){
        434.         h264_filter_mb_fast_internal(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 1);
                     ^
        435.     }else{
        436.         h264_filter_mb_fast_internal(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 0);

libavcodec/h264_loopfilter.c:237:1: <LHS trace>
235. }
236. 
237. static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
     ^
238.                                                           H264SliceContext *sl,
239.                                                           int mb_x, int mb_y,

libavcodec/h264_loopfilter.c:237:1: Parameter `*h->cur_pic.qscale_table`
          235. }
          236. 
          237. static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
               ^
          238.                                                           H264SliceContext *sl,
          239.                                                           int mb_x, int mb_y,

libavcodec/h264_loopfilter.c:260:5: Assignment
          258. 
          259.     int mb_type = h->cur_pic.mb_type[mb_xy];
          260.     int qp      = h->cur_pic.qscale_table[mb_xy];
                   ^
          261.     int qp0     = h->cur_pic.qscale_table[mb_xy - 1];
          262.     int qp1     = h->cur_pic.qscale_table[sl->top_mb_xy];

libavcodec/h264_loopfilter.c:266:5: Binary operation: ([16, 4294967296] + 1):signed32 by call to `decode_nal_units` 
          264.     int qpc0 = get_chroma_qp( h, 0, qp0 );
          265.     int qpc1 = get_chroma_qp( h, 0, qp1 );
          266.     qp0 = (qp + qp0 + 1) >> 1;
                   ^
          267.     qp1 = (qp + qp1 + 1) >> 1;
          268.     qpc0 = (qpc + qpc0 + 1) >> 1;

static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
                                                          H264SliceContext *sl,
                                                          int mb_x, int mb_y,
                                                          uint8_t *img_y,
                                                          uint8_t *img_cb,
                                                          uint8_t *img_cr,
                                                          unsigned int linesize,
                                                          unsigned int uvlinesize,
                                                          int pixel_shift)
{
    int chroma = !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
    int chroma444 = CHROMA444(h);
    int chroma422 = CHROMA422(h);
    int mb_xy = sl->mb_xy;
    int left_type = sl->left_type[LTOP];
    int top_type  = sl->top_type;
    int qp_bd_offset = 6 * (h->ps.sps->bit_depth_luma - 8);
    int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset;
    int b = 52 + sl->slice_beta_offset - qp_bd_offset;
    int mb_type = h->cur_pic.mb_type[mb_xy];
    int qp      = h->cur_pic.qscale_table[mb_xy];
    int qp0     = h->cur_pic.qscale_table[mb_xy - 1];
    int qp1     = h->cur_pic.qscale_table[sl->top_mb_xy];
    int qpc = get_chroma_qp( h, 0, qp );
    int qpc0 = get_chroma_qp( h, 0, qp0 );
    int qpc1 = get_chroma_qp( h, 0, qp1 );
    qp0 = (qp + qp0 + 1) >> 1;
    qp1 = (qp + qp1 + 1) >> 1;
    qpc0 = (qpc + qpc0 + 1) >> 1;
    qpc1 = (qpc + qpc1 + 1) >> 1;
    if( IS_INTRA(mb_type) ) {
        static const int16_t bS4[4] = {4,4,4,4};
        static const int16_t bS3[4] = {3,3,3,3};
        const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4;
        if(left_type)
            filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1);
        if( IS_8x8DCT(mb_type) ) {
            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
            if(top_type){
                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
            }
            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);
        } else {
            filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
            filter_mb_edgev( &img_y[4*3<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
            if(top_type){
                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
            }
            filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, a, b, h, 0);
            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);
            filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, a, b, h, 0);
        }
        if(chroma){
            if(chroma444){
                if(left_type){
                    filter_mb_edgev( &img_cb[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
                    filter_mb_edgev( &img_cr[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
                }
                if( IS_8x8DCT(mb_type) ) {
                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    if(top_type){
                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
                    }
                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
                } else {
                    filter_mb_edgev( &img_cb[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cr[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cb[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgev( &img_cr[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
                    if(top_type){
                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
                    }
                    filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cb[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
                    filter_mb_edgeh( &img_cr[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
                }
            }else if(chroma422){
                if(left_type){
                    filter_mb_edgecv(&img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
                    filter_mb_edgecv(&img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
                }
                filter_mb_edgecv(&img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgecv(&img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
                if(top_type){
                    filter_mb_edgech(&img_cb[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
                    filter_mb_edgech(&img_cr[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
                }
                filter_mb_edgech(&img_cb[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech(&img_cr[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech(&img_cb[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech(&img_cr[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech(&img_cb[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech(&img_cr[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
            }else{
                if(left_type){
                    filter_mb_edgecv( &img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
                    filter_mb_edgecv( &img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
                }
                filter_mb_edgecv( &img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgecv( &img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
                if(top_type){
                    filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
                    filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
                }
                filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
                filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
            }
        }
        return;
    } else {
        LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);
        int edges;
        if( IS_8x8DCT(mb_type) && (sl->cbp&7) == 7 && !chroma444 ) {
            edges = 4;
            AV_WN64A(bS[0][0], 0x0002000200020002ULL);
            AV_WN64A(bS[0][2], 0x0002000200020002ULL);
            AV_WN64A(bS[1][0], 0x0002000200020002ULL);
            AV_WN64A(bS[1][2], 0x0002000200020002ULL);
        } else {
            int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4);
            int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1);
            int step =  1+(mb_type>>24);
            edges = 4 - 3*((mb_type>>3) & !(sl->cbp & 15));
            h->h264dsp.h264_loop_filter_strength(bS, sl->non_zero_count_cache, sl->ref_cache, sl->mv_cache,
                                                 sl->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h));
        }
        if( IS_INTRA(left_type) )
            AV_WN64A(bS[0][0], 0x0004000400040004ULL);
        if( IS_INTRA(top_type) )
            AV_WN64A(bS[1][0], FIELD_PICTURE(h) ? 0x0003000300030003ULL : 0x0004000400040004ULL);
#define FILTER(hv,dir,edge,intra)\
        if(AV_RN64A(bS[dir][edge])) {                                   \
            filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qp : qp##dir, a, b, h, intra );\
            if(chroma){\
                if(chroma444){\
                    filter_mb_edge##hv( &img_cb[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
                    filter_mb_edge##hv( &img_cr[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
                } else if(!(edge&1)) {\
                    filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
                    filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
                }\
            }\
        }
        if(left_type)
            FILTER(v,0,0,1);
        if( edges == 1 ) {
            if(top_type)
                FILTER(h,1,0,1);
        } else if( IS_8x8DCT(mb_type) ) {
            FILTER(v,0,2,0);
            if(top_type)
                FILTER(h,1,0,1);
            FILTER(h,1,2,0);
        } else {
            FILTER(v,0,1,0);
            FILTER(v,0,2,0);
            FILTER(v,0,3,0);
            if(top_type)
                FILTER(h,1,0,1);
            FILTER(h,1,1,0);
            FILTER(h,1,2,0);
            FILTER(h,1,3,0);
        }
#undef FILTER
    }
}
['static int h264_decode_frame(AVCodecContext *avctx, void *data,\n                             int *got_frame, AVPacket *avpkt)\n{\n    const uint8_t *buf = avpkt->data;\n    int buf_size       = avpkt->size;\n    H264Context *h     = avctx->priv_data;\n    AVFrame *pict      = data;\n    int buf_index      = 0;\n    int ret;\n    h->flags = avctx->flags;\n    h->setup_finished = 0;\nout:\n    if (buf_size == 0) {\n        H264Picture *out;\n        int i, out_idx;\n        h->cur_pic_ptr = NULL;\n        out     = h->delayed_pic[0];\n        out_idx = 0;\n        for (i = 1;\n             h->delayed_pic[i] &&\n             !h->delayed_pic[i]->f->key_frame &&\n             !h->delayed_pic[i]->mmco_reset;\n             i++)\n            if (h->delayed_pic[i]->poc < out->poc) {\n                out     = h->delayed_pic[i];\n                out_idx = i;\n            }\n        for (i = out_idx; h->delayed_pic[i]; i++)\n            h->delayed_pic[i] = h->delayed_pic[i + 1];\n        if (out) {\n            ret = output_frame(h, pict, out->f);\n            if (ret < 0)\n                return ret;\n            *got_frame = 1;\n        }\n        return buf_index;\n    }\n    buf_index = decode_nal_units(h, buf, buf_size);\n    if (buf_index < 0)\n        return AVERROR_INVALIDDATA;\n    if (!h->cur_pic_ptr && h->nal_unit_type == NAL_END_SEQUENCE) {\n        buf_size = 0;\n        goto out;\n    }\n    if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) && !h->cur_pic_ptr) {\n        if (avctx->skip_frame >= AVDISCARD_NONREF)\n            return 0;\n        av_log(avctx, AV_LOG_ERROR, "no frame!\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) ||\n        (h->mb_y >= h->mb_height && h->mb_height)) {\n        if (avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)\n            decode_postinit(h, 1);\n        ff_h264_field_end(h, &h->slice_ctx[0], 0);\n        *got_frame = 0;\n        if (h->next_output_pic && ((avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) ||\n                                   h->next_output_pic->recovered)) {\n            if (!h->next_output_pic->recovered)\n                h->next_output_pic->f->flags |= AV_FRAME_FLAG_CORRUPT;\n            ret = output_frame(h, pict, h->next_output_pic->f);\n            if (ret < 0)\n                return ret;\n            *got_frame = 1;\n        }\n    }\n    assert(pict->buf[0] || !*got_frame);\n    return get_consumed_bytes(buf_index, buf_size);\n}', 'static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)\n{\n    AVCodecContext *const avctx = h->avctx;\n    unsigned context_count = 0;\n    int nals_needed = 0;\n    int i, ret = 0;\n    if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {\n        h->current_slice = 0;\n        if (!h->first_field)\n            h->cur_pic_ptr = NULL;\n        ff_h264_sei_uninit(&h->sei);\n    }\n    ret = ff_h2645_packet_split(&h->pkt, buf, buf_size, avctx, h->is_avc,\n                                h->nal_length_size, avctx->codec_id);\n    if (ret < 0) {\n        av_log(avctx, AV_LOG_ERROR,\n               "Error splitting the input into NAL units.\\n");\n        return ret;\n    }\n    if (avctx->active_thread_type & FF_THREAD_FRAME)\n        nals_needed = get_last_needed_nal(h);\n    for (i = 0; i < h->pkt.nb_nals; i++) {\n        H2645NAL *nal = &h->pkt.nals[i];\n        H264SliceContext *sl = &h->slice_ctx[context_count];\n        int err;\n        if (avctx->skip_frame >= AVDISCARD_NONREF &&\n            nal->ref_idc == 0 && nal->type != NAL_SEI)\n            continue;\n        h->nal_ref_idc   = nal->ref_idc;\n        h->nal_unit_type = nal->type;\n        err = 0;\n        switch (nal->type) {\n        case NAL_IDR_SLICE:\n            if (nal->type != NAL_IDR_SLICE) {\n                av_log(h->avctx, AV_LOG_ERROR,\n                       "Invalid mix of idr and non-idr slices\\n");\n                ret = -1;\n                goto end;\n            }\n            idr(h);\n        case NAL_SLICE:\n            sl->gb = nal->gb;\n            if ((err = ff_h264_decode_slice_header(h, sl)))\n                break;\n            if (h->sei.recovery_point.recovery_frame_cnt >= 0 && h->recovery_frame < 0) {\n                h->recovery_frame = (h->poc.frame_num + h->sei.recovery_point.recovery_frame_cnt) &\n                                    ((1 << h->ps.sps->log2_max_frame_num) - 1);\n            }\n            h->cur_pic_ptr->f->key_frame |=\n                (nal->type == NAL_IDR_SLICE) || (h->sei.recovery_point.recovery_frame_cnt >= 0);\n            if (nal->type == NAL_IDR_SLICE || h->recovery_frame == h->poc.frame_num) {\n                h->recovery_frame         = -1;\n                h->cur_pic_ptr->recovered = 1;\n            }\n            if (nal->type == NAL_IDR_SLICE)\n                h->frame_recovered |= FRAME_RECOVERED_IDR;\n            h->cur_pic_ptr->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_IDR);\n            if (h->current_slice == 1) {\n                if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS))\n                    decode_postinit(h, i >= nals_needed);\n                if (h->avctx->hwaccel &&\n                    (ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0)) < 0)\n                    return ret;\n            }\n            if (sl->redundant_pic_count == 0 &&\n                (avctx->skip_frame < AVDISCARD_NONREF || nal->ref_idc) &&\n                (avctx->skip_frame < AVDISCARD_BIDIR  ||\n                 sl->slice_type_nos != AV_PICTURE_TYPE_B) &&\n                (avctx->skip_frame < AVDISCARD_NONKEY ||\n                 h->cur_pic_ptr->f->key_frame) &&\n                avctx->skip_frame < AVDISCARD_ALL) {\n                if (avctx->hwaccel) {\n                    ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size);\n                    if (ret < 0)\n                        return ret;\n                } else\n                    context_count++;\n            }\n            break;\n        case NAL_DPA:\n        case NAL_DPB:\n        case NAL_DPC:\n            avpriv_request_sample(avctx, "data partitioning");\n            ret = AVERROR(ENOSYS);\n            goto end;\n            break;\n        case NAL_SEI:\n            ret = ff_h264_sei_decode(&h->sei, &nal->gb, &h->ps, avctx);\n            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))\n                goto end;\n            break;\n        case NAL_SPS:\n            ret = ff_h264_decode_seq_parameter_set(&nal->gb, avctx, &h->ps);\n            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))\n                goto end;\n            break;\n        case NAL_PPS:\n            ret = ff_h264_decode_picture_parameter_set(&nal->gb, avctx, &h->ps,\n                                                       nal->size_bits);\n            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))\n                goto end;\n            break;\n        case NAL_AUD:\n        case NAL_END_SEQUENCE:\n        case NAL_END_STREAM:\n        case NAL_FILLER_DATA:\n        case NAL_SPS_EXT:\n        case NAL_AUXILIARY_SLICE:\n            break;\n        case NAL_FF_IGNORE:\n            break;\n        default:\n            av_log(avctx, AV_LOG_DEBUG, "Unknown NAL code: %d (%d bits)\\n",\n                   nal->type, nal->size_bits);\n        }\n        if (context_count == h->nb_slice_ctx) {\n            ret = ff_h264_execute_decode_slices(h, context_count);\n            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))\n                goto end;\n            context_count = 0;\n        }\n        if (err < 0) {\n            av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\\n");\n            sl->ref_count[0] = sl->ref_count[1] = sl->list_count = 0;\n        }\n    }\n    if (context_count) {\n        ret = ff_h264_execute_decode_slices(h, context_count);\n        if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))\n            goto end;\n    }\n    ret = 0;\nend:\n    if (h->cur_pic_ptr && !h->droppable) {\n        ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,\n                                  h->picture_structure == PICT_BOTTOM_FIELD);\n    }\n    return (ret < 0) ? ret : buf_size;\n}', 'int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,\n                          void *logctx, int is_nalff, int nal_length_size,\n                          enum AVCodecID codec_id)\n{\n    int consumed, ret = 0;\n    pkt->nb_nals = 0;\n    while (length >= 4) {\n        H2645NAL *nal;\n        int extract_length = 0;\n        int skip_trailing_zeros = 1;\n        if (is_nalff) {\n            int i;\n            for (i = 0; i < nal_length_size; i++)\n                extract_length = (extract_length << 8) | buf[i];\n            buf    += nal_length_size;\n            length -= nal_length_size;\n            if (extract_length > length) {\n                av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit size.\\n");\n                return AVERROR_INVALIDDATA;\n            }\n        } else {\n            if (buf[2] == 0) {\n                length--;\n                buf++;\n                continue;\n            }\n            if (buf[0] != 0 || buf[1] != 0 || buf[2] != 1)\n                return AVERROR_INVALIDDATA;\n            buf           += 3;\n            length        -= 3;\n            extract_length = length;\n        }\n        if (pkt->nals_allocated < pkt->nb_nals + 1) {\n            int new_size = pkt->nals_allocated + 1;\n            H2645NAL *tmp = av_realloc_array(pkt->nals, new_size, sizeof(*tmp));\n            if (!tmp)\n                return AVERROR(ENOMEM);\n            pkt->nals = tmp;\n            memset(pkt->nals + pkt->nals_allocated, 0,\n                   (new_size - pkt->nals_allocated) * sizeof(*tmp));\n            pkt->nals_allocated = new_size;\n        }\n        nal = &pkt->nals[pkt->nb_nals++];\n        consumed = ff_h2645_extract_rbsp(buf, extract_length, nal);\n        if (consumed < 0)\n            return consumed;\n        if (consumed < length - 3 &&\n            buf[consumed]     == 0x00 && buf[consumed + 1] == 0x00 &&\n            buf[consumed + 2] == 0x01 && buf[consumed + 3] == 0xE0)\n            skip_trailing_zeros = 0;\n        nal->size_bits = get_bit_length(nal, skip_trailing_zeros);\n        ret = init_get_bits(&nal->gb, nal->data, nal->size_bits);\n        if (ret < 0)\n            return ret;\n        if (codec_id == AV_CODEC_ID_HEVC)\n            ret = hevc_parse_nal_header(nal, logctx);\n        else\n            ret = h264_parse_nal_header(nal, logctx);\n        if (ret <= 0) {\n            if (ret < 0) {\n                av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\\n",\n                       nal->type);\n            }\n            pkt->nb_nals--;\n        }\n        buf    += consumed;\n        length -= consumed;\n    }\n    return 0;\n}', 'static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,\n                                int bit_size)\n{\n    int buffer_size;\n    int ret = 0;\n    if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {\n        bit_size    = 0;\n        buffer      = NULL;\n        ret         = AVERROR_INVALIDDATA;\n    }\n    buffer_size = (bit_size + 7) >> 3;\n    s->buffer             = buffer;\n    s->size_in_bits       = bit_size;\n#if !UNCHECKED_BITSTREAM_READER\n    s->size_in_bits_plus8 = bit_size + 8;\n#endif\n    s->buffer_end         = buffer + buffer_size;\n    s->index              = 0;\n    return ret;\n}', 'int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)\n{\n    AVCodecContext *const avctx = h->avctx;\n    H264SliceContext *sl;\n    int i, j;\n    if (h->avctx->hwaccel)\n        return 0;\n    if (context_count == 1) {\n        int ret;\n        h->slice_ctx[0].next_slice_idx = h->mb_width * h->mb_height;\n        h->postpone_filter = 0;\n        ret = decode_slice(avctx, &h->slice_ctx[0]);\n        h->mb_y = h->slice_ctx[0].mb_y;\n        return ret;\n    } else {\n        for (i = 0; i < context_count; i++) {\n            int next_slice_idx = h->mb_width * h->mb_height;\n            int slice_idx;\n            sl                 = &h->slice_ctx[i];\n            sl->er.error_count = 0;\n            slice_idx = sl->mb_y * h->mb_width + sl->mb_x;\n            for (j = 0; j < context_count; j++) {\n                H264SliceContext *sl2 = &h->slice_ctx[j];\n                int        slice_idx2 = sl2->mb_y * h->mb_width + sl2->mb_x;\n                if (i == j || slice_idx2 < slice_idx)\n                    continue;\n                next_slice_idx = FFMIN(next_slice_idx, slice_idx2);\n            }\n            sl->next_slice_idx = next_slice_idx;\n        }\n        avctx->execute(avctx, decode_slice, h->slice_ctx,\n                       NULL, context_count, sizeof(h->slice_ctx[0]));\n        sl                   = &h->slice_ctx[context_count - 1];\n        h->mb_y              = sl->mb_y;\n        for (i = 1; i < context_count; i++)\n            h->slice_ctx[0].er.error_count += h->slice_ctx[i].er.error_count;\n        if (h->postpone_filter) {\n            h->postpone_filter = 0;\n            for (i = 0; i < context_count; i++) {\n                int y_end, x_end;\n                sl = &h->slice_ctx[i];\n                y_end = FFMIN(sl->mb_y + 1, h->mb_height);\n                x_end = (sl->mb_y >= h->mb_height) ? h->mb_width : sl->mb_x;\n                for (j = sl->resync_mb_y; j < y_end; j += 1 + FIELD_OR_MBAFF_PICTURE(h)) {\n                    sl->mb_y = j;\n                    loop_filter(h, sl, j > sl->resync_mb_y ? 0 : sl->resync_mb_x,\n                                j == y_end - 1 ? x_end : h->mb_width);\n                }\n            }\n        }\n    }\n    return 0;\n}', 'static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x, int end_x)\n{\n    uint8_t *dest_y, *dest_cb, *dest_cr;\n    int linesize, uvlinesize, mb_x, mb_y;\n    const int end_mb_y       = sl->mb_y + FRAME_MBAFF(h);\n    const int old_slice_type = sl->slice_type;\n    const int pixel_shift    = h->pixel_shift;\n    const int block_h        = 16 >> h->chroma_y_shift;\n    if (h->postpone_filter)\n        return;\n    if (sl->deblocking_filter) {\n        for (mb_x = start_x; mb_x < end_x; mb_x++)\n            for (mb_y = end_mb_y - FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {\n                int mb_xy, mb_type;\n                mb_xy         = sl->mb_xy = mb_x + mb_y * h->mb_stride;\n                mb_type       = h->cur_pic.mb_type[mb_xy];\n                if (FRAME_MBAFF(h))\n                    sl->mb_mbaff               =\n                    sl->mb_field_decoding_flag = !!IS_INTERLACED(mb_type);\n                sl->mb_x = mb_x;\n                sl->mb_y = mb_y;\n                dest_y  = h->cur_pic.f->data[0] +\n                          ((mb_x << pixel_shift) + mb_y * sl->linesize) * 16;\n                dest_cb = h->cur_pic.f->data[1] +\n                          (mb_x << pixel_shift) * (8 << CHROMA444(h)) +\n                          mb_y * sl->uvlinesize * block_h;\n                dest_cr = h->cur_pic.f->data[2] +\n                          (mb_x << pixel_shift) * (8 << CHROMA444(h)) +\n                          mb_y * sl->uvlinesize * block_h;\n                if (MB_FIELD(sl)) {\n                    linesize   = sl->mb_linesize   = sl->linesize   * 2;\n                    uvlinesize = sl->mb_uvlinesize = sl->uvlinesize * 2;\n                    if (mb_y & 1) {\n                        dest_y  -= sl->linesize   * 15;\n                        dest_cb -= sl->uvlinesize * (block_h - 1);\n                        dest_cr -= sl->uvlinesize * (block_h - 1);\n                    }\n                } else {\n                    linesize   = sl->mb_linesize   = sl->linesize;\n                    uvlinesize = sl->mb_uvlinesize = sl->uvlinesize;\n                }\n                backup_mb_border(h, sl, dest_y, dest_cb, dest_cr, linesize,\n                                 uvlinesize, 0);\n                if (fill_filter_caches(h, sl, mb_type))\n                    continue;\n                sl->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]);\n                sl->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]);\n                if (FRAME_MBAFF(h)) {\n                    ff_h264_filter_mb(h, sl, mb_x, mb_y, dest_y, dest_cb, dest_cr,\n                                      linesize, uvlinesize);\n                } else {\n                    ff_h264_filter_mb_fast(h, sl, mb_x, mb_y, dest_y, dest_cb,\n                                           dest_cr, linesize, uvlinesize);\n                }\n            }\n    }\n    sl->slice_type  = old_slice_type;\n    sl->mb_x         = end_x;\n    sl->mb_y         = end_mb_y - FRAME_MBAFF(h);\n    sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);\n    sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);\n}', 'void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl,\n                            int mb_x, int mb_y, uint8_t *img_y,\n                            uint8_t *img_cb, uint8_t *img_cr,\n                            unsigned int linesize, unsigned int uvlinesize)\n{\n    assert(!FRAME_MBAFF(h));\n    if(!h->h264dsp.h264_loop_filter_strength || h->ps.pps->chroma_qp_diff) {\n        ff_h264_filter_mb(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);\n        return;\n    }\n#if CONFIG_SMALL\n    h264_filter_mb_fast_internal(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, h->pixel_shift);\n#else\n    if(h->pixel_shift){\n        h264_filter_mb_fast_internal(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 1);\n    }else{\n        h264_filter_mb_fast_internal(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 0);\n    }\n#endif\n}', 'static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,\n                                                          H264SliceContext *sl,\n                                                          int mb_x, int mb_y,\n                                                          uint8_t *img_y,\n                                                          uint8_t *img_cb,\n                                                          uint8_t *img_cr,\n                                                          unsigned int linesize,\n                                                          unsigned int uvlinesize,\n                                                          int pixel_shift)\n{\n    int chroma = !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));\n    int chroma444 = CHROMA444(h);\n    int chroma422 = CHROMA422(h);\n    int mb_xy = sl->mb_xy;\n    int left_type = sl->left_type[LTOP];\n    int top_type  = sl->top_type;\n    int qp_bd_offset = 6 * (h->ps.sps->bit_depth_luma - 8);\n    int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset;\n    int b = 52 + sl->slice_beta_offset - qp_bd_offset;\n    int mb_type = h->cur_pic.mb_type[mb_xy];\n    int qp      = h->cur_pic.qscale_table[mb_xy];\n    int qp0     = h->cur_pic.qscale_table[mb_xy - 1];\n    int qp1     = h->cur_pic.qscale_table[sl->top_mb_xy];\n    int qpc = get_chroma_qp( h, 0, qp );\n    int qpc0 = get_chroma_qp( h, 0, qp0 );\n    int qpc1 = get_chroma_qp( h, 0, qp1 );\n    qp0 = (qp + qp0 + 1) >> 1;\n    qp1 = (qp + qp1 + 1) >> 1;\n    qpc0 = (qpc + qpc0 + 1) >> 1;\n    qpc1 = (qpc + qpc1 + 1) >> 1;\n    if( IS_INTRA(mb_type) ) {\n        static const int16_t bS4[4] = {4,4,4,4};\n        static const int16_t bS3[4] = {3,3,3,3};\n        const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4;\n        if(left_type)\n            filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1);\n        if( IS_8x8DCT(mb_type) ) {\n            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            if(top_type){\n                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);\n            }\n            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);\n        } else {\n            filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgev( &img_y[4*3<<pixel_shift], linesize, bS3, qp, a, b, h, 0);\n            if(top_type){\n                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);\n            }\n            filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);\n            filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, a, b, h, 0);\n        }\n        if(chroma){\n            if(chroma444){\n                if(left_type){\n                    filter_mb_edgev( &img_cb[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgev( &img_cr[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);\n                }\n                if( IS_8x8DCT(mb_type) ) {\n                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    if(top_type){\n                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );\n                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );\n                    }\n                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                } else {\n                    filter_mb_edgev( &img_cb[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cb[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgev( &img_cr[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);\n                    if(top_type){\n                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);\n                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);\n                    }\n                    filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cb[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);\n                    filter_mb_edgeh( &img_cr[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);\n                }\n            }else if(chroma422){\n                if(left_type){\n                    filter_mb_edgecv(&img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgecv(&img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                }\n                filter_mb_edgecv(&img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgecv(&img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                if(top_type){\n                    filter_mb_edgech(&img_cb[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                    filter_mb_edgech(&img_cr[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                }\n                filter_mb_edgech(&img_cb[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cb[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cb[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech(&img_cr[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n            }else{\n                if(left_type){\n                    filter_mb_edgecv( &img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                    filter_mb_edgecv( &img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);\n                }\n                filter_mb_edgecv( &img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgecv( &img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);\n                if(top_type){\n                    filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                    filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);\n                }\n                filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n                filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);\n            }\n        }\n        return;\n    } else {\n        LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);\n        int edges;\n        if( IS_8x8DCT(mb_type) && (sl->cbp&7) == 7 && !chroma444 ) {\n            edges = 4;\n            AV_WN64A(bS[0][0], 0x0002000200020002ULL);\n            AV_WN64A(bS[0][2], 0x0002000200020002ULL);\n            AV_WN64A(bS[1][0], 0x0002000200020002ULL);\n            AV_WN64A(bS[1][2], 0x0002000200020002ULL);\n        } else {\n            int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4);\n            int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1);\n            int step =  1+(mb_type>>24);\n            edges = 4 - 3*((mb_type>>3) & !(sl->cbp & 15));\n            h->h264dsp.h264_loop_filter_strength(bS, sl->non_zero_count_cache, sl->ref_cache, sl->mv_cache,\n                                                 sl->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h));\n        }\n        if( IS_INTRA(left_type) )\n            AV_WN64A(bS[0][0], 0x0004000400040004ULL);\n        if( IS_INTRA(top_type) )\n            AV_WN64A(bS[1][0], FIELD_PICTURE(h) ? 0x0003000300030003ULL : 0x0004000400040004ULL);\n#define FILTER(hv,dir,edge,intra)\\\n        if(AV_RN64A(bS[dir][edge])) {                                   \\\n            filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qp : qp##dir, a, b, h, intra );\\\n            if(chroma){\\\n                if(chroma444){\\\n                    filter_mb_edge##hv( &img_cb[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                    filter_mb_edge##hv( &img_cr[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                } else if(!(edge&1)) {\\\n                    filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                    filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\\\n                }\\\n            }\\\n        }\n        if(left_type)\n            FILTER(v,0,0,1);\n        if( edges == 1 ) {\n            if(top_type)\n                FILTER(h,1,0,1);\n        } else if( IS_8x8DCT(mb_type) ) {\n            FILTER(v,0,2,0);\n            if(top_type)\n                FILTER(h,1,0,1);\n            FILTER(h,1,2,0);\n        } else {\n            FILTER(v,0,1,0);\n            FILTER(v,0,2,0);\n            FILTER(v,0,3,0);\n            if(top_type)\n                FILTER(h,1,0,1);\n            FILTER(h,1,1,0);\n            FILTER(h,1,2,0);\n            FILTER(h,1,3,0);\n        }\n#undef FILTER\n    }\n}']