static void frame_end(MpegEncContext *s)
{
    int i;
    if (s->unrestricted_mv &&
        s->current_picture.reference &&
        !s->intra_only) {
        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
        int hshift = desc->log2_chroma_w;
        int vshift = desc->log2_chroma_h;
        s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->linesize,
                                s->h_edge_pos, s->v_edge_pos,
                                EDGE_WIDTH, EDGE_WIDTH,
                                EDGE_TOP | EDGE_BOTTOM);
        s->mpvencdsp.draw_edges(s->current_picture.f->data[1], s->uvlinesize,
                                s->h_edge_pos >> hshift,
                                s->v_edge_pos >> vshift,
                                EDGE_WIDTH >> hshift,
                                EDGE_WIDTH >> vshift,
                                EDGE_TOP | EDGE_BOTTOM);
        s->mpvencdsp.draw_edges(s->current_picture.f->data[2], s->uvlinesize,
                                s->h_edge_pos >> hshift,
                                s->v_edge_pos >> vshift,
                                EDGE_WIDTH >> hshift,
                                EDGE_WIDTH >> vshift,
                                EDGE_TOP | EDGE_BOTTOM);
    }
    emms_c();
    s->last_pict_type                 = s->pict_type;
    s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;
    if (s->pict_type!= AV_PICTURE_TYPE_B)
        s->last_non_b_pict_type = s->pict_type;
    if (s->encoding) {
        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
            if (!s->picture[i].reference)
                ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
        }
    }
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
    av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
#if FF_API_ERROR_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
    memcpy(s->current_picture.f->error, s->current_picture.encoding_error,
           sizeof(s->current_picture.encoding_error));
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
['static void frame_end(MpegEncContext *s)\n{\n    int i;\n    if (s->unrestricted_mv &&\n        s->current_picture.reference &&\n        !s->intra_only) {\n        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);\n        int hshift = desc->log2_chroma_w;\n        int vshift = desc->log2_chroma_h;\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->linesize,\n                                s->h_edge_pos, s->v_edge_pos,\n                                EDGE_WIDTH, EDGE_WIDTH,\n                                EDGE_TOP | EDGE_BOTTOM);\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[1], s->uvlinesize,\n                                s->h_edge_pos >> hshift,\n                                s->v_edge_pos >> vshift,\n                                EDGE_WIDTH >> hshift,\n                                EDGE_WIDTH >> vshift,\n                                EDGE_TOP | EDGE_BOTTOM);\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[2], s->uvlinesize,\n                                s->h_edge_pos >> hshift,\n                                s->v_edge_pos >> vshift,\n                                EDGE_WIDTH >> hshift,\n                                EDGE_WIDTH >> vshift,\n                                EDGE_TOP | EDGE_BOTTOM);\n    }\n    emms_c();\n    s->last_pict_type                 = s->pict_type;\n    s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;\n    if (s->pict_type!= AV_PICTURE_TYPE_B)\n        s->last_non_b_pict_type = s->pict_type;\n    if (s->encoding) {\n        for (i = 0; i < MAX_PICTURE_COUNT; i++) {\n            if (!s->picture[i].reference)\n                ff_mpeg_unref_picture(s->avctx, &s->picture[i]);\n        }\n    }\n#if FF_API_CODED_FRAME\nFF_DISABLE_DEPRECATION_WARNINGS\n    av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n#if FF_API_ERROR_FRAME\nFF_DISABLE_DEPRECATION_WARNINGS\n    memcpy(s->current_picture.f->error, s->current_picture.encoding_error,\n           sizeof(s->current_picture.encoding_error));\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n}', 'const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)\n{\n    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)\n        return NULL;\n    return &av_pix_fmt_descriptors[pix_fmt];\n}']