comparison mpegvideo_enc.c @ 10832:f20726a6d538 libavcodec

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.
author michael
date Sat, 09 Jan 2010 18:33:21 +0000
parents 4605bd2fdb7f
children f6afc7837f83
comparison
equal deleted inserted replaced
10831:94982978af3b 10832:f20726a6d538
29 29
30 #include "avcodec.h" 30 #include "avcodec.h"
31 #include "dsputil.h" 31 #include "dsputil.h"
32 #include "mpegvideo.h" 32 #include "mpegvideo.h"
33 #include "mpegvideo_common.h" 33 #include "mpegvideo_common.h"
34 #include "h263.h"
34 #include "mjpegenc.h" 35 #include "mjpegenc.h"
35 #include "msmpeg4.h" 36 #include "msmpeg4.h"
36 #include "faandct.h" 37 #include "faandct.h"
37 #include "aandcttab.h" 38 #include "aandcttab.h"
38 #include "flv.h" 39 #include "flv.h"
568 avctx->delay=0; 569 avctx->delay=0;
569 s->low_delay=1; 570 s->low_delay=1;
570 break; 571 break;
571 case CODEC_ID_H263: 572 case CODEC_ID_H263:
572 if (!CONFIG_H263_ENCODER) return -1; 573 if (!CONFIG_H263_ENCODER) return -1;
573 if (h263_get_picture_format(s->width, s->height) == 7) { 574 if (ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height) == 7) {
574 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); 575 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);
575 return -1; 576 return -1;
576 } 577 }
577 s->out_format = FMT_H263; 578 s->out_format = FMT_H263;
578 s->obmc= (avctx->flags & CODEC_FLAG_OBMC) ? 1:0; 579 s->obmc= (avctx->flags & CODEC_FLAG_OBMC) ? 1:0;