Revision c46eeae2 libavcodec/ituh263enc.c

View differences:

libavcodec/ituh263enc.c
82 82
19,  2,  1, 34, 35, 36
83 83
};
84 84

  
85
int h263_get_picture_format(int width, int height)
86
{
87
    if (width == 128 && height == 96)
88
        return 1;
89
    else if (width == 176 && height == 144)
90
        return 2;
91
    else if (width == 352 && height == 288)
92
        return 3;
93
    else if (width == 704 && height == 576)
94
        return 4;
95
    else if (width == 1408 && height == 1152)
96
        return 5;
97
    else
98
        return 7;
99
}
100

  
101 85
/**
102 86
 * Returns the 4 bit value that specifies the given aspect ratio.
103 87
 * This may be one of the standard aspect ratios or it specifies
......
156 140
    put_bits(&s->pb, 1, 0);     /* camera  off */
157 141
    put_bits(&s->pb, 1, 0);     /* freeze picture release off */
158 142

  
159
    format = h263_get_picture_format(s->width, s->height);
143
    format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height);
160 144
    if (!s->h263_plus) {
161 145
        /* H.263v1 */
162 146
        put_bits(&s->pb, 3, format);

Also available in: Unified diff