/* Returns the video format preset matching the input video dimensions and time base.  */
static VideoFormat GetDiracVideoFormatPreset(AVCodecContext *avccontext)
/* Returns the video format preset matching the input video dimensions and time base.  */
static VideoFormat GetDiracVideoFormatPreset(AVCodecContext *avccontext)
{
    unsigned int num_formats = sizeof(ff_dirac_video_formats) /
                               sizeof(ff_dirac_video_formats[0]);
    unsigned int idx = ff_dirac_schro_get_video_format_idx(avccontext);
    return (idx < num_formats) ?
                 ff_dirac_video_formats[idx] : VIDEO_FORMAT_CUSTOM;
}