[Ffmpeg-cvslog] r7097 - in trunk/libavcodec: h261.c mpegvideo.c mpegvideo.h

bcoudurier subversion
Thu Nov 16 10:58:36 CET 2006


Author: bcoudurier
Date: Thu Nov 16 10:58:34 2006
New Revision: 7097

Modified:
   trunk/libavcodec/h261.c
   trunk/libavcodec/mpegvideo.c
   trunk/libavcodec/mpegvideo.h

Log:
throw error if unsupported resolution is used with h261

Modified: trunk/libavcodec/h261.c
==============================================================================
--- trunk/libavcodec/h261.c	(original)
+++ trunk/libavcodec/h261.c	Thu Nov 16 10:58:34 2006
@@ -77,7 +77,7 @@
     s->dsp.h261_loop_filter(dest_cr, uvlinesize);
 }
 
-static int ff_h261_get_picture_format(int width, int height){
+int ff_h261_get_picture_format(int width, int height){
     // QCIF
     if (width == 176 && height == 144)
         return 0;

Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c	(original)
+++ trunk/libavcodec/mpegvideo.c	Thu Nov 16 10:58:34 2006
@@ -1208,6 +1208,10 @@
         s->low_delay=1;
         break;
     case CODEC_ID_H261:
+        if (ff_h261_get_picture_format(s->width, s->height) < 0) {
+            av_log(avctx, AV_LOG_ERROR, "The specified picture size of %dx%d is not valid for the H.261 codec.\nValid sizes are 176x144, 352x288\n", s->width, s->height);
+            return -1;
+        }
         s->out_format = FMT_H261;
         avctx->delay=0;
         s->low_delay=1;

Modified: trunk/libavcodec/mpegvideo.h
==============================================================================
--- trunk/libavcodec/mpegvideo.h	(original)
+++ trunk/libavcodec/mpegvideo.h	Thu Nov 16 10:58:34 2006
@@ -824,6 +824,7 @@
                     int motion_x, int motion_y);
 void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number);
 void ff_h261_encode_init(MpegEncContext *s);
+int ff_h261_get_picture_format(int width, int height);
 
 
 /* h263.c, h263dec.c */




More information about the ffmpeg-cvslog mailing list