aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ituh263enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-09 18:33:21 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-09 18:33:21 +0000
commitc46eeae2a80dfe0046c15b542e8b9a2c78f19bf7 (patch)
tree8c0378f0ae122dd5fcd3b101f7b55d0d233188f2 /libavcodec/ituh263enc.c
parentaa11ce6568a190b7c843c57bcbc8f5e1785af99b (diff)
downloadffmpeg-c46eeae2a80dfe0046c15b542e8b9a2c78f19bf7.tar.gz
Add a function to match a 2 element vector of uint16_t and use it in h263 and svq1
instead of custom and bloated code to find an index into a w/h array. Originally committed as revision 21113 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ituh263enc.c')
-rw-r--r--libavcodec/ituh263enc.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index ce64497984..5031dd5672 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -82,22 +82,6 @@ static const uint8_t wrong_run[102] = {
19, 2, 1, 34, 35, 36
};
-int h263_get_picture_format(int width, int height)
-{
- if (width == 128 && height == 96)
- return 1;
- else if (width == 176 && height == 144)
- return 2;
- else if (width == 352 && height == 288)
- return 3;
- else if (width == 704 && height == 576)
- return 4;
- else if (width == 1408 && height == 1152)
- return 5;
- else
- return 7;
-}
-
/**
* Returns the 4 bit value that specifies the given aspect ratio.
* This may be one of the standard aspect ratios or it specifies
@@ -156,7 +140,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
put_bits(&s->pb, 1, 0); /* camera off */
put_bits(&s->pb, 1, 0); /* freeze picture release off */
- format = h263_get_picture_format(s->width, s->height);
+ format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height);
if (!s->h263_plus) {
/* H.263v1 */
put_bits(&s->pb, 3, format);