static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
{
    AVFrame *src = srcp->f;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format);
    int i;
    int ret = av_frame_ref(dst, src);
    if (ret < 0)
        return ret;
    av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
    if (srcp->sei_recovery_frame_cnt == 0)
        dst->key_frame = 1;
    if (!srcp->crop)
        return 0;
    for (i = 0; i < desc->nb_components; i++) {
        int hshift = (i > 0) ? desc->log2_chroma_w : 0;
        int vshift = (i > 0) ? desc->log2_chroma_h : 0;
        int off    = ((srcp->crop_left >> hshift) << h->pixel_shift) +
                      (srcp->crop_top  >> vshift) * dst->linesize[i];
        dst->data[i] += off;
    }
    return 0;
}
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
{
    AVFrame *src = srcp->f;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format);
    int i;
    int ret = av_frame_ref(dst, src);
    if (ret < 0)
        return ret;
    av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
    if (srcp->sei_recovery_frame_cnt == 0)
        dst->key_frame = 1;
    if (!srcp->crop)
        return 0;
    for (i = 0; i < desc->nb_components; i++) {
        int hshift = (i > 0) ? desc->log2_chroma_w : 0;
        int vshift = (i > 0) ? desc->log2_chroma_h : 0;
        int off    = ((srcp->crop_left >> hshift) << h->pixel_shift) +
                      (srcp->crop_top  >> vshift) * dst->linesize[i];
        dst->data[i] += off;
    }
    return 0;
}
static int FUNC_0(H264Context *VAR_0, AVFrame *VAR_1, H264Picture *VAR_2)
{
    AVFrame *src = VAR_2->f;
    const AVPixFmtDescriptor *VAR_3 = av_pix_fmt_desc_get(src->format);
    int VAR_4;
    int VAR_5 = av_frame_ref(VAR_1, src);
    if (VAR_5 < 0)
        return VAR_5;
    av_dict_set(&VAR_1->metadata, "stereo_mode", ff_h264_sei_stereo_mode(VAR_0), 0);
    if (VAR_2->sei_recovery_frame_cnt == 0)
        VAR_1->key_frame = 1;
    if (!VAR_2->crop)
        return 0;
    for (VAR_4 = 0; VAR_4 < VAR_3->nb_components; VAR_4++) {
        int hshift = (VAR_4 > 0) ? VAR_3->log2_chroma_w : 0;
        int vshift = (VAR_4 > 0) ? VAR_3->log2_chroma_h : 0;
        int off    = ((VAR_2->crop_left >> hshift) << VAR_0->pixel_shift) +
                      (VAR_2->crop_top  >> vshift) * VAR_1->linesize[VAR_4];
        VAR_1->data[VAR_4] += off;
    }
    return 0;
}
static int FUNC_0(H264Context *VAR_0, AVFrame *VAR_1, H264Picture *VAR_2)
{ AVFrame *src = VAR_2->f; const AVPixFmtDescriptor *VAR_3 = av_pix_fmt_desc_get(src->format); int VAR_4; int VAR_5 = av_frame_ref(VAR_1, src); if (VAR_5 < 0)
return VAR_5; av_dict_set(&VAR_1->metadata, "stereo_mode", ff_h264_sei_stereo_mode(VAR_0), 0); if (VAR_2->sei_recovery_frame_cnt == 0)
VAR_1->key_frame = 1; if (!VAR_2->crop)
return 0; for (VAR_4 = 0; VAR_4 < VAR_3->nb_components; VAR_4++) { int hshift = (VAR_4 > 0) ? VAR_3->log2_chroma_w : 0; int vshift = (VAR_4 > 0) ? VAR_3->log2_chroma_h : 0; int off    = ((VAR_2->crop_left >> hshift) << VAR_0->pixel_shift) +
(VAR_2->crop_top  >> vshift) * VAR_1->linesize[VAR_4]; VAR_1->data[VAR_4] += off; } return 0; }