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
This commit is contained in:
Michael Niedermayer
2010-01-09 18:33:21 +00:00
parent aa11ce6568
commit c46eeae2a8
6 changed files with 16 additions and 33 deletions

View File

@@ -31,6 +31,7 @@
#include "dsputil.h"
#include "mpegvideo.h"
#include "mpegvideo_common.h"
#include "h263.h"
#include "mjpegenc.h"
#include "msmpeg4.h"
#include "faandct.h"
@@ -570,7 +571,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
break;
case CODEC_ID_H263:
if (!CONFIG_H263_ENCODER) return -1;
if (h263_get_picture_format(s->width, s->height) == 7) {
if (ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height) == 7) {
av_log(avctx, AV_LOG_INFO, "The specified picture size of %dx%d is not valid for the H.263 codec.\nValid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try H.263+.\n", s->width, s->height);
return -1;
}